How many doors?

If there are 100 doors and 100 people numbered from 1-100, and each of this person goes and CHANGES THE CURRENT STATE OF A DOOR (rules below),

i.e. , if a door is initially closed, one person will go and open it IF AND ONLY IF that door number is a multiple of the number allotted to him. Example, if all doors are initially closed, number 1 will go and open all of them. Then number 2 will go and close 2,4,6,8,... Then number 3 will go and close 3,9,15,... and open 6,12,18,... as 2 had closed them and so on.

At the end how many doors will be open if we assume that ALL DOORS WERE INITIALLY CLOSED?


The answer is 10.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

4 solutions

Payal Sheth
Jul 6, 2014

If a door is initially closed, that door number would need even number of factors so that the door's state would be changed even number of times to make its state finally closed.

eg. 2- 1 will come and open it, 2 will go and close it,

7- 1 will go and open it, 7 will go and close it.

50- 1 will go and open it, 2 will go and close it, 5 will go and open it, 10 will close it, 25 will open and finally 50 will close it. Similarly with other numbers.

Now think how many numbers from 1-100 have odd number of factors? The answer is all square numbers. Now, in 1-100 there are 10 square numbers, so the answer is simply 10.

HAAAWWWW, you are plagiarising.

Rohan Chowdhary - 6 years, 11 months ago
Vijay Simha
Apr 4, 2018

A door is toggled in n-th walk if n divides the door number.

For example the door number 45 is toggled in 1st, 3rd, 5th, 9th and 15th walk.

The door is switched back to initial stage for every pair of divisors. For example 45 is toggled 6 times for 3 pairs (5, 9), (15, 3) and (1, 45).

It looks like all doors would be closed at the end. But there are door numbers which would become open, for example 16, the pair (4, 4) means only one walk. Similarly all other perfect squares like 4, 9, 25.36….etc

The final answer is 1, 4, 9, 16, 25, 36, 49, 64, 81 and 100. (There are 10 squares)

Rina Kajitani
Oct 28, 2014

To be really simple, I'm pretty sure all the square numbers from 1 to 100 will be open. Please correct me if I'm wrong!

Jaiveer Shekhawat
Aug 23, 2014

The squares are the key to this question... Only the square numbered door will be open.. i.e. 1,4,9,16,25,36,49,64,81,100. Thus, 10 doors will be open.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...