Every day, students enter a school that has lockers. All the lockers are closed when they arrive.
Student opens every locker.
Student closes every second locker.
Student changes the state of every third locker i.e. he opens it if it is closed and closes it if its open.
Student changes the state of every fourth locker and so on... so that student changes the state of every locker.
One day several students are absent. Regardless, those present complete the procedure and simply skip the students who are absent. For e.g. if student is absent, then nobody changes the state of every third locker.
Satyen Nabar discussed the problem when one door was opened and all others were closed.This inspired me and tried to interpret the situation when 2 doors are opened and all the others are closed.
I took two cases
Here after 100th operation locker number were opened and all others were closed.I found that and ,,, student nos who were absent.So total students were absent.
In this case after 100th operation locker number were opened and all other were closed.Here I found that students were present.Student no and (which is an exception).So in this case students were absent.
Anyone please confirm these two answers and help me to generalize the problem.
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
Sorry to say that your answers are ...inaccurate. in Case 1 it should be 48 and in Case 2 it should be 75 (quite close, though).
I used a PC program to solve, and checked back to confirm. If you wanna the detail result (which student is absent and which isnot), I can provide for you.
I found out that, since the number of combination of lockers' states is 2n and the number of combination of student's states is also 2n, no 2 combination of student's states lead to the same result. It's some kind of function. :)
Log in to reply
Thank you very much but please provide the the details.And which function do you used to solve it?
Log in to reply
Brute force. Create 2 arrays: current to store the states of the lockers, and result to store the final state you want in case you have many test cases.
Let i be the counter from 1 to 100. If currenti=resulti, then ith student goes to school (so he can change his locker's state); also the state of every lockers j, which are divisible by i, should be altered (close to open and vice versa). If currenti=resulti, ith student is absent, since all students after him cannot change his locker's state.
The "states" of students can be stored in another array for recheck.
Here is result for Case 1
Log in to reply
Log in to reply
The last statement is quite simple to prove mathematically. Do you see how to do that?
Log in to reply
I need a lemma stated that there is an algorithm, so with each combination of the lockers there are at least one combination of the students that satisfies. With that lemma the statement will be easily proved using contradiction.
Fortunately, I described the algorithm in response to Mr. Guha. ;)
It's great that you are looking at further extensions of this problem.
Note that locker 1 will always remain open, so case 2 cannot be true.
I believe that the answer will depend on which 2 lockers stay open, and you need to look at the factors/multiples of the other (non-1) locker.
Log in to reply
I think if the No.1 student is absent,then locker 1 will not remain open.But I think you are right that I should look on the factors of lockers.
Log in to reply
oh yes indeed. Not sure why, but it didn't cross my mind that he could be absent.
Log in to reply