30 January 2015

Puzzle from India

I was enroute from India to USA when I got a call from one of my nephews with the following math problem he was stuck with. I am posting that as the puzzle of this week.

There is a jar with 50 pieces of paper written “1” thru “50” in them. You pick 5 of them at random and lay them out in increasing sequence. What is the probability that the middle number is 30?

1 January 2015

So, that is how I spent my first hours of the New Year!!

I was wondering how to start the year. Figured, let’s do something different.
So, I sat down with the last puzzle I had given and after two hours of putting pen to the paper, finally solved the probability problem. Whew!!! hopefully that would be some mental exercise for the little of whatever remains of the grey cells. Here is the answer…..

(BTW, anybody who cares to actually go thru the solution, please let me know if I have made any calculation errors. I am sure about the logic. And I have double checked the LCMs, GCMs and all that… just in case, I still made a silly mistake, point it out please)

The three people A,B,C get a random sequence, of which there can be 6. Let’s look at those 6 cases one by one.

CASE 1. Sequence: ABC.
Note that A, who goes first, would ether shoot B or C (random). If he shoots B, B is dead (since A is a sure shot). Prob of B surviving is 0. C then shoots at A. Chance of A being shot is 1/2 which means C survives. But if C misses (prob 1/2), A will for sure shoot him in his chance next. So, A, B and C prob are 1/2, 0, 1/2

If A shoots at C, C is dead, B then shoots at A. Prob of A surviving is 1/5 (since B is 80% accurate) but after that A will, for sure, kill B. So, the prob of A, B and C surviving are 1/5, 4/5, 0

Since the target for A is chosen in random, both the cases are equally likely. Therefore weighting the prob equally between the two events, the Case 1 prob for A, B and C surviving are 7/20, 2/5, 1/4. [7/20 equals half of 1/2 plus half of 1/5 etc etc etc)

CASE 2. Sequence: ACB.
You will note that this is same as Case 1. A either shoots B dead first and C shoots at A or A shoots C dead first and then B shoots at A. If A survives in either case, he finishes off C or B as the case might be. Exact situation as above. So the prob for A, B and C are 7/20, 2/5, 1/4.

Before I go to next cases, let us look at the pattern where A is dead (unlike the above case). So we have B and C and one of them will go first.

PATTERN X:
B and C are there alive and B shoots first. The prob of B surviving is when
(*) B shoots C dead with first shot – 4/5 OR
(*) B misses (1/5), but then C misses too (1/2) and then in the second chance, B succeeds (4/5) OR
(*) the same sequence as before except in the last step B misses (1/5) and then again C misses (1/2) and in the third chance B succeeds (4/5) and so on.
That prob would be 4/5 + 1/5×1/2×4/5 + 1/5×1/2×1/5×1/2×4/5 + …. which equals to (4/5) x (1+1/10 + 1/100+…) which equasl to (4/5) x 1.11111… which equals to 0.888888… which is 8/9. So B is 8/9 and C is 1/9.

PATTERN Y:
B and C are there alive but this time C shoots first. The prob of C surviving is when
(*) C succeeds with first shot (1/2) OR
(*) C misses (1/2) but then B also misses (1/5) and then C succeeds in second shot (1/2) OR
(*) same sequence as above except join the last step C misses (1/2) and then B misses again (1/5) and C succeeds in the now third shot (1/2).
That prob would work out to be 1/2 + 1/2×1/5×1/2 + 1/2*1/5*1/2*1/5*1/2+….. which is equal to (1/2) x (1 + 1/10 + 1/100 +…) which is equal to 1/2 x 1.1111… which is equal to 0.55555… which is 5/9. So B and C’s prob are 4/9 and 5/9

Let’s get back to our original cases.

CASE 3. Sequence: BAC.
B can shoot at A first. If he misses (1/5), then now it becomes ABC which is CASE 1. So A, B, C prob are 1/5 of CASE 1 which is 7/100, 2/25 and 1/20.
If however, he did kill A (4/5) now it is he and C left, which C going first – in other words, PATTERN Y. Multiplying PATTERN Y by 4/5, now we have A, B and C as 0, 16/45 and 4/9.
Adding these two cases, we get A, B and C as 7/100, 98/225 and 89/180

Or, B could have shot at C. If he did succeed (4/5), next A is going to shoot him dead. So the prob of surviving (after factoring is the 4/5 prob) are 4/5, 0, 0.
But if he failed in shooting C (1/5), now we have CASE 2!!! Therefore the prob are (1/5 of CASE 2) = 7/100, 2/25 and 1/20.
Adding the above two, we have 87/100, 2/25 and 1/20.

Since B would have picked A or C in random, the probability for CASE 3 is the average of the above two which would work out to be 47/100, 58/225, 49/180

CASE 4. Sequence BCA
I will come to this case later.

CASE 5. Sequence CAB
If C shoots at A then it could either be he succeeds (1/2) and then we have PATTERN X. Thus prob = 1/2 of (0, 8/9 and 1/9) = 0, 4/9 and 1/18
or C could have missed A (1/2) and then we have CASE 1!! Thus prob would be 7/40, 1/5 and 1/8.
Adding the above two, we have 7/40, 29/45 and 13/72

Or, if C shot at B first then it could have been that he either succeeded (1/2) in which case A would kill him next making the prob of A, B and C being 1/2, 0, 0
If C missed (1/2) then we again have CASE 1. Thus as calculated before, the prob are 7/40, 1/5 and 1/8.
Adding the above two, we have 27/40, 1/5 and 1/8.

Since C would have picked A or B in random, we weigh the above two cases equally and now have this Case prob as 17/40, 19/45 and 11/72.

CASE 6. Sequence CBA
If C shoots at B first and succeeds (1/2), A will shoot him dead for sure next. Thus we have the prob as 1/2, 0, and 0
If C however missed B (1/2), we have CASE 3!!!. That would be 1/2 of CASE 3 which is 47/200, 29/225 and 49/360
Combined, the prob are 147/200, 29/225 and 49/360

On the other hand, if C shot at A first,
If C succeeded (1/2), then we have PATTERN X which means the prob is 1/2 of PATTERN X making it 0, 4/9 and 1/18
If C however failed (1/2), we have now CASE 3!! Thus the prob would be 47/200, 29/225 and 49/360
Combined, the prob are 47/200, 129/225 and 69/360

Since C would have picked A or B at random, we average the above two to get the rolling prob: 97/200, 79/225 and 59/360

Now let’s go back to
CASE 4. Sequence BCA
If B shoots at A first and succeeds (4/5), we have PATTERN Y. Prob then is 0, 16/45 and 4/9
But if B failed in killing A (1/5), then we have CASE 5!! Prob then is 1/5 of CASE 5 which is 17/200, 19/225 and 11/360
Together that would be 17/200, 99/225 and 171/360

If B shoots at C first and succeeds (4/5), then next A will for sure kill him making the prob 4/5, 0, 0
But if B failed in shooting C dead (1/5), we have CASE 5 again! Prob, as above is 17/200, 19/225 and 11/360
Together that would be 177/200, 19/225 and 11/360

Since whether B shot at A first or C first was random, averaging the above two, we get the CASE 4 prob as 97/200, 59/225 and 91/360

So finally (phew) we have the following:

Sequence and prob of A or B or C surviving as:

ABC: 7/20, 2/5, 1/4
ACB: 7/20, 2/5, 1/4
BAC: 47/100, 58/225, 49/180
BCA: 97/200, 59/225, 91/360
CAB: 17/40, 19/45, 11/72
CBA: 97/200, 79/225, 59/360

Since that above are all equally likely, we finally take the average of those six cases to get to the final answer of A, B and C as: 513/1200 , 471/1350 and 483/2160 !!

Phew!!! Ok! Now I am ready for the New Year.

Category: Puzzles | LEAVE A COMMENT
29 December 2014

Probability Puzzle

This is an interesting probability problem. There are multiple variations of this. I am presenting a simple version.

There are three persons A, B and C who are aiming to settle a dispute the old dueling style except there are three of them. Here are the rules..

a. At random, it is decided what will be the sequence in which they will fire
b. When a person’s chance comes, that person is given at random the target (one of the other two) to shoot at
c. A is a sure shot (100% chance he will shoot the person dead), B is less so – has 80% chance of succeeding and C is a neophyte – 50-50 chance that he will succeed with a shot.
d. They keep on with this sequence of shooting till one man is left.
e. There are no other extraneous conditions – e.g. no stray bullets etc etc.
f. What are the probabilities of A, B and C surviving?

20 October 2014

Royters News – Microsoft

Microsoft CEO Satya Nadella reportedly said that there will be “new battles in stores” in an interview yesterday.

And my first reaction was “What? People are already fighting outside the stores for the new iPads?” 🙂

Nadella maintained a studious silence when asked in a follow up question regarding what kind of respectable distance was Microsoft planning to watch the battles from. 🙂

Now, that is “good karma” 🙂

8 October 2014

Puzzle time!!!

Found this interesting problem. See if you can solve this…
Four tanks going in a line on a very narrow bridge encounter four friendly tanks in a line coming from the other side. Unfortunately, they see each other only when there is exactly one tank worth of distance between the two leading tanks from either side. And there is no space on the bridge to go around each other.

Now here is a problem – None of the tanks can reverse. However, a tank can climb over another tank as long as there is space for the tank to land on the bridge after climbing over a tank. A tank cannot climb over more than one tank at a time. (meaning it has to come down to the bridge after climbing one tank). Also no tank can take the weight of more one one tank on top of it. (meaning you cannot have three tanks on top of each other).

How can the two sets of four tanks sort out the problem and eventually proceed their own way?

18 September 2014

Puzzle time!!!

It has been two weeks since I left home. India trip, a week of business meetings and I am finally on my flight back home… It has been a long time since I posted a puzzle on my flight back home on a Thursday evening… so here goes the next one…

[Remember the rules – do not post your answers as Comments in FB. Either message me on FB or write a comment in my blogsite www.rajibroy.com]

A hotel wing has 17 consecutive rooms numbered 1 thru 17. Each of the rooms are connected to the two adjoining room(s) thru keyed (internal) doors and to the corridor with one (external) keyed door. Of course the two end rooms have only one internal door. A fugitive is holed up in one of the rooms. He has one of the two master keys that can open up the (internal) doors to the adjoining room(s). However, for security purpose, the key, once operated, is inactive for 24 hours. And the key has to be used once every 24 hours – else it gets completely deactivated. In other words, the fugitive has to shift to the next room every day using the internal door – on any one side, unless he is in room 1 or 17, in which case he has only one choice.

There is a detective who suspects that the fugitive is holed up there. He has the other master key. This key also works in the same way except it works only on the external door of the rooms (that opens to the corridor). Thus, the detective can open the external door of any room. If he finds the fugitive there, he apprehends him. If not, he has to immediately shut the door and stay in the corridor (so that the fugitive cannot escape thru the corridor). The detective, can choose to open the same room on consecutive days, if he so desires.

So day after day, this is what happens – the detective opens a room, checks for the fugitive and closes the door if he does not find him. The fugitive, meanwhile, day after day shifts to the room on the left or the right – once a day (as mentioned, unless he is in one of the end rooms, in which case, he can go in only one way).

Now, the detective’s assignment runs out in 30 days. So, he has to apprehend the fugitive within that time period or else he is recalled and the fugitive escapes.

Can you come up with a strategy for the detective (what logic will he follow to open doors) that will guarantee that he will catch the fugitive before he is recalled?

19 June 2014

Brain Drain: Puzzle after a long time

One more time (this time with a very different job) I find myself on a Thursday evening flying from DC to Atlanta. Which means time for another puzzle.

This time it is one of those about measuring arbitrary time with those dratted hourglasses. If you are reading this on FB, you probably remember that you can ask clarifying questions in the comments section but send answers by messaging me.

You have two hourglasses – one empties in four minutes and the other empties in seven minutes. You have to bake a cake but it must be baked for exactly nine minutes. What is the minimum time it will take you after I say Go! for you to bake the cake? (You don’t have to start baking the cake immediately when you turn the hourglass(es) but once you start baking, it has to finish in exactly nine minutes).

To further clarify, if you said “I will flip the four minute hourglass first and then moment it is done, I will start baking and flip both hourglasses….. And say you figured out how to bake the cake in nine minutes now using those two hourglasses”, then total time taken is thirteen minutes. Get it?

Go!