Posts

Showing posts with the label door

A Warden Killing The Boredom

A warden oversees an empty prison with 100 cells, all closed. Bored one day, he walks through the prison and opens every cell. Then he walks through it again and closes the even-numbered cells. On the third trip he stops at every third cell and closes the door if it’s open or opens it if it’s closed. And so on: On the nth trip he stops at every nth cell, closing an open door or opening a closed one. At the end of the 100th trip, which doors are open?

A Warden Killing The Boredom



Open Doors in an Empty Prison!


Read the story behind the title!

Let's take few cells into consideration as representatives.

The warden visits cell no. 5 twice - 1st & 5th trip.1 & 5 are only divisors of 5.

He visits cell no. 10, on 1st, 2nd, 5th, 10th trips i.e. 4 times. Here, divisors of 10 are 1,2,5,10.

He stops cell no. 31 only twice i.e. on 1st and 31st trip.

He visits cell no.25 on 1st, 5th, 25th trips that is thrice.

In short, number of divisors that cell number has, decides the number of visits by warden.

For example, above, cell no.5 has 2 divisors hence warden visits it 2 times while 10 has 4 divisors which is why warden visits it 4 times.

But when cell number is perfect square like 16 (1,2,4,8,16) or 25 (1,5,25) he visits respective cells odd number of times. Otherwise for all other integers like 10 (1,2,5,10) or like 18 (1,2,3,6,9,18)  or like 27 (1,3,9,27) he visits even number of time.

For prime numbers, like 1,3,5,....31,...97 he visits only twice as each of them have only 2 divisors. Again, number of visits is even.

Obviously, the doors of cells to which he visits even number of times will remain closed while those cells to which he visits odd number of time will remain open.

So the cells having numbers that are perfect square would have doors open. That means cells 1, 4, 9, 16, 25, 36, 49, 64, 81, and 100 would be having their doors open.

Open Doors in an Empty Prison!

The Monty Hall Problem

You’re on a game show, and you’re given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what’s behind the doors, opens another door, say No. 3, which has a goat. He then says to you, “Do you want to pick door No. 2?”

Is it to your advantage to switch your choice?

The Monty Hall Problem

Will you switch or stay with your door?

Note : Monty Hall was the host of game show called 'Let's Make a Deal' on which above puzzle is based. (Source-Wikipedia)



This is what you should do! 

Winning The Monty Hall Game Show


What was the game show?

Suppose you always choose DOOR 1. Then host will open DOOR 2 or DOOR 3 behind which car is not there.

If the car is behind the DOOR 1, then host will open the DOOR 2 or DOOR 3. And if you switch to remaining DOOR 3 or DOOR 2, you will find goat behind it & you will loose.

And if the car is behind the DOOR 2, then host will be forced to open DOOR 3. Now, if you switch your choice to DOOR 2 then you will win the car behind that door.

Again, if the car is behind the DOOR 3, then host has to open the DOOR 2 behind which goat is there. And now if you switch your selection from DOOR 1 to DOOR 3, then you will be winning the car.

So out of 3 possibilities, in 2 you will be winning this game show if you switch your choice. The probability of winning the game show is 2/3.

And if you stay with your first choice, then probability of having car behind selected door is 1/3.

Winning The Monty Hall Game Show


To conclude, it's better to switch the choice as it increases the probability of winning the game show from 1/3 to 2/3. 
 
Follow me on Blogarama