Sunday, September 17, 2023

The locker problem(updated version)

 When I see questions that are usually very integrated and large numbers like 100, 1000, I first think that this is going to be a pattern question. I usually start experimenting with smaller examples. So I chose 10 lockers and 10 students, which are also integrated and relatively small, and started to draw a picture and observe it according to the requirements of the question.

From the result. it shows number 1,4,9 locker is closed whereas the others are open. We find that 1, 4, and 9 are all squares, so we can hazard a guess that for 1000 lockers and 1000 students, all lockers up to 1000 squares will be closed and all others will be open.


The following is going to explore why it would be perfectly square numbers that are closed.
Locker #1: only the first student will close it, so it will eventually close
Locker #2: It is rattled by students #1 and #2, so it will eventually open.
Locker 3: Toggled by students #1 and #3, so it will eventually open.
Locker 4: Toggled by students #1, #2, and #4, so it will eventually close.
The factors that cause students to switch lockers are a factor of one number. There are an odd number of factors that are not perfect squares. For example, the factors for 6 are 1, 2, 3, and 6. However, the total number of factors is even (4 factors), which means that locker #6 will be switched an even number of times and will end up in the open state.
In general, only perfect square lockers will have an odd number of factors. For example, locker #9 has factors 1 3 9. It will be toggled three times and will end up close.

Thus, after all 1000 students have had their turn, the perfectly square lockers (1,4,9,16,...) will be closed and the rest will be open.


2 comments:

  1. Ok -- good strategy, and good conjecture that it will be the square numbers. But you still haven't convinced me WHY the square numbers are the lockers that will be closed! Please add your explanation of why this solution makes sense, and let me know once it is done so that I can mark this as complete at that time!

    ReplyDelete
  2. Thanks for updating this, Chernie! It's good now (though I'm still a bit mystified by one sentence included here: "There are an odd number of factors that are not perfect squares. " I'm not sure what this could mean...)

    ReplyDelete