English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Can you figure out this tricky math problem? (10 points to the first right answer! You must show logic behind answer.)

Lockers in a row are numbered 1, 2, 3, ..., 1000. At first all the lockers are closed. A person walks by, and opens every other locker, starting with locker #2. Thus lockers 2, 4, 6, ..., 998, 1000 are open. Another person walks by and changes the "state" (i.e.,closes a locker if it is open, opens a locker if it is closed) of every third locker starting with #3: 3, 6, 9... Then another person changes the state of every 4th locker. The process conintues until no more lockers can be altered. Which lockers will be closed?

2007-09-22 14:11:38 · 2 answers · asked by Eric and Alex K. 1 in Science & Mathematics Mathematics

2 answers

Person 1 (which you did not describe) has closed all lockers.
Person 2 begins at locker 2 and changes the state of any even locker. Locker 2 gets opened; 2 never gets touched again.
Person 3 begins at locker 3 (closed) and changes the state of every third locker. 3 gets opened and will never be touched again.
Person 4 finds locker 4 opened (by person 2) and closes it. 4 will never be touched again. She changes the state of every 4th locker.
Person 5 finds locker closed (by person 1) and opens it. 5 will never be touched again.
Person 6 finds 6 closed (by 3) and opens it for good.
Person 7 finds 7 closed (by 1) and opens it for good.
Person 8 finds 8 closed (by 4) and opens it for good.
Person 9 finds 9 open (by 3) and closes it for good.
10 divisible by 2 and 5 : two persons had touched it, it is closed for 10 who opens it for good
11 is prime, the door is closed, person 11 opens it for good.
12 is divible by 2 (opens it), 3 (closes it), 4 (opens it), 6 (closes it): Four persons touched it -- 12 found it closed and opens it for good.
13 is prime; person 13 opens it for good.
14 divisible by 2 and 7; 14 opens it for good.
15 divisible by 3 and 5; 15 opens it for good.
16 divible by 2, 4, 8. Person 16 finds it open, closes it for good.

So far, only squares are left closed, the rest are left open.

2007-09-22 14:31:42 · answer #1 · answered by Raymond 7 · 0 0

Okay, I figured it out. It's the number of divisors of the number that determine whether the door is opened or closed. In particular, whether the no. of divisors is even or odd.
Let's leave 1 out of the possible divisors and for the sake of simplicity let the first person come along and close all the lockers.
The second person comes along and opens the even no. lockers so that the second locker (2 has one divisor as does all primes) is opened and since all subsequent people coming along start after 2, it remains open.
The third - same thing as the second accept every third locker is changed. The 3rd locker wasn't touched by the the second changer so goes from closed to open and remains that way by the same reasoning as the second.
One more and we'll go to the general case. The 4th person does what he does. The fourth locker had two factors, 2 and 4. It's opened on the #2 round and closed this time and remains closed.
In general: we come to the nth person and he does as he's programmed to do. Say n has r divisors, n1, n2 . . . nr. Of course the divisors are all less than n. Consider the nth locker. It's closed until the n1 person comes along and opens it and then is closed by the n2 person etc. It ends up open if the number of divisiors is odd and closed if the number of divs. is even.

2007-09-22 14:51:30 · answer #2 · answered by rrsvvc 4 · 0 0

fedest.com, questions and answers