Enter your email address:


August 26, 2009

100 doors in a row problem



There are 100 doors in a row numbered from 1 to 100. Initially all
are closed. Then you make 100 passes by the 100 doors. In pass 1 you
toggle the all the doors (1,2,3,4....)starting from the first door.
In the second pass you toggle every second door(2,4,6,8,...). In the
third pass you toggle all third doors (3,6,9...). Similarly you make
100 passes.

what state are the doors in after the last pass?

which are open which are closed??

7 comments:

Anonymous said...

open........
factors of 100 = 1,2,4,5,10,20,25,50,100
9 factors so state remains same.

Anonymous said...

all prime no door close....
1st door open....
doors having exactly even number of factors will be closed....
doors having exactly odd number of factors will be open....

Unknown said...

Only the square numbered doors (1, 4, 9, 16, 25, 36, 49, 64, 81, 100) are open. All others are closed.

Varun said...

perfect square number will be opened bcoz perfect square will have even number of divsors.

wheatington said...

I agree with Damien.

Secret Squïrrel said...

@Varun
Numbers with an even number of unique factors will be in the same state as at the start, in this case, closed.

Square numbers have an odd number of factors.

Anonymous said...

All are open. It said I went through them all the first time... but it never said I closed them again...