100 Doors Puzzle, state of doors at end?
You have 100 doors in a row that are all initially closed. you make 100 passes by the doors starting with the first door every time. the first time through you visit every door and toggle the door (if the door is closed, you open it, if its open, you close it). the second time you only visit every 2nd door (door #2, #4, #6). the third time, every 3rd door (door #3, #6, #9), ec, until you only visit the 100th door.
What state are the doors in after the last pass? Which are open which are closed?
Puzzle asked in: Google,Adobe,Amazon,Oracle
Answer – Only perfect square doors will be open at the end.
For example, after the first pass every door is open. on the second pass you only visit the even doors (2,4,6,8…) so now the even doors are closed and the odd ones are opened. the third time through you will close door 3 (opened from the first pass), open door 6 (closed from the second pass), etc..
question: what state are the doors in after the last pass? which are open which are closed?
solution: you can figure out that for any given door, say door #42, you will visit it for every divisor it has. so 42 has 1 & 42, 2 & 21, 3 & 14, 6 & 7. so on pass 1 i will open the door, pass 2 i will close it, pass 3 open, pass 6 close, pass 7 open, pass 14 close, pass 21 open, pass 42 close. for every pair of divisors the door will just end up back in its initial state. so you might think that every door will end up closed? well what about door #9. 9 has the divisors 1 & 9, 3 & 3. but 3 is repeated because 9 is a perfect square, so you will only visit door #9, on pass 1, 3, and 9… leaving it open at the end. only perfect square doors will be open at the end.
1.It depends on the number of factors the Door ‘i’ has(including 1 and i ).for example,Door Number having odd number of Factors , then it would be Opened.else it will be Closed.
Ex 1:76 – factors are-1, 2, 4, 19, 38, 76…even(6)factors it has .. so 76th door will be closed..
Ex 2:64- factors are- 1,2,4,8,16,32,64..odd(7) factors has..so 64th door will be opened
or
2.Only Perfect square doors will be open …
Your Answer
More puzzles to try-
Relationship Numbers Riddle
Replace the question mark with the correct number to complete the series, given the pair of numbers exhibits a similar ...Read More »Would there be a time at which he was at the same position
If a mountain climber climbed up a mountain one day from midnight to midnight the next day and does the ...Read More »Clock Hands Together
How many times in a given day, minutes, and hour clock comes in a straight line?Read More »Red and Green
We go at red, but stop at green. What is it?Read More »I am Double Myself
I am a prime number. The double of myself is equal to the square of me. which number am I?Read More »How is this possible?
Both Sachin and Sehwag were batting on 94. Three balls were left and the team needed 7 runs to win. ...Read More »Which one weigh more?
Does an ounce of gold or an ounce of feathers weight moreRead More »Car Wheel Rotation
Which wheel of car does not rotate when you turn your car right?Read More »Magical flowers!!
A devotee goes to three temples, temple1, temple2 and temple3 one after the other. In front of each temple, there ...Read More »Use the Homophones riddle
Use the homophones “to”, “too”, and “two” in one question.Read More »Three ways and monk questioning riddle
You are walking down the road trying to find enlightenment when you come to a monk and a three-way fork ...Read More »Live in closed room
He has a little house in which he live all alone. It has no doors or windows, and if he ...Read More »Tricky equation Riddle
If, 29 – 1 = 30 9 – 1 = 10 14 – 1 = 15 Based on above logic, ...Read More »Keys can’t open a door riddle
What has 88 keys but can’t open a single door?Read More »Craig & Tracy
Craig died in Florida. Shortly after, Tracy died at sea. Nobody mourned, In fact, everyone was absolutely delighted. Why?Read More »Most unusual paragraph riddle
How quickly can you find out what is so unusual about it? It looks so ordinary you’d think nothing was ...Read More »Jump higher than mountain puzzle
Who can jump higher than a mountain?Read More »Magic Maths
using four eights (8) and a one (1) and one mathematical symbol , create the number 100Read More »Can you calculate the total elapsed time – [HARD]
An observation is made on a clock and it is found that the hour hand is placed exactly at the ...Read More »The Month Rebus
Can you guess the name of the month by looking at the below rebus?Read More »