The Mystery: Solving the 100 Locker Math Problem with a Simple Pattern

  • Thread starter T@P
  • Start date
In summary, the students who went first opened all the lockers and the students who went second closed every other locker.
  • #1
T@P
274
0
there are 100 lockers lined up in a row, and for some unknown reason they are unlocked. for a similarly unknown reason there are 100 students lined up outside the hallway containing the 100 lockers. the first student goes and opens all the lockers. the second then goes and closes every second. the third either opens or closes every third locker, (changes the "state" of it) for example, the 6th locker is closed when the 3rd guy comes to it, so he opens it. after all 100 students go by, what lockers are open/closed? please note i don't think that you should list out all 100 lockers and their state, there is a pattern.
 
Physics news on Phys.org
  • #2
The state of each locker is altered a number of times equal to the total number of factors of the locker number. So the lockers with numbers that have an even number of factors (including 1) are closed, and the lockers with numbers that have an odd number of factors are open. (Not counting just prime factors, counting all factors, and numbering the lockers from 1)
 
Last edited:
  • #3
Bartholomew said:
...
What do all numbers that have an odd number have in common? It's a pretty well-known property...1,4,9...?
 
  • #4
That's cool!
 
  • #5
What do all numbers that have an odd number of factors have in common?
 
  • #6
Of course, that's what he meant. I'm no expert, but: First you get the prime factorization of the number. Each factor can be generated by choosing some number of each prime factor (a number from 0 to the power of that factor) and multiplying them all together. So the total number of factors is (a + 1) * (b + 1) * (c + 1) ... where a, b, c, ... are the exponents on 2, 3, 5, ... in the prime factorization. So for this product to be odd, all of a + 1, b + 1, c + 1, ... must be odd, so all of a, b, c, ... must be even, so the original number is a perfect square (and vice versa, if it's a perfect square then it has an odd number of factors).
 
  • #7
Bartholomew said:
...
Nicely done. Yeah, Gokul I need to be more careful when I type/post.
 
  • #8
Bartholomew said:
I'm no expert, but...

Me neither, but I believe that's how the experts do it too, but being experts they like to use fancy terms.

[tex]N = \Pi p_i ^{k_i} [/tex]

[tex] \tau (N) = \Pi (k_i + 1) [/tex]

[itex] \tau (N) [/itex], known simply as the tau function, is a multiplicative function that counts the number of divisors of a given number.

So, an "expert" might simply say that for [itex] \tau (N) [/itex] to be odd, all of [itex] k_i [/itex] must be even, or [itex] k_i = 2m_i [/itex]. Which gives [itex] N = \Pi p_i ^{2m_i} = (\Pi p_i ^{m_i} )^2 = M^2 [/itex].
 
  • #9
Is the answer 31? My physics teacher gave this problem as a bonus questions, so I made a C++ program to figure out all the perfect squares between 1 and 1000, and the program says the answer is 31.
I'll get an extra 10% on the next lab if I get this right, so it's kind of important that I get confirmation before Monday, January 10, 2005.
 
Last edited:
  • #10
Select to read. (I'm editing to put into spoiler text because that's what other people did.)

Yes, presuming your question was for 1000 lockers (and students) and they all started off closed and they asked which ones were open after the process was over. (The original post was only for 100 lockers.) You didn't really need the progam, though: like the lay version of what Gokul said, any number with an odd number of factors will end up open, meaning all of the perfect square numbered doors will end up open (which you already know). So all you had to do was look at the square root of 1000 and truncate the decimal places (round down to the nearest integer) and that would be the answer (31).
 
  • #11
jamesrc said:
So all you had to do was look at the square root of 1000 and truncate the decimal places (round down to the nearest integer) and that would be the answer (31).
Thanks for the confirmation. When I get some free time, I will look closer at Goku's stuff to see what it means or at least how he got that.

*edit
that spoiler text is still very visible in a quote box :smile:
 
  • #12
ShawnD said:
When I get some free time, I will look closer at Goku's stuff to see what it means or at least how he got that.

I suggest you read Bart's explanation. It's in a form that's a lot simpler to absorb.
 

Related to The Mystery: Solving the 100 Locker Math Problem with a Simple Pattern

1. What is the "Lockers math problem"?

The "Lockers math problem" is a mathematical problem that involves a hallway with 100 lockers numbered from 1 to 100. Students are asked to open and close the lockers based on a specific set of rules and then determine which lockers are left open at the end.

2. What are the rules of the "Lockers math problem"?

The rules of the "Lockers math problem" are as follows: 1) All lockers start off closed. 2) The first student opens all lockers. 3) The second student closes every second locker. 4) The third student changes the status of every third locker (e.g. if it is closed, they open it, and if it is open, they close it). This pattern continues until the 100th student.

3. What is the solution to the "Lockers math problem"?

The solution to the "Lockers math problem" is that only the perfect squares (1, 4, 9, 16, 25, 36, 49, 64, 81, 100) will be left open at the end. This means that there will be 10 lockers left open in total.

4. How do you prove the solution to the "Lockers math problem"?

The solution to the "Lockers math problem" can be proven using mathematical induction. By proving that the pattern of opening and closing lockers continues until the 100th student, and then showing that only perfect squares will have an odd number of factors (meaning they will be open at the end), we can prove that the solution is correct.

5. What is the significance of the "Lockers math problem"?

The "Lockers math problem" is significant because it demonstrates the concept of perfect squares and factors in a tangible way. It also highlights the importance of patterns and mathematical reasoning in problem-solving. This problem is often used in mathematical competitions and serves as a fun way to practice and apply mathematical concepts.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
16
Views
12K
Replies
3
Views
2K
  • General Math
Replies
1
Views
3K
  • Introductory Physics Homework Help
Replies
2
Views
1K
  • Precalculus Mathematics Homework Help
Replies
3
Views
1K
  • General Discussion
Replies
12
Views
3K
Replies
6
Views
1K
Replies
7
Views
886
Replies
27
Views
2K
Replies
15
Views
2K
Back
Top