Hobbies Logic Riddles

Logic riddles. No looking up answers. If you solve, post a new riddle.

Three prisoners are each given a hat. The hats come in 3 colors (black, white, and red) and it is possible for multiple prisoners to have the same colored hat. Each prisoner can only see the hats of the other two prisoners, and has to guess the color of their own (they can't hear other guesses). If at least one of them guesses right, all of them are set free. If all three guess wrong, they are sentenced to death. Find a strategy for the prisoners to guarantee success.
 
Last edited:

cookie

my wish like everyone else is to be seen
is a Senior Staff Member Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnus
The riddle doesn't exclude communication between the prisoners, just that they can't hear each other's guesses. So couldn't one prisoner just tell the others what hat they're wearing?

Otherwise I don't think there's a solution to guarantee success. The prisoners gain no information about what they're wearing by looking at the others, if each hat is effectively random in colour.
 
Last edited:
The riddle doesn't exclude communication between the prisoners, just that they can't hear each other's guesses. So couldn't one prisoner just tell the others what hat they're wearing?

Otherwise I don't think there's a solution to guarantee success. The prisoners gain no information about what they're wearing by looking at the others, if each hat is effectively random in colour.
There is a solution involving binary.
 

cookie

my wish like everyone else is to be seen
is a Senior Staff Member Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnus
are you sure? this riddle sounds a lot like other prisoner with hat riddles except i can't find a version with 3 prisoners with 3 colours
 
Not that I know of
Edit: An easier variation to solve would be where the prisoners can hear each other's guesses (I also failed to mention in the riddle that the prisoners were allowed to discuss a strategy a day before the trial, but after the strategizing period, they wouldn't ever get to speak again) if you can solve the easier variation, post the answer along with a new riddle.
 
Last edited:

cookie

my wish like everyone else is to be seen
is a Senior Staff Member Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnus
Not that I know of
Edit: An easier variation to solve would be where the prisoners can hear each other's guesses (I also failed to mention in the riddle that the prisoners were allowed to discuss a strategy a day before the trial, but after the strategizing period, they wouldn't ever get to speak again) if you can solve the easier variation, post the answer along with a new riddle.
this variant is easy: they number themselves 1,2,3. Then if you're the first or second prisoner to guess, you say the colour of the hat of the next prisoner (so if you're 1, you say 2's hat, etc). The final prisoner has heard their hat colour so copies the relevant guess. So if they're number 2, they copy number 1's guess.

What's the solution to the variant where they can't hear each other?
 
Hint: Assign the numbers 0, 1, and 2 to the three colors and think of a prisoner seeing two numbers instead of two colors.
 
Last edited:

cookie

my wish like everyone else is to be seen
is a Senior Staff Member Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnus
Hint: Assign the numbers 0, 1, and 2 to the three colors and think of a prisoner seeing two numbers instead of two colors.
My guy this doesn't make any difference. If any prisoner can have any hat, and they can't communicate, they are all guessing at random. If you allow two or three prisoners to have the same colour hat, it means what you see gives you no information about what you're wearing.

Every variant of this riddle constrains the hats in a way that what you see gives you information (because there's a known pool of hats). This riddle has no solution.
 
Last edited:

cookie

my wish like everyone else is to be seen
is a Senior Staff Member Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnus
there are three crates of fruit:
  • one marked "apples"
  • one marked "oranges"
  • one marked "apples & oranges"
they are all labelled incorrectly. you can pick one crate and pull out one fruit from that crate. how do you switch the labels to the correct crates?
leave crates out in the sun for several weeks. Oranges rot far more slowly than apples. One crate should smell awful (apples only), one smells less awful (apples and oranges) and one smells mostly fine (oranges only). Rearrange labels accordingly.

this solution requires picking out no fruit.
 
Alright I've got a real one:

Two prisoners have to play a game with the warden for a chance to escape. They can strategize beforehand, then each one will go into an exam room at separate times.

Before the first prisoner enters, the warden shuffles a deck of standard playing cards and fans it out on a table face up. The first prisoner can choose to switch the position of exactly two cards, then is escorted out the back to a separate area, unable to speak to the second prisoner.

Before the second prisoner enters, the cards are flipped face down without changing the order. The warden then chooses a card that the second prisoner must find (like the Ace of Hearts). They have 26 chances to turn over cards from the deck, and if they find it they win and both prisoners escape. What strategy can they come up with that will guarantee their success?
 
Label the prisoners 0, 1, 2 and the hat colors 0, 1, 2. Each prisoner responds with the hat color that would make the total from their perspective equal to their own label mod 3.

The hat total will either be 0, 1, or 2 mod 3 so one of them will be right
 

cookie

my wish like everyone else is to be seen
is a Senior Staff Member Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnus
Yes it does. For example if all 3 have the same color hat, prisoner 0 would get it right. If two have color 0 and one has color 1, prisoner 1 would get it right
holy shit this is witchcraft, fair play

edit: I don't really understand why this works, but here's an explanation: https://math.stackexchange.com/questions/149915/rainbow-hats-puzzle

edit: i get it now.
if a prisoner uses modular arithmetic, and knows the sum of all the hats, they can always deduce their own hat (it's the one that is missing). But they don't. However, the sum is either 0, 1 or 2 (or 0...n-1 for n colours of hats). So you tell each prisoner to calculate it assuming it's one of those numbers. Thankfully, you have enough prisoners for each number! That way, at least one prisoner is guaranteed to get it because they used the correct sum (the number they were assigned).

What this means that in general the prisoners can always win if there are at least as many prisoners as colours. If there are more colours, the sum could be a number that can't be allocated to a prisoner and they'll never get it right. I think.
 
Last edited:

Fishy

tits McGee (๑˃̵ᴗ˂̵)
there are three crates of fruit:
  • one marked "apples"
  • one marked "oranges"
  • one marked "apples & oranges"
they are all labelled incorrectly. you can pick one crate and pull out one fruit from that crate. how do you switch the labels to the correct crates?
step 1: if all labels are incorrect, then whatever i select from whichever box cannot be trusted.
step 2: you gotta pick a fruit from the box marked apples & oranges. this automatically will only contain whatever is actually inside, which can be either apples OR oranges only, not both, because that's what the box is labeled and all the labels are incorrect. if you pick out an apple, this is actually the apple box. if you pick out an orange, this is actually the orange box. then you just swap the other 2 labels, because the labels are not correct, and there's only two options left, so their only other "correct" option becomes the other box.
 
Alright I've got a real one:

Two prisoners have to play a game with the warden for a chance to escape. They can strategize beforehand, then each one will go into an exam room at separate times.

Before the first prisoner enters, the warden shuffles a deck of standard playing cards and fans it out on a table face up. The first prisoner can choose to switch the position of exactly two cards, then is escorted out the back to a separate area, unable to speak to the second prisoner.

Before the second prisoner enters, the cards are flipped face down without changing the order. The warden then chooses a card that the second prisoner must find (like the Ace of Hearts). They have 26 chances to turn over cards from the deck, and if they find it they win and both prisoners escape. What strategy can they come up with that will guarantee their success?
I was going to see if anyone would do this, but I guess not.This is a varation of the 100 prisoner riddle with the two flips closing loops larger than 26. You agree to start at any card and create loops by going to the next card with number listed on previous card. I posted a riddle already so if anybody has a tough logic riddle feel free to post it.
 
I was going to see if anyone would do this, but I guess not.This is a varation of the 100 prisoner riddle with the two flips closing loops larger than 26. You agree to start at any card and create loops by going to the next card with number listed on previous card. I posted a riddle already so if anybody has a tough logic riddle feel free to post it.
Yeah I hadn't heard of the original but I'd have hoped that if someone straight up just knew the riddle beforehand they wouldn't spoil it for the others.

What I like about that one is that knowing Abstract Algebra helps but isn't necessary to get it.
 
Here's a really good one:

-> 100 people are a part of a game show.
-> Each person is assigned a number from 1 to 100, with no repeating numbers.
-> In a sealed off room there are 100 boxes, numbered 1 to 100.
-> Inside the boxes will be hidden 100 pieces of paper, numbered 1 to 100.
-> Any piece of paper can be in any box - ie, the paper number 12 can be in box 38, for example.

-> Person number 1 is then allowed to enter the room alone.
-> Person number 1 can look at up to 50 boxes and check what the piece of paper inside is.
-> Their goal is to find the piece of paper with their number on it - in this case, the paper with number 1.
-> If they find the paper in their 50 tries they keep it where it is and leave the room.
-> After person number 1 leaves the room the room is "reset", being exactly identical from when person number 1 entered (IE, the room never changes between each participant).
-> After person number 1 leaves the room, number 1 cannot talk or communicate with the rest of the group by any means.
-> After person number 1 finds their piece of paper and leave the room, person number 2 can enter the room to try and look for their piece of paper.
This repeats after all 100 people have gone in.

If all 100 people can find their piece of paper then they all gain 100$. If even one person doesn't find it, everyone loses and nobody gains anything. What is the best strategy for everyone to maximize their chances of winning 100$?

The answer is not a trick or loophole - ie, there is no secret way to communicate with the other players after you entered the room, and there is no loophole or trick in the rules that makes the problem trivial. The answer is a math problem.
 
Here's a really good one:

-> 100 people are a part of a game show.
-> Each person is assigned a number from 1 to 100, with no repeating numbers.
-> In a sealed off room there are 100 boxes, numbered 1 to 100.
-> Inside the boxes will be hidden 100 pieces of paper, numbered 1 to 100.
-> Any piece of paper can be in any box - ie, the paper number 12 can be in box 38, for example.

-> Person number 1 is then allowed to enter the room alone.
-> Person number 1 can look at up to 50 boxes and check what the piece of paper inside is.
-> Their goal is to find the piece of paper with their number on it - in this case, the paper with number 1.
-> If they find the paper in their 50 tries they keep it where it is and leave the room.
-> After person number 1 leaves the room the room is "reset", being exactly identical from when person number 1 entered (IE, the room never changes between each participant).
-> After person number 1 leaves the room, number 1 cannot talk or communicate with the rest of the group by any means.
-> After person number 1 finds their piece of paper and leave the room, person number 2 can enter the room to try and look for their piece of paper.
This repeats after all 100 people have gone in.

If all 100 people can find their piece of paper then they all gain 100$. If even one person doesn't find it, everyone loses and nobody gains anything. What is the best strategy for everyone to maximize their chances of winning 100$?

The answer is not a trick or loophole - ie, there is no secret way to communicate with the other players after you entered the room, and there is no loophole or trick in the rules that makes the problem trivial. The answer is a math problem.
I think this is much the same as the one I posted earlier in the thread, as Drakloak mentioned. The best way to win is to hope that there isn't a cycle greater than 50, and have everyone start with their own number box and keep opening the boxes that the papers point to until they get it.
 
I have one I can follow up with.

Alice and Bob are playing a game. Alice draws 5 random cards from a standard 52 card deck. Alice may then show Bob 4 of the cards in whatever order she likes. They win the game if Bob can precisely guess the 5th unrevealed card in one try. What strategy should they employ?
 

CaffeineBoost

6th Best Circus Poster of 2023
is a Community Contributor
I have one I can follow up with.

Alice and Bob are playing a game. Alice draws 5 random cards from a standard 52 card deck. Alice may then show Bob 4 of the cards in whatever order she likes. They win the game if Bob can precisely guess the 5th unrevealed card in one try. What strategy should they employ?
Is this a fellow Brian Brushwood enjoyer? Because that's where I first saw this one. (Also fun fact, this was originally modified to be an Open Pass style DM from Age of Info. God remember that? I hope not)
 
Is this a fellow Brian Brushwood enjoyer? Because that's where I first saw this one. (Also fun fact, this was originally modified to be an Open Pass style DM from Age of Info. God remember that? I hope not)
I heard it from a friend, so he might be the Bian Bushwood enjoyer lol, I will check him out. And I stopped following Age of Info after I was axed so I never got to see that.
 

CaffeineBoost

6th Best Circus Poster of 2023
is a Community Contributor
I heard it from a friend, so he might be the Bian Bushwood enjoyer lol, I will check him out. And I stopped following Age of Info after I was axed so I never got to see that.
It never showed up, that MM got axed far before it started.

Also very fair. At least you got to play the DM I'm most proud of.
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top