Assignment #5

The Locker Problem

 

Imagine you are at a school that still has student lockers. There are 1000 lockers, all shut and unlocked, and 1000 students.

1. Suppose the first student goes along the row and opens every locker.

2. The second student then goes along and shuts every other locker beginning with the 2nd locker.

3. The third student changes the state of every third locker beginning with locker number 3. (If the locker is open the student shuts it, and if the locker is closed the student opens it.)

4. The fourth student changes the state of every fourth locker beginning with locker number 4.

5. Imagine that this continues until all of the thousand students have followed the pattern with the thousand lockers. At the end, which lockers will be open and which will be closed? Why?