There are 100 doors in a row. You will have to visit the doors 100 times in a particular
fashion. In first visit, you will visit all the doors. In second visit you will go to every second
door, in third every third door and so on. Every visit, you will toggle the doors you visit (i.e
you will open the door, if its closed and close it, if its open). How may door remain open,
given that all the doors are closed initially?
50
1
32
10
Answers
10 Doors remains open if Initially all doors are closed.
Given:
100 Closed door
Every visit, you will toggle the doors you visit
visit the doors 100 times in a particular fashion.
In first visit, you will visit all the doors. In second visit you will go to every second door, in third every third door and so on.
To Find:
How may door remain open
Solution:
Perfect Square have odd number of factors
Natural Numbers which are not perfect Square has even Number of Factors
Understand that , Door are initially closed hence it will open if you visit odd number of times
You will visit a door odd number of times if it has odd factors.
As you will visit a door as many times as it has factors
For example Gate number 3 you will visit on 1st and 3rd visit
Gate number 4 you will visit on 1st , 2nd and 4th visit
Factors of 3 are 1 , 3
Factors of 4 are 1 , 2 and 4
So find all perfect square from 1 to 100
1 , 4 , 9 , 16 , 25 , 36 , 49 . 64 , 81 and 100
10 numbers are perfect square
Hence they have odd number of factors
so 10 Doors remains open
Correct option is 10