Skip to content

skim1420/lockers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Lockers

This is a programmatic solution to my daughter's math homework problem:

  • There are 100 lockers, all closed.
  • Person #1 opens every locker.
  • Person #2 flips (opens if closed, closes if open) every other locker
  • Person #3 flips every 3rd locker ...
  • Person #n flips every nth locker

After person #100 finishes, which lockers are open?

You'll find the solution very curious.

We've taken 2 approaches to it so far. One brute force, and a second one that tests a theory.

About

Solution to the Lockers math problem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages