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

On graduation day, 100 grade 8 students lined up outside the school. As they entered the school they passed their lockers. The first student opened up all the locker doors. The second student closed every second locker door. The third student changed the position of every third locker door. If the door was open the student closed it. If the door was closed the student opened it. The fourth student changed the position of every fourth locker door. This pattern continues. Which doors are open after a 100 students have entered the school?
Explain.

Please explain how you got to the answer of this problem and explain what steps you took to get the answer etc.
Thanks to anyone who actually tries to help.
Much Appreciated!

2007-09-29 06:39:02 · 1 answers · asked by Anonymous in Education & Reference Homework Help

1 answers

The solution lies in realizing that factors come in pairs. For example consider locker number 26. 26 has factors of 2 and 13. when student 2 comes by he closes the door, and when 13 comes by, he opens it, then when 26 comes by he closes it and the door will remain closed. Of the two pairs of factors of 26, one of the pair will open it and the other will close it.

The exception to this rule is the perfect squares, 1, 4, 9, ... Consider door 25, for example, 25 has factors of 5 times 5. But 5 is only one number. When the fifth student comes by he will close the door, and there isn't another factor to open it. 25 will open it and it will remain open.

The solution, then, is that all doors will be closed except for the perfect square numbered doors which will be open.

The steps I took: I wrote a program in java to do the grunt work of opening and closing doors. When I saw the surprising result, I realized why.

2007-09-29 09:57:33 · answer #1 · answered by jsardi56 7 · 1 0

fedest.com, questions and answers