The four prisoners [closed]

Four prisoners, 1, 2, 3 and 4, are all condemned to death. One of them is at random selected to be pardoned.

1 asks the guard who will be executed. The guard refuses to tell him so instead 1 says

'If 2 is to be pardoned tell me 3's name. If 3 is to be pardoned tell me 4's name. If 4 is to be pardoned tell me 2's name. If I am to be pardoned, roll a fair six-sided die, and if the number is one or two tell me 2's name, if the number is three or four tell me 3's name and if the number is five or six tell me 4's name.'

The guard comes back the next day and tells him 2's name.

What are the chances of each prisoner's survival now?

closed as off-topic by Gareth McCaughan♦, Rubio♦, JonMark Perry, Beastly Gerbil, GlorfindelMar 25 '17 at 17:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is off-topic as it appears to be a mathematics problem, as opposed to a mathematical puzzle. For more info, see "Are math-textbook-style problems on topic?" on meta." – Gareth McCaughan, Rubio, JonMark Perry, Beastly Gerbil, Glorfindel
If this question can be reworded to fit the rules in the help center, please edit the question.

• A small clarification- What does the guard actually say?Is it the guy who is getting pardoned or one who is going to be executed? – Sid Oct 2 '16 at 14:16
• I am afraid, this looks like a math problem, and not a math puzzle (see the nature of the answer below). – Matsmath Oct 2 '16 at 14:27
• @Matsmath, no offence intended, but you have only been a member for 40 days, so you don't have as much experience as others, generally these puzzles are puzzles. You can check, nearly all the prisoner ones haven't been closed – Beastly Gerbil Oct 2 '16 at 14:46
• I would think it is not the prisoner story-nonsense what makes a textbook application of Bayes's theorem a puzzle. But I agree with you that it is hard to define in black-and-white what is what. – Matsmath Oct 2 '16 at 14:58
• @BeastlyGerbil I've been a member for 2 years and I think Matsmath is probably right :-) (which means I shouldn't have answered it, I guess) – Rand al'Thor Oct 2 '16 at 18:57

Since 2's name was said, either 4 was pardoned, or 1 was pardoned and the roll was 1 or 2. We can enumerate all possible cases:

To account for the die roll's probabilities, we can pretend the die is rolled no matter what, but the result is only used if 1 was pardoned. Hence the possible, equally likely, cases are:

• 1 pardoned, rolled 1 or 2
• 4 pardoned, rolled 1 or 2
• 4 pardoned, rolled 3 or 4
• 4 pardoned, rolled 5 or 6

Thus, the probabilities are:

• 1 survives = 1/4
• 2 survives = 0
• 3 survives = 0
• 4 survives = 3/4

The answer can be computed using Bayes's theorem. Let $G2$ denote the event that the guard says "2" and $n$ denote the event that prisoner $n$ survives (for $n=1,2,3,4$).

• 1's chance of survival is

$p(1|G2)=\frac{P(G2|1)P(1)}{P(G2|1)P(1)+P(G2|2)P(2)+P(G2|3)P(3)+P(G2|4)P(4)}=\frac{\frac{1}{3}.\frac{1}{4}}{\frac{1}{3}.\frac{1}{4}+0+0+\frac{1}{4}}=\frac{1/12}{1/3}=\frac{1}{4}$

• 2's chance of survival is obviously $0$.

• 3's chance of survival is

$0$, because if 3 was to be pardoned the guard would have said 4's name and not 2's.

• Therefore 4's chance of survival is

$\frac{3}{4}$.