# Tag Archives: puzzle

Problem: You have two options

1: One successful shot at the hoop
2: 2 of 3 successful shots at the hoop

Let P be the probability of making a successful hit, for what value of P will you choose option 2 over 1.

Solution:

If P is probability for option 1

Option 2, we can have 2 cases of success, one all 3 shots are successful – P*P*P

or 2 Hits and 1 Miss (HHM, HMH, MHH) 3 cases, each with probability of P*P*(1-P) i.e. 1-P for one miss. as there are 3 cases, total probability is 3*P*P*(1-p). Combining both result for option 2, P*P*P + 3*P*P*(1-P).

To prefer option 2,

P*P*P + 3*P*P*(1-P)>P
P*P+3P(1-P)>1

Can be solved to quadratic equation

-2P^2+3P-1>0
or
(2P-1)(P-1)>0

P>1 not possible so
P>1/2 or .5

Choose option 2 when probability of hitting hoop is more than 0.5

# Monty Hall problem

Monty Hall problem is an interesting problem that plays with probability.

Problem: There are three doors, say A, B and C. Behind one of the doors there is a prize and two are empty. You have to make a choice and try to win the prize. You choose a door say A, now host opens the door C, which is empty. The question is, should you switch the doors?

Solution: According to one solution proposed, Switching doors will increase probability of winning. This is the explanation behind that

Initially all 3 doors has probability of 1/3 of winning. So when we choose door A, we had probability of winning – 1/3. Now Doors B & C have collective probability of winning as 2/3. So when we know C is empty, probability of prize behind B is 2/3(?).

Frankly the argument does not look very strong, for me the new probability should be 1/2 for each door.

# Blue eyed boy- puzzle

This is conversation between two friends Ram and Shyam

Ram: Hey Bro, long time! How are you?
Shyam: I am good, How are you?
Ram: How are three boys, they must have grown up now. How old are they?
Shyam: Hmm, let me put it like this, if you multiply their ages, you will get the product as 36. And if you add their ages, you will get my house number.
Ram: Interesting, give me some more hint?
Shyam: Ok, my oldest son has blue eyes.
Ram: Awesome, so their ages are …

Puzzle: So what is the age of three boys?

———————————————————————

There are three hints

1. Product of the ages is 36.
2. Sum of the ages is same as house number. Interesting, we do not know house number, we will see how to use it.
3. Oldest is blue eyed boy. How is that useful?

Ok, lets start

1. Product of 3 ages is 36, so possible solutions are

1, 1, 36= 38(sum)
1, 2, 18= 21
1, 3, 12=16
1, 4, 9=14
1, 6, 6=13 *
2, 2, 9=13 *
2, 3, 6=11
3, 3, 4=10

2. Sum of the ages is house number
Looking at the above numbers, its clear that all the sums except 13 are unique, so if the house number was anything other than 13, Ram would have answered easily. But as he asked for one more hint, we now know that the house number is 13 and we are left with 2 possible solutions.
1, 6, 6=13 *
2, 2, 9=13 *

3. Oldest boy has blue eyes.
Out of the two options mentioned above, option 2 has a clear cut oldest age, i.e. 2, 2, 9. In case of 1, 6, 6, statement should have been one of the older boys or both old boys.

So ages are – 2, 2, 9

# 100 Door puzzle

Puzzle: There are various versions of the puzzle, there are 100 doors (or some other object), and 100 cops (prisoners). All the doors are closed initially. Cop 1 goes and opens up all the the doors, Cop 2 goes and closes door at even number 2,4,6 etc. Cop 3 goes and alters the state of doors divisible by 3 (3,6,9), so if the door was closed it is opened and if it was open, it is closed by cop 3. Cop 4 will alter state of all the doors divisible by 4 and so on. At the end we have to find out how many doors are closed now.

Solution: Before getting to a generic solution, lets take case of few doors 1 by one. We can easily see that a door’s state is same if it was visited even number of time (initially closed than (open + close) (open + close).. ), and it is changed if the door is visited odd number of times.
Case of Door 1: Only visited once by Cop1, so the state changes to open
Case of Door 2: Visited twice by cop1 and cop2, so finally it is closed, no change in state (see it is visited even number of times)
Case of Door 3: Visited by 1 and 3- Closed
Case of Door 4: Visited by 1, 2 and 4- Open
Case of Door 5: Visited by 1 and 5- Closed
Case of Door 6: by 1, 2, 3 and 6- Closed
Case 9: 1, 3 and 9- Open
Case 10: 1,2, 5 and 10- Open

So on careful examination, figure out doors which have even number of divisors are not changing state. When will a number have odd number of divisors? A divisor pair of a number z is x*y (always 2, and hence even)

for 50: 1*50, 2*25, 5*10- Even
for 100: 1 * 100, 2*50, 4*25, 5*20, 10*10- Odd (As 10 appears twice)

So for all the perfect squares, we can see we have odd number of divisors and hence the state of the door will be changed.