Looking at the description of the locker problem, my gut told me to investigate a smaller problem to see if an interesting pattern emerged. So, I simulated a smaller problem (10 students, 10 lockers) to see what I could turn up.
After simulating my smaller case, I noticed that only 1, 4, and 9 are the only closed lockers in my simulation. While 2, 3, 5, 6, 7, 8, and 10 are the ones that remained open. This observation led me to investigate the factors of these lockers further and see if perfect squares are the only lockers that remain closed after all the students go by.
- Looking at perfect squares such as 25, the factors are 1, 5 and 25. Or 841, the factors are 1, 29 and 841. Perfect squares have an odd number of students opening or closing the lockers since they all have an odd number of factors.
- Comparing it to non-square composites such as 96, the factors are 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, and 96. For prime numbers such as 101, the factors are 1, 101. Or 887, the factors are 1, 887. These all have an even number of students opening or closing the lockers as they all have an even number of factors.
Perfect squares have an odd number of students opening or closing the lockers because to create a perfect square, a number has to multiply by itself, adding only 1 student(count) to open the locker (factor). While in most cases, all other numbers, prime and non-square composites, every number needs to multiply with another. Hence, the commonly taught idea of the rainbow in classrooms.
Technically, 0 is considered even. Thus, our initial case of all open is represented by an even number. Since any even number incremented by 1 becomes odd, we have a pattern of open represented by an even number of students who have gone by and closed represented by an odd number of students who have gone by.
Thus, all perfect squared number lockers will be closed. These lockers are 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900 and 961—a total of 31 lockers. (12 up to 312)
The remaining lockers will be the ones remaining open, and there are a total of 1000-31 = 969 lockers are open.
Great solution and explanation of the process and results here! I like the examples you have chosen, your inclusion of the primes, and the 'rainbow' representation of paired factors. Great work!
ReplyDelete