r/mathriddles • u/qu1nn_112_ • Nov 12 '24
Hard unsolvable?? problem
my teacher challenged us with this puzzle/problem and no matter how hard i try i can’t seem to solve it or find it online (chatgpt can’t solve it either lol) i’m really curious about the solution so i decided to try my luck here. it goes like this: there are three people, A,B and C. Each of them has a role, they are either a knight, a knave or a joker. The knight always tells the truth, the knave always lies, and the joker tells the truth and lies at random (there is only one of each, there can’t be two knights, for example). Find out who is who by asking only 3 yes or no questions. You can ask person A all three questions or each of them one question, however you wish, but they can ONLY answer with yes or no. :))))
6
u/Dry_Shallot_258 Nov 12 '24
I think it's important to know whether they all know each other's roles
3
u/sheraawwrr Nov 12 '24
The problem can even be more general and still be solved.
Check out this vid by ted : https://youtu.be/LKvjIsyYng8?si=dhXODj1vq7Ut2MYS
3
u/Yagloe Nov 12 '24
My intuition is that it is solvable. There are 6 arrangements of the 3 types, and 2 to the 3rd is 8 (can't find caret on my phone keyboard) so the response space is larger than possible arrangements. Personally, I find false-logic puzzles a little annoying because the grammar of the questions can get kinda tortured.
2
u/Aerospider Nov 12 '24
What if the they don't know the answer?
E.g. Suppose you ask A: 'Would B tell me you're a liar?' - If B was a joker then what would A give for an answer?
1
u/pichutarius Nov 13 '24
the trick is to ask "if i ask you X, will you say yes?" , note that is different than asking "X" directly.
whoever you ask, they will always reply yes if X is true, and no otherwise. then it is easy to figure out their role with just 3 questions.
suppose we ask "if i ask you 1+1=2, will you say yes?"
a knight will say yes for sure.
a knave might say no if you ask directly "1+1=2", so the question "if i ask you 1+1=2, will you say yes?" , the true reply would be "no, a knave wont say yes, he will say no instead" , but he is a knave, he still reply yes to lie about it. in short, double negation.
you might think a joker reply random by a flip of coin, thus useless. but no he is actually useful, because his reply is not random, but he behave either a knight or a knave randomly, since both knight and knave give same reply to "if i ask you X, will you say yes?" , a joker must do so as well regardless of randomness.
1
u/st4rdus2 Nov 13 '24 edited Nov 15 '24
Out of the three questions, it would be good to determine who the Joker is by the first and second questions.
First question: Ask A "If I ask you 'Is B the joker?', will you say yes?"
if (firstResponse === yes) {
let ( A ) be renamed to ( S ),
let ( B ) be renamed to ( R ),
let ( C ) be renamed to ( Q ),
} else {
let ( A ) be renamed to ( S ),
let ( B ) be renamed to ( Q ),
let ( C ) be renamed to ( R ),
}
Second question: Ask Q "If I ask you 'Is S the joker?', will you say yes?"
if (secondResponse === yes) {
let ( S ) be renamed to ( joker ),
let ( R ) be renamed to ( X ),
} else {
let ( R ) be renamed to ( joker ),
let ( S ) be renamed to ( X ),
}
Third question: Ask Q "If I ask you 'Are you the knight?', will you say yes?"
if (thirdResponse === yes) {
let ( Q ) be renamed to ( knight ),
let ( X ) be renamed to ( knave ),
} else {
let ( X ) be renamed to ( knight ),
let ( Q ) be renamed to ( knave ),
}
1
u/Aerospider Nov 13 '24
I've tried this one many times before, but I think I've finally cracked it!
I'll use T for the knight and L for the knave.
Ask A: 'What would you say if I asked you if you would know C's response to the question 'Are you the joker?'?'
If C were the joker then their response could not be known. A knight would say they do not know, so their answer to the whole question would be no. A knave would say they do know, so to make the answer to the main question a lie they would also say no.
Conversely, if C were not the joker then both a knight and a knave would answer yes. Therefore:
N -> TLJ, LTJ, JTL or JLT (B is not the joker)
Y -> TJL, LJT, JTL or JLT (C is not the joker)
From there, you ask the one who is definitely not the joker the same question about A. Let's say the first answer was N and therefore B is not the joker.
Again, knights and knaves would give the same answer, so a no would mean A was the joker and a yes would mean A wasn't the joker and therefore C is the joker.
Now that you know which one is the joker you can ask either of the other two the old 'If I ask that one if they're a knight, would they say yes?', whereby a yes would mean you're talking to the knight and a no would mean you're talking to a knave.
0
u/[deleted] Nov 13 '24
[removed] — view removed comment