# Post the hardest riddles you know. or can devise.

**URL:** <https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593>\
**Category:** In My Humble Opinion\
**Created:** [July 9, 2018, 5:53pm UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593 "2018-07-09T17:53:01Z")\
**Posts on this page:** 18\
**Page:** 3

<div class="post-metadata">

**Author:** ![UltraVires](https://avatars.discourse-cdn.com/v4/letter/u/ecccb3/32.png) [@UltraVires](https://boards.straightdope.com/u/UltraVires)\
**Post date:** [July 11, 2018, 12:49am UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/41 "2018-07-11T00:49:17Z")

</div>

> [@Dr.Strangelove](#):
>
> [spoiler]I don’t think that’s the right way of looking at it. Well, at least the analogy doesn’t make sense to me.
> 
> The first thing is that you want to concentrate badness. It’s true that for any individual’s guess they’ll be right only half the time. But what if you could make it so that all four prisoners were wrong at the same time, but when they were right it was at different times? And barring that, at least have more than one prisoner be bad simultaneously.
> 
> When they guess the opposite of RRRR, if RRRR comes up, then they’ll all guess and all be wrong. But if BRRR comes up, then only one individual makes a guess and she’ll be right. If RBRR comes up, then a different prisoner will be right. Etc. We get a 4x improvement because the good guesses are spread out.
> 
> Beyond that, there are similarities to error coding. Looking up Hamming distance would be a start. Basically, you want to find several “loci” and the set of combinations exactly one color-flip away. They can’t overlap or there will be ambiguity.
> 
> The “clean” setup would have three 4-color combos and the 12 additional combos that are a step away. This still only gets you 12 wins but doesn’t require different rules for different prisoners.
> 
> However, three combos like this don’t exist. What we can do instead is have two 4-color combos, with their 8 attendant color-flipped versions, and then two additional combos but only with two flipped versions for each. One possible set (in binary, since that’s easiest for me) is:  
> 0000 -\> 0001, 0010, 0100, 1000  
> 1011 -\> 1010, 1001, 1111, 0011  
> 0111 -\> 0110, 0101  
> 1100 -\> 1101, 1110
> 
> There are lots of possible combinations; that was just the first I found.[/spoiler]

I don’t believe in any event that more than one prisoner should make a guess. The problem requires at least one, and if one is wrong, everyone dies, so it would seem that any correct solution would have three prisoners writing “pass” and the remaining one guessing.

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [July 11, 2018, 1:06am UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/42 "2018-07-11T01:06:13Z")

</div>

> [@UltraVires](#):
>
> I don’t believe in any event that more than one prisoner should make a guess. The problem requires at least one, and if one is wrong, everyone dies, so it would seem that any correct solution would have three prisoners writing “pass” and the remaining one guessing.

[spoiler]Again, the idea is to concentrate badness. They can’t die twice, so their wrong guesses should overlap.

Imagine a deterministic version where they have to apply the same ruleset to all 16 combinations, and they get a million dollars for however many they win. They are handed 16 cards which can say any of WIN, LOSE, or PASS, but with the restriction that the number of WIN cards has to match the LOSE cards. They distribute the cards among the combinations and tally things up at the end.

The ideal, then, is for each of the prisoners to put their LOSE cards on the same combinations, but spread out the WINs (with the rest filled out with PASS). Ideally, each losing combo would get all four LOSE cards but this isn’t quite possible.

Incidentally, I just realized that there is a simpler solution. Tell player 4 to just always pass. For the remainder, play opposite to the others if they both play the same (otherwise pass). Still wins 3/4 of the time.[/spoiler]

---

<div class="post-metadata">

**Author:** ![K2500](https://avatars.discourse-cdn.com/v4/letter/k/f6c823/32.png) [@K2500](https://boards.straightdope.com/u/K2500)\
**Post date:** [July 11, 2018, 1:16am UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/43 "2018-07-11T01:16:44Z")

</div>

> [@septimus](#):
>
> Here’s a classic that stumps most.
> 
> A prison warden is ready to retire and to spend his final years on Tahiti. There are only four inmates left anyway, so he decides to just shut the prison down. But he can’t decide whether to let all the prisoners go free, or send them all to the firing squad. Instead of flipping a coin he devises one final sadistic game. Addressing all the prisoners together he says,  
> "Tomorrow I’ll put a blob of paint on each of your foreheads, randomly choosing red or blue paint. Each of you will see the paint on the other three foreheads, but not your own. Feel free to discuss strategy now, but once the game starts tomorrow, if there’s any communication whatsoever among you, you all die.  
> Tomorrow you will each have paper and pencil and will have a chance to guess your paint color. On the paper, secretly write ‘Red’, ‘Blue’, or ‘Pass.’  
> [ul][li] If all four of you Pass, all four will die.[/li][li] If anyone with Blue paint writes ‘Red’, all four will die.[/li][li] If anyone with Red paint writes ‘Blue’, all four will die.[/li][li] If at least one of you guesses correctly, and none of you guesses wrong, then all four of you will live.[/ul][/li]The prisoners appoint you to devise their best strategy.

No rule against touching your paper to your still wet for head paint and writing the color next to it?

---

<div class="post-metadata">

**Author:** ![CharmaChameleon](https://avatars.discourse-cdn.com/v4/letter/c/9d8465/32.png) [@CharmaChameleon](https://boards.straightdope.com/u/CharmaChameleon)\
**Post date:** [July 11, 2018, 3:56am UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/44 "2018-07-11T03:56:36Z")

</div>

M r puppies  
o no a r not  
o s a r  
m r not puppies  
s a r  
m r **not** puppies  
o s a r – c m p n?  
L i b, m r puppies!

---

<div class="post-metadata">

**Author:** ![UltraVires](https://avatars.discourse-cdn.com/v4/letter/u/ecccb3/32.png) [@UltraVires](https://boards.straightdope.com/u/UltraVires)\
**Post date:** [July 11, 2018, 4:25am UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/45 "2018-07-11T04:25:10Z")

</div>

> [@Dr.Strangelove](#):
>
> [spoiler]Again, the idea is to concentrate badness. They can’t die twice, so their wrong guesses should overlap.
> 
> Imagine a deterministic version where they have to apply the same ruleset to all 16 combinations, and they get a million dollars for however many they win. They are handed 16 cards which can say any of WIN, LOSE, or PASS, but with the restriction that the number of WIN cards has to match the LOSE cards. They distribute the cards among the combinations and tally things up at the end.
> 
> The ideal, then, is for each of the prisoners to put their LOSE cards on the same combinations, but spread out the WINs (with the rest filled out with PASS). Ideally, each losing combo would get all four LOSE cards but this isn’t quite possible.
> 
> Incidentally, I just realized that there is a simpler solution. Tell player 4 to just always pass. For the remainder, play opposite to the others if they both play the same (otherwise pass). Still wins 3/4 of the time.[/spoiler]

[spoiler] Maybe I am just being daft, but I am not seeing it. A pass never gets anyone killed unless all four prisoners pass. Likewise, two passes, one win, and one loss kills them all.

A correct choice does nothing unless the other choices are also correct or passes. The best strategy has to be to take three passes and try to maximize the chances on the one choice. And that one choice, no matter if the prisoner sees three reds, three blues, or any combination is a random 50/50 chance for his own color.[/spoiler]

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [July 11, 2018, 6:09am UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/46 "2018-07-11T06:09:02Z")

</div>

> [@UltraVires](#):
>
> [spoiler] Maybe I am just being daft, but I am not seeing it. A pass never gets anyone killed unless all four prisoners pass. Likewise, two passes, one win, and one loss kills them all.
> 
> A correct choice does nothing unless the other choices are also correct or passes. The best strategy has to be to take three passes and try to maximize the chances on the one choice. And that one choice, no matter if the prisoner sees three reds, three blues, or any combination is a random 50/50 chance for his own color.[/spoiler]

[spoiler]Let’s simplify the puzzle to a totally equivalent one (the presented puzzle has a bit of a red herring in it). Same rules, but with 3 prisoners.

The solution is for each prisoner to vote opposite if the two others have the same color; otherwise pass. Let’s enumerate all eight possibilities, what the rule tells them to vote (in 123 order), and if they live/die:  
RRR: BLUE BLUE BLUE (DIE)  
RRB: PASS PASS BLUE (LIVE)  
RBR: PASS BLUE PASS (LIVE)  
RBB: RED PASS PASS (LIVE)  
BRR: BLUE PASS PASS (LIVE)  
BRB: PASS RED PASS (LIVE)  
BBR: PASS PASS RED (LIVE)  
BBB: RED RED RED (DIE)

75% chance to live. Note that each prisoner voted RED twice, BLUE twice, and PASS four times. Furthermore, note that of the times they voted, they were wrong half the time–exactly as we’d expect from probability. Specifically, they encountered all four combinations of R-wrong, R-right, B-wrong, and B-right.

But the wrongs were concentrated into just two of the combinations (RRR and BBB), while the rights were spread out among the remaining six. It only takes one error to die, so if you are going to make errors you want everybody to make them at once.[/spoiler]

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [July 11, 2018, 8:56am UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/47 "2018-07-11T08:56:04Z")

</div>

> [@Quercus](#):
>
> … I can’t see anything better than having prisoner #1 randomly write red or blue and the others passing. That gives a 50/50 shot at living or dying. …

> [@BobLibDem](#):
>
> Seems to me that the best you can do is a 50/50 chance…

You’re both in good company. Many top puzzle solvers reached this same conclusion, … including **septimus**. :eek: :o

> [@Dr.Strangelove](#):
>
> … Let’s simplify the puzzle to a totally equivalent one (the presented puzzle has a bit of a red herring in it).

Yes, I’m a sadist. 😛

> [@Dr.Strangelove](#):
>
> BTW:If you have exactly 2[sup]n[/sup]-1 prisoners, you can always come up with an algorithm that saves you (1 - 1/2[sup]n[/sup]) of the time. So for 7 prisoners, you can live 87.5% of the time (and can’t do any better).

I didn’t know that! Can you confirm you’ve double-checked this before I tax what little remains of my brain to understand it?

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [July 11, 2018, 9:32am UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/48 "2018-07-11T09:32:12Z")

</div>

> [@septimus](#):
>
> I didn’t know that! Can you confirm you’ve double-checked this before I tax what little remains of my brain to understand it?

As it turns out, we’ve [both repeated the puzzle](https://boards.straightdope.com/sdmb/showthread.php?t=756363). It felt familiar but only when I found the red herring did it all come back!

[spoiler]The solution is in [Hamming codes](https://en.wikipedia.org/wiki/Hamming_code). For any 2[sup]n[/sup]-1 bit length, there is a Hamming code–which is perfect (no unused combinations), and so provably the best you can do.

A Hamming code gives you numbers that are a minimum Hamming distance (think: number of flips to get from one code to another) of three. This guarantees a solution for that prisoner count.

Consider N=7. There are 128 possible combinations. Among these, we can pick 16 codes, each of which has 7 flipped codes clustered around it. The flipped codes are winners; the original 16 losers. Hence we can win 112/128=87.5% of the time.

For cases where N != 2[sup]n[/sup]-1, one can always ignore some prisoners and pretend that it’s a smaller code. So that’s a lower bound (and also the best you can do for N=4). What I don’t know is if there are intermediate bounds for higher N. Can one do \>75% but \<87.5% for N=6?[/spoiler]

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [July 11, 2018, 10:24am UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/49 "2018-07-11T10:24:06Z")

</div>

> [@Dr.Strangelove](#):
>
> As it turns out, we’ve [both repeated the puzzle](https://boards.straightdope.com/sdmb/showthread.php?t=756363). It felt familiar but only when I found the red herring did it all come back!

Clicking the link I see I called you _ **Brilliant** _ for that solution!

… Well, you’re still brilliant, **Dr. Strangelove**!

---

<div class="post-metadata">

**Author:** ![Enright3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/enright3/32/2897_2.png) [@Enright3](https://boards.straightdope.com/u/Enright3)\
**Post date:** [July 12, 2018, 1:35pm UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/50 "2018-07-12T13:35:42Z")

</div>

> [@BobLibDem](#):
>
> Seems to me that the best you can do is a 50/50 chance. Tell 3 to pass and the other takes a guess.

Yep, that’s what I came up with. A quick Google search yielded this similar puzzle:  
[http://www.smartestbrain.com/hard-riddles-difficult-puzzles/prisoners/#](http://www.smartestbrain.com/hard-riddles-difficult-puzzles/prisoners/#)

---

<div class="post-metadata">

**Author:** ![kayaker](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/kayaker/32/441_2.png) [@kayaker](https://boards.straightdope.com/u/kayaker)\
**Post date:** [July 12, 2018, 4:43pm UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/51 "2018-07-12T16:43:10Z")

</div>

> [@crafter\_man](#):
>
> 20 1 18 4 13 6 10 15 …?

2 17 3 19 7 16 8 11 14 9 12 5

---

<div class="post-metadata">

**Author:** ![sjankis630](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@sjankis630](https://boards.straightdope.com/u/sjankis630)\
**Post date:** [July 13, 2018, 1:26am UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/52 "2018-07-13T01:26:52Z")

</div>

Damn i have one but don’t know how to post a spoiler.

Can anyone help?

---

<div class="post-metadata">

**Author:** ![Peter\_Morris](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/peter_morris/32/359_2.png) [@Peter\_Morris](https://boards.straightdope.com/u/Peter_Morris)\
**Post date:** [July 13, 2018, 2:07am UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/53 "2018-07-13T02:07:46Z")

</div>

[s p o i l e r] SOME HIDDEN TEXT HERE [/ s p o i l e r]  
Use the above, but remove the spaces.

---

<div class="post-metadata">

**Author:** ![sjankis630](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@sjankis630](https://boards.straightdope.com/u/sjankis630)\
**Post date:** [July 13, 2018, 12:42pm UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/54 "2018-07-13T12:42:06Z")

</div>

I tried that earlier but neither of my browsers (chrome.firefox) allow me to enter any symbols in my reply. It only allows text. I have never had that happen before.

---

<div class="post-metadata">

**Author:** ![Left\_Hand\_of\_Dorkness](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/left_hand_of_dorkness/32/7156_2.png) [@Left\_Hand\_of\_Dorkness](https://boards.straightdope.com/u/Left_Hand_of_Dorkness)\
**Post date:** [July 13, 2018, 1:01pm UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/55 "2018-07-13T13:01:50Z")

</div>

> [@sjankis630](#):
>
> I tried that earlier but neither of my browsers (chrome.firefox) allow me to enter any symbols in my reply. It only allows text. I have never had that happen before.

You can’t do brackets? That’s bizarre.

---

<div class="post-metadata">

**Author:** ![sjankis630](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@sjankis630](https://boards.straightdope.com/u/sjankis630)\
**Post date:** [July 13, 2018, 9:19pm UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/56 "2018-07-13T21:19:35Z")

</div>

Finally.

What can go up a chimney down,  
But can’t go down a chimney up?

an umbrella

---

<div class="post-metadata">

**Author:** ![Inigo\_Montoya](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/inigo_montoya/32/124_2.png) [@Inigo\_Montoya](https://boards.straightdope.com/u/Inigo_Montoya)\
**Post date:** [July 13, 2018, 9:35pm UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/57 "2018-07-13T21:35:45Z")

</div>

What goes on 8 for one year  
4 for 19 years  
2 for the rest of its life?

Fred & George

---

<div class="post-metadata">

**Author:** ![Khendrask](https://avatars.discourse-cdn.com/v4/letter/k/3e96dc/32.png) [@Khendrask](https://boards.straightdope.com/u/Khendrask)\
**Post date:** [July 16, 2018, 10:36am UTC](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593/58 "2018-07-16T10:36:47Z")

</div>

Excellent explanation for the mirror from [Physics Girl](https://www.youtube.com/watch?v=vBpxhfBlVLU).

[Previous page](https://boards.straightdope.com/t/post-the-hardest-riddles-you-know-or-can-devise/817593.md?page=2)
