Case of Open Locker Number 4...

Every day, 100 100 students enter a school that has 100 100 lockers. All the lockers are closed when they arrive.

Student 1 1 opens every locker.

Student 2 2 closes every second locker.

Student 3 3 changes the state of every third locker i.e. he opens it if it is closed and closes it if its open.

Student 4 4 changes the state of every fourth locker and so on... so that student n n changes the state of every n t h nth locker.

One day, on account of a blizzard, several students are absent. Regardless, those present complete the procedure and simply skip the students who are absent. For e.g. if student 3 3 is absent, then nobody changes the state of every third locker.

At the end of the process, it is found that only locker number 4 4 is open and all the other 99 99 lockers are closed...

How many students were absent that day ?

More interestingly, given a locker number n, find a general rule that keeps only locker n open and all other lockers closed.


The answer is 84.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Satyen Nabar
Jan 12, 2015

Instead of finding students that were absent, lets find the number of students that were present that day.

We know that if student 1 was present he would open all lockers including 1. But we want only locker 4 to be open, so 1 must be absent. Same goes for student 2 and 3.

Student 4 has to be present for locker to open. However this now opens lockers 8, 12, 16, 20...

Student 8 must be present to close locker 8 but now that closes lockers 16, 24, 32, 40.... However lockers 12, 20, 28, 36... are still open.

Student 12 must be present but this reopens lockers 24, 48, 72 and 96. Student 20 must be present as also student 24. Sending student 20 opens up locker 40 again.

Working on this thoroughly we find that the list of 16 students that were present that day were 4, 8, 12, 20, 24, 28, 40, 44, 52, 56, 60, 68, 76, 84, 88, 92. Thus 84 absent...


Now for the general rule.

Squarefree numbers are the numbers that do not have repeated factors or are not multiples of squares other than 1.

The list of squarefree numbers is { 1, 2, 3, 5, 6, 7, 10, 11, 13, 14,.....}

Now if we want locker 4 to be open we simply multiply this set by 4 and lo and behold we have the students who were present. This works for any locker number n that you want to keep open .

The number of students present will be n {Set of squarefree numbers}

Did the exact same! Nice problem(and previous one too)!

Kartik Sharma - 6 years, 5 months ago

Did exactly same but could not generalize.Nice generalization! Sir I think we must see what is happening when two doors are opened and all other doors are closed.

Kalpok Guha - 6 years, 5 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...