# Lockers

• Oct 27th 2009, 10:43 PM
Aquafina
Lockers
A school has 1000 students and 1000 student lockers. The lockers are in
a line in a long corridor and are numbered from 1 to 1000.

Initially all the lockers are closed (but unlocked).
The first student walks along the corridor and opens every locker.

The second student then walks along the corridor and closes every second locker, i.e. closes lockers 2, 4, 6, etc. At that point there are 500 lockers that are open and 500 that are closed.

The third student then walks along the corridor, changing the state of every third locker.Thus s/he closes locker 3 (which had been left open by the _rst student), opens locker 6 (closed by the second student), closes locker 9, etc.

All the remaining students now walk by in order, with the kth student changing the state of every kth locker, and this continues until all 1000 students have walked along the corridor.

i) How many lockers are closed immediately after the third student has walked along the corridor? Explain your reasoning.

(ii) How many lockers are closed immediately after the fourth student has walked along the corridor? Explain your reasoning.

(iii) At the end (after all 1000 students have passed), what is the state of locker 100? Explain your reasoning.

(iv) After the hundredth student has walked along the corridor, what is the state of locker 1000? Explain your reasoning.
• Oct 27th 2009, 10:45 PM
Aquafina
I am not sure about my answers, this is what I have:

i) student 3 opens all even multiples of 3, closes odd multiples. He changes 333 lockers, and 333/3 = odd, so last thing he does is close a locker, which isnt cancelled by a further opening.

so 1 more closed at the end. ==> 501 closed

ii) All multiples of 3 and 4 will be closed, and multiples of 4 not multiples of 3 opened

all numbers of the form 12a are multiples of 3 and 4

1000 div by 4 250 times, so 250 lockers changed

1000 is div by 12, 83 times, so 83 closed

250 - 83 = 167 opened

so the total is: 167 - 83 = 83 lockers opened which not cancelled by another closing

so 501 - 84 = 417 lockers closed at the end

iii) 1000 is div by: 1, 2, 4, 5, 10, 20, 25, 50, 100

changed 9 times, open, close ... open, close, 100th student opens

so it is open

iv) 1000 div by: 1. 2. 4. 5. 8, 10, 20, 25, 40, 50, 100

so changed 11 times

opened by 100th student, so it is open

Any help please whether on these are right? Also, could someone present with a good method to solve this question? Thank you
• Oct 27th 2009, 11:50 PM
mr fantastic
Quote:

Originally Posted by Aquafina
A school has 1000 students and 1000 student lockers. The lockers are in
a line in a long corridor and are numbered from 1 to 1000.

Initially all the lockers are closed (but unlocked).
The first student walks along the corridor and opens every locker.

The second student then walks along the corridor and closes every second locker, i.e. closes lockers 2, 4, 6, etc. At that point there are 500 lockers that are open and 500 that are closed.

The third student then walks along the corridor, changing the state of every third locker.Thus s/he closes locker 3 (which had been left open by the _rst student), opens locker 6 (closed by the second student), closes locker 9, etc.

All the remaining students now walk by in order, with the kth student changing the state of every kth locker, and this continues until all 1000 students have walked along the corridor.

i) How many lockers are closed immediately after the third student has walked along the corridor? Explain your reasoning.

(ii) How many lockers are closed immediately after the fourth student has walked along the corridor? Explain your reasoning.

(iii) At the end (after all 1000 students have passed), what is the state of locker 100? Explain your reasoning.

(iv) After the hundredth student has walked along the corridor, what is the state of locker 1000? Explain your reasoning.

Discussed at MHF a number of times. See here http://www.mathhelpforum.com/math-he...r-problem.html