WoodCentral Forums

Est. 1998 — 27 years of woodworking knowledge

Friday Puzzler -- Prisoner Puzzle

Posts

Friday Puzzler -- Prisoner Puzzle

#1

Friday Puzzler -- Prisoner Puzzle

Alex Y

Three prisoners, A, B, and C, are presented with a challenge by their jailer. They are told that each has been given a different whole number from 1 through 9. Each prisoner knows his own number, but is not allowed to communicate his number in any way. Each is allowed to ask the jailer one yes on no question, which will be answered honestly. Then, if any of them can tell the total of their three numbers, they will all be released.

A asks "Is the total an even number"

Jailer: "No"

B asks "Is the total a prime number?"

Jailer: "No"

What can C, who was given 5 as his number, ask to assure their freedom?

Re: Friday Puzzler -- Prisoner Puzzle

#2

Re: Friday Puzzler -- Prisoner Puzzle

Sam Force

Does either of my fellow inmates have an even number?

If yes, answer is 19

If no, answer is 17

Re: Friday Puzzler -- Prisoner Puzzle

#3

Oops Re: Friday Puzzler -- Prisoner Puzzle

Sam Force

Oops, I misread the story

Gonna have to rethink

Re: Friday Puzzler -- Prisoner Puzzle

#4

My final answer

Sam Force

Did either of my friends get an even number?

If yes, then answer is 15

If no, then answer is 21

Re: Friday Puzzler -- Prisoner Puzzle

#5

Getting close!

Alexy

*Did either of my friends get an even number?

That won't quite get you released.

*If yes, then answer is 15

True

*If no, then answer is 21

Possibly, but not necessarily.

Re: Friday Puzzler -- Prisoner Puzzle

#6

Re: My final answer

Greg Zabek

You can get totals ranging from 8 to 22. Eliminating even totals and prime totals leaves you with:

1) 1 + 3 + 5 = 9

2) 1 + 5 + 9 = 15

3) 2 + 5 + 8 = 15

4) 3 + 5 + 7 = 15

5) 4 + 5 + 6 = 15

6) 5 + 7 + 9 = 21

I can't think of a question that gives you the answer to pick between 3 options just yet. Hmmmnnn.

Re: Friday Puzzler -- Prisoner Puzzle

#7

Closer still!


Re: Friday Puzzler -- Prisoner Puzzle

#8

Re: My final answer

Sam Force

How about,

Is my number smaller than my friend's numbers? That would only leave 1 answer I think

Re: Friday Puzzler -- Prisoner Puzzle

#9

Sorry

Alexy

Yes -> 21

No -> 9 or 15

Re: Friday Puzzler -- Prisoner Puzzle

#10

Re: Friday Puzzler -- Prisoner Puzzle

Henry Higginbotham

How about, "Is my number smaller than one, and only one, of the two other numbers?"

If Yes, the third prisoner knows the total is 15. If No, then if either of the first two prisoners has a 1 or 3, he will know the total is 9. If either has a 7 or 9, he will know the total is 21.

Re: Friday Puzzler -- Prisoner Puzzle

#11

Correct!

Alexy

Nice job, Sam, Greg, and Henry.

The tricky thing here is that while C is asking the final question, its answer may not allow C to know the total.

BTW, a simpler question, with the same results, is "is the total 15?"

Re: Friday Puzzler -- Prisoner Puzzle

#12

Well, duh!

Henry Higginbotham

Maybe I should have waited till the next morning, after some fresh coffee, and had a go at a little rethinking and editing. On the other hand, you should have seen the first draft.

I imagine there is a more lucid way to state the other part of the answer, too. I'll try to do better next time. :D

Re: Friday Puzzler -- Prisoner Puzzle

#13

Re: Question

Larry Barrett

Doesn't this depend on the fact that C has a 5? And neither A nor B knows that he has a 5. What if C has something else.

Suppose, for example, that A has a 2, B has a 4 and C has a 3. Total is 9, which satisfies the conditions (not even, not prime). I suppose you might say that C would not ask if the total was 15 in that case, but if he did and the answer was no, then it is not clear that either of the others would figure out the answer.

Another possibility is A=2, B=6, C=1; total is still 9. Another is A=2, B=4, C=9, but in this case if C asks it total is 15 he would be correct and game over.

Re: Friday Puzzler -- Prisoner Puzzle

#14

Re: Question

Greg Zabek

I think this is a good point.

Maybe the question should be "Is one and only one of the numbers less than 5?". This way C can ask the question without actually stating that his number is a 5.

Re: Friday Puzzler -- Prisoner Puzzle

#15

Re: Question

Greg Zabek

Thought about it a bit more. I think Larry is correct.

If the answer is yes then C can answer 15.

But if it is a no then C knows the answer is either 9 or 21. But A and B do not know C has a 5 and therefore do not know 9 or 21 or the possible answers.

Hmmmnnn.....

Re: Friday Puzzler -- Prisoner Puzzle

#16

Re: Question

Henry Higginbotham

I think I see the concern here, but I'm unconvinced. If C asks Alex's improved version of the question (Is the total 15?) and is told No, then A and B still know it's either 9 or 15.

Combinations totaling 9:

1 3 5

1 2 6

2 3 4

Combinations totaling 21:

4 8 9

5 7 9

6 7 8

If either A or B has a 1, 2, or 3, he can answer "9."

If either A or B has a 7, 8, or 9, he can answer "21."

All subject to rethinking post-coffee.

Re: Friday Puzzler -- Prisoner Puzzle

#17

Re: Question

Larry Barrett

if those are the only possibilities (I didn’t check) then I think you are correct.

And if so, then Alex gave us more info than he needed to. We did not need to know that C had a 5, only that he asked if the total was 15.

Re: Friday Puzzler -- Prisoner Puzzle

#18

Re: Question

Greg Zabek

But if he asks if the total is 15 and it is not 15 then aren't they done? Do they get another guess?

Re: Friday Puzzler -- Prisoner Puzzle

#19

Re: Question

Larry Barrett

The problem statement says that after each asks a question, ‘then, if any of them can tell the total of three numbers ...’. So I think that they get one more try (maybe more).

Re: Friday Puzzler -- Prisoner Puzzle

#20

Re: Question

Greg Zabek

Phew. We have it then!!!

Re: Friday Puzzler -- Prisoner Puzzle

#21

Wrap-up

Alexy

Sorry, I've been offline and missed all the follow-up questions.

After the jailor has laid out the problem, everyone knows the the total is in the range from 1+2+3=6 to 7+8+9=24.

After A and B have had their questions answered, everyone knows that the only possible totals are the composite numbers between 6 and 24 -- 9, 15, or 21.

C sees his 5 and realizes that if the total is not 15, there are only two possibility for the holdings of A and B, 1 and 3 (the only two numbers that can be added to 5 to equal 9); or 7 and 9 (the only only two numbers that add with 5 to 21).

C sees that A or B, holding either 1 or 3 will realize that there is no way the other two prisoners have numbers that will bring the total to 21, so will correctly guess the total. Similarly, if they hold a 7 or 9, they will realize that the total can't be 9.

Larry raised a good question about whether C needs to have a 5. I think the same logic works if C has a 4 or 6. Outside that range, it's still solvable, but a little different. If C has a 3 for example, he will know that the only possibilities are 9 and 15, and he can ask about either--the answer will tell him which is the total.

Re: Friday Puzzler -- Prisoner Puzzle

#22

And more to Larry's point

Alex Y

No matter what number C was given, the answer to the question about whether 15 is the total gets them freed.

If C has 1, 2, or 3, he knows that total can't be 21

If C has 4, 5, or 6, and 15 is not the total, both of the others have low numbers or both have high numbers, so can eliminate the other extreme.

If C has 7, 8, or 9, he knows that the total can't be 9

So I guess stating that C was given 5 just makes the problem easier! ;-)

👍 This page answered my questions

Your vote helps other woodworkers quickly find the answers and techniques that actually work in the shop.