Sunday, September 15, 2024

My solution to the locker problem

 




My rendering of the locker problem is quite simple. Let us first discuss what happens to the first 500 lockers. All prime numbers (numbers that cannot be divided by any other number except for 1 and itself) would be closed because no student will change their state after the first student. Other composite numbers, unless they are the square of a certain number, will change their state an even number of times. Whereas those that are perfect squares of a number will change state an odd number of times, so they will be closed. Take the example of the 300th locker, since 300 is a composite number but not a perfect square, it changes state from open 14 times, so, in the end, it will still be open. After the 500th locker, every locker changes its state once. 

During the problem, I used visualization (through drawing), and analyzing by cases. I listed all the scenarios that are possible and tried to detect the pattern.


1 comment:

  1. You stated that prime-numbered lockers would remain closed after the first student. This isn't correct because prime numbers will still be toggled by at least two students (Student #1 and the student corresponding to the prime number), so they would be toggled twice and end up closed, not due to their prime nature, but due to being toggled an even number of times.

    ReplyDelete

Final Reflection Post

  This semester went by very quickly, and I truly enjoyed the time we spent together. I learned the importance of exploring learning opportu...