1000 students walk down a hallway with 1000 lockers....

Sequences, counting (including probability), logic and truth tables, algorithms, number theory, set theory, etc.
User avatar
maggiemagnet
Posts: 305
Joined: Mon Dec 08, 2008 12:32 am
Contact:

1000 students walk down a hallway with 1000 lockers....

Postby maggiemagnet » Tue Mar 17, 2009 8:34 pm

On the first day back after Spring Break, the students enter a long hallway containing one thousand lockers. The first student, as he walks from one end to the other, opens every locker door. The second student, as she follows the first, closes every other door. The third student follows the second, and switches every third door; that is, if a door is open, he closes it, and if a door is closed, he opens it.

The students continue with this pattern, the n-th student switching every n doors. After a thousand students have walked down the hallways of lockers, which doors end up being open?


Please tell me there is a simple, or simple-ish, way of doing this!?! :shock:

User avatar
stapel_eliz
Posts: 1731
Joined: Mon Dec 08, 2008 4:22 pm
Contact:

Postby stapel_eliz » Wed Mar 18, 2009 1:18 am

maggiemagnet wrote:Please tell me there is a simple, or simple-ish, way of doing this!

There is! :wink:

This old chestnut has been around forever, so there are some great archived explanations. Try "Ask Dr. Math" for an excellent presentation. :D

User avatar
maggiemagnet
Posts: 305
Joined: Mon Dec 08, 2008 12:32 am
Contact:

Re: 1000 students walk down a hallway with 1000 lockers....

Postby maggiemagnet » Sat Mar 21, 2009 10:41 pm

The explanation in the link was so much better. Thank you! :clap:


Return to “Discrete Math”