Sunday, April 13, 2008

The hardest logic puzzle ever....

....is this, apparently. The problem being phrased there as follows:

Three gods A, B, and C are called, in some order, True, False, and Random. True always speaks truly, False always speaks falsely, but whether Random speaks truly or falsely is a completely random matter. Your task is to determine the identities of A, B, and C by asking three yes-no questions; each question must be put to exactly one god. The gods understand English, but will answer all questions in their own language, in which the words for yes and no are 'da' and 'ja', in some order. You do not know which word means which.

You can find various solutions on the page, so I won't detail the ones I came up with, exactly (the second of which being, I think not dissimilar to those found on wikipedia), in case you haven't seen it before and want to try and solve it yourself. I'm curious, though, about the following. To begin with, as a 'warm-up', I just attempted to find three questions that would work if the three gods spoke English. Having done so, the following thought occured to me: Why not just ask precisely these questions with "If 'ja' meant 'yes' and .." as a pre-amble to each of them. This thought shat me .... Do you think this is cheating? Settle (or at least expand upon) a discussion for me.

19 comments:

David Barry said...

I don't know if it's just me, but I care about these true/false/random questions less than I care about combinatorics.

Andrew said...

So, I'm not pretending that there aren't many, many better things I could have been doing with my time on friday morning......

Anyways, I guess that's one vote for "I couldn't give a shit" from Dave.....

P.S. You now have an idea as to how I feel about your cricket statistics posts ;)

Nini said...

I'm concerned that you're giving the lier more opportunity to lie. Of course, I can't really figure it out right now.

I'm also amused that the question has lying gods. Go it!

Andrew said...

The trick with the liar, Anita, .... actually, possibly you don't want clues. If you don't, stop reading now.

Ahem. The trick with the liar is to realise he's an 'honest' liar ..... which is to say he can't tell the truth - he has to lie about lying - which gives him away.

I think of the lying gods as an exercise in efficiency. The truthful gods have a vast network of lying priests beneath them. The lying gods just cut out the middle men.

Andrew said...

Actually, I find it kind of curious that they have to be gods .... I mean, they could just have easily been talking ducks. I like to think they're talking ducks instead.

Ben said...

This graphic helped me solve the problem.

Ben said...

Not a plug.

David Barry said...

I think that you should ask each of them, "Will your answer to this question be a lie?"

Just to see what happens.

Andrew said...

Ah. I see, Dave, you have discovered what they call the exploding heads "lemma" in the paper Ben linked to ..... but what I like to call the smart-arse strategem.

Tinos said...

Dave, what's wrong with combinatorics? I must say I prefer combinatorics to statistics (and logic to combinatorics). That said, one of those ABS scholarships would be good. :D

Until the liar paradox is resolved I don't trust any solution to this problem.

David Barry said...

Statistics is great. It has loads and loads of real-world applications, and can genuinely improve people's lives, and the success of sports teams.

Combinatorics has its uses (Dijkstra's algorithm, for instance), but most of what I see of it is nearly-pointless questions about taking a graph and putting numbers on vertices and edges so that they all add up nice or something.

There was once an honours talk given on magic labellings of graphs. The then-Head-of-Department asked the question afterwards, "Magic squares were originally thought to have magical properties. Do you see any applications of your work to numerology?"

They also prove theorems about latin squares, which essentially means that they do modified Sudokus all day.

Also, the liar paradox isn't really relevant to the problem at hand. You can set up the problem so that the Gods exist until they encounter the paradox, and there will still remain ways of working out which God is which.

Andrew said...

Statistics ...... can genuinely improve people's lives, and the success of sports teams.

I guess you take the good with the bad, hey ;)

Also, Tinos, in mathematics we are not in the business of resolving paradoxes (leave that to philosophers)- we're in the business of avoiding them. And Dave wasn't taking a swipe at logic, either (even if he meant to be ;) )... the above problem has about the same relation to the field of mathematical logic as the Monty Hall problem does to probability theory.

Geoff said...

Fitz, "If 'ja' meant 'yes' and .." is not a logical statement. An 'if' requires a 'then'. I think what you are trying to say is "assume that 'ja' meant 'yes' and .." which is clearly cheating.

To Dave: those with blogs on cricket statistics should not throw stones.

Andrew said...

So, Geoff, my second solution phrased questions in a form" "If I asked you X would you say 'ja'?" ... which is the kind of thing you want to do (you spend 1 qn making sure the next qn goes to a non-random god, 1 pinpointing the random god, then 1 distinguishing between the remaining 2).

To begin with though, I'd modelled it a little too closely on the Two guards, a liar and a truth-teller standing beside a door to heaven and a door to hell (so you point to the other guy and say 'If I asked him to point to the door to heaven where would he point?') and my questions took the form "If I asked your opposite (so the liar if you're the truth-dude and vice versa) X, what would he say?". It's still strictly 'yes/no', right? If this is allowed, why not 'If 'ja' meant yes and I asked him X (then) what would he say?'. It certainly violates the spirit of the problem, I'll grant you.... but it seems to me it should be allowed.

Geoff said...

That is a logical statement. It seems perfectly fine to me. The answer to these kinds of questions always seems like a trick.

Sam said...

Dave, I don't think your question is very profound. The truth teller, and the lier will both say no. The exploding godhead question is "Will you lie?"

Andrew said...

Yeah, I'm not all that fond of the exploding god-head stipulation, myself, either. If I know my deities (and I think it's fair to say I do...) the response you'd generally get to something like 'hey god, can you make a rock so heavy even you can't lift it?' is a fatal lighting bolt to the head followed by the statement 'nobody likes a smart-arse' being made to your well-cooked corpse.

Sam said...

I agree with that sentiment Fitz, but Dave's question isn't one of those. His question has just one mundane answer, No.

David Barry said...

Me: Will your answer to this question be a lie?

Liar: No.

That's equivalent to saying, "This answer is not a lie."

But the liar always lies, so in his head, he's thinking, "This answer is a lie."

Explosion.

But even if my analysis there is wrong, I completely fail to see how my question is fundamentally different from yours. "Will you lie?" is certainly simpler, but it has the same effect.