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

a school has astrange principal. there are 1000 students and 1000 lockers. her asks the first student to open all the lockers. then he asks he second studen to open every second locker and to close it if it is already open. then he asks the third student to open evry 3rd locker and close it if it is already open and so on till the 1000th student id reached....how many lockers are open after all 1000 students are done?

2006-11-28 00:08:21 · 6 answers · asked by Tower Of Babel 2 in Science & Mathematics Mathematics

6 answers

31 are open.

Each squared number is open at the end:
1, 4, 9, 16, 25, ... , 961 (31 * 31)

Take any number x.
List all pairs of factors
eg 6 = 2*3, 1*6.
If the factors numbers are different (2<>3, 1<>6) then an even number of students will open and close the locker, so the locker will remain closed. (for six, students 2, 3, 1 and 6 will change the state, 4 students = even = does not change state = closed.)

But if the factors are the same (it is a square, eg 4 = 2*2) then there is an uneven number of students that will change the state, so the locker will be open.
4 = 2*2, 1*4, so students 1, 2, and 4 will change the state of the locker so it will stay open.

2006-11-28 00:51:05 · answer #1 · answered by Christian 1 · 1 0

31. Number the lockers and the students 1 to 1000. Each student changes the open/closed state of lockers that are divisible by the student's number. (Even the 1st student does if we assume the lockers are all closed to begin with.) Take as an example the 20th locker. It is opened by student 1, closed by 2, opened by 4, closed by 5, opened by 10 and closed by 20. Note that any number except the perfect squares, including primes, has an even number of divisors if you include 1 and the number itself. So every locker from 1 to 1000 that is not a perfect square gets its state changed an even number of times. Since the square root of 1000 is 31 and a little, there are 31 perfect squares from 1 to 1000. Therefore all lockers except the perfect squares, or 969 lockers, end up closed and 31 are open.
EDIT: Since hokie has accused me of changing my answer to conform with his answer, both implicitly in his answer and explicitly via email, I am compelled to answer: I hadn't seen h's answer when I realized my error and changed my answer; furthermore, h's answer wasn't displayed when I submitted the change and the display got updated. Many people edit their answer when they realize they didn't think fully about the problem. And admittedly the luxury of making corrections without losing your position could be considered unfair. I've often encountered the situation (suspicious-seeming changes to an earlier answer) that hokie did. It's the display/update lag effect. The way to minimize the likelihood of that situation is to (1) write your answer in a text editor; (2) update the question display and check out the answers; (3) start your answer, copy & paste into the answer and submit it. If your connection is fast, you may go through step 3 in 10 sec or so. But there will still be that uncertainty, however small, which is unavoidable, plus however long it takes Y!A! to get new/updated answers into the display that others see. Peace.

2006-11-28 08:27:56 · answer #2 · answered by kirchwey 7 · 1 0

I wrote a spreadsheet program to carry out the process, but now that I've looked at the result and also looked at a few of the other responses, I understand why the answer that the spreadsheet has given is correct.

The first person who posted observed that all of the numbers have an even number of factors if you count 1. This is not true.

Square numbers have one factor that is repeated, even if you count 1.

1 = 1*1
4 = 2*2
9 = 3*3

And so forth.

The first poster's logic is otherwise correct, but since square numbers always have an odd number of factors, the lockers that correspond to square numbers will have their state changed an odd number of times and not an even number of times. Having started out closed (before the first student went to work) only the lockers whose numbers are perfect squares will remain open after the 1000th student finishes his work.

So there will be 31 lockers that are open - the number of perfect squares that are less than or equal to 1000.

Well, now that the first poster has changed his answer, he's right too...

2006-11-28 08:44:30 · answer #3 · answered by hokiejthweatt 3 · 0 0

Taking a guess, I beleive there will be 5 open and 495 closed lockers.

After the 1st person opens all the lockers, the second person will start at the second locker and go to every 2nd locker.

So the first locker will remain open and the second locker will be closed.

The 3rd person will start at the 3rd locker and will close that locker and then go to every 3rd locker

1st locker - open, 2nd - closed, 3rd -closed

The 4th person will open the 4th locker and go to every 4th locker...
The 4th locker was opened by the 1st, but closed by the second but skipped by the 3rd person.

so lockers 1, 4, 16, 64, and 256th would be open.

2006-11-28 08:29:15 · answer #4 · answered by Dee_Smithers 4 · 0 1

None of them. The lockers have all been closed after each student.

2006-11-28 08:44:04 · answer #5 · answered by Kbrand5 2 · 0 1

we can see that after the first and the eleventh pupil do their task, the first lockers will return to their initual state
so after 1000 students have done their tasks , all the lockers will be opened

2006-11-28 08:29:01 · answer #6 · answered by James Chan 4 · 0 1

fedest.com, questions and answers