Logic puzzle: ID the Liar and the Truth-Teller

Um, first off, I think this is the right forum for this. If not, please move it.

Okay, I’m sure everyone here is familiar with this one, right? One person always tells the truth, and the other always lies, and you have to figure out which is which. Now, for the purposes of this thread we’re assuming that they’re people and not talking door knockers (as in the film Labrynth) or anything like that.

Anyway, I’d like to discuss a solution I came up with to solve it with 2 or 3 questions. I figured SDMB’s going to have a lot of people who are experienced with this sort of puzzle. I was re-reading the archives of 8-Bit Theater over the weekend and a side reference to this puzzle inspired my solution.

Here goes:

[SPOILER]Pick one person, call them A & the other B. Ask the following questions.
A: At his last meal, what did B have for the main course?
B: At your last meal, what didn’t you have for the main course?

If the answers differ, then A is the liar and B the truth-teller (if A were the truth-teller, B would only be able to name the one thing he did have in order to lie, so they’d have to be the same answer).

If the answers are the same, then ask the following;
B: At your last meal, what (if anything) else didn’t you have for the main course?

If B answers nothing, he is the liar (He couldn’t have had every possible food, so he must have not eaten something else). If B names even one other food, then he is the truth-teller (the liar can’t dishonestly say he didn’t eat something if he actually didn’t eat it).
[/SPOILER]

Got that? Please feel free to tear my theory apart, or point out a blindingly obvious way to do this (I know this is an old riddle, and so there’s probably already been a very straight-forward solution).

Not answering your question, but related – given he same A and B, one of whom always lies and the other always tells the truth: how do you determine, with a single question, the correct answer to a binary (yes/no, right/left…) questions?

Ask A: “What would B say if I asked him whether it is safe to cross this bridge?” You are guaranteed to get the wrong answer – If A is telling the truth, he will tell you a lie, since that is truthfully what B would say; if A is the liar, then B would tell the truth, and A will lie about it. Which for a binary question is all you need!

I’ve got nothing to add except this wonderful comic related to the topic: xkcd: Labyrinth Puzzle

Eh, just make sure it’s clearly daytime or clearly nighttime, and ask one of them “is it daytime right now?” Proceed accordingly

Question 1, asked of A: “Is B a liar?”
Question 2, asked of A: “What would you answer if I asked you if B is a liar?”

If the answers are the same, A tells the truth.
If the answers are different, A is a liar.

If you want to assume they do not know if the other is a liar, substitute a question for which the answer is known…e.g. “Are you sitting on a chair…etc”

Or this one.

**Noone Special **'s and Chief Pedant’s answers would seem to be the most correct since they are based on information given in the explanation of the problem, w/o relying on any outside assumptions.

I’d ask either one of them…

Do two and two add up to four?

Which would seem to indicate that Noone Special and I are going down similar paths.
There are innumerable variants on this theme, of course.

Simply come up a question where the true answer is as obvious and inarguable as possible. Anyone who gives that answer is a truth teller.

Can’t you do it in just one question?

[spoiler]“If I ask the other guy whether he’s the liar, will he say ‘yes?’”

If the answer given is “No” then you’ve asked the truthteller. If the answer given is “yes” then you’ve asked the liar.

Further explanation: If you were to ask the liar “Are you the liar,” he would say “no.” If you ask the truthteller whether “the other guy” (i.e. the liar") would say “yes” when asked if he is the liar, then he will answer truthfully: “no.” Meanwhile, if you were to ask the truthteller “Are you the liar,” he would say “no.” If you ask the liar whether “the other guy” (i.e. the truthteller) would say “yes” when asked if he is the liar, then he will answer, untruthfully, “yes.”

[/spoiler]

Or did I miss the point of the OP?

-FrL-

Come to think of it, that’s what happened in Labyrinth, isn’t it? And the OP mentions that movie. So I must be misunderstanding the point of the OP.

Regarding the OP’s method,

[spoiler]I think you can do it just by asking one of them first “What didn’t you have for a main course,” and then again “What else didn’t you have for your main course?”

The liar can’t answer the second question except by saying “nothing.” The truthteller can give any number of different answers.

This makes the assumption that neither one ate every food in the world for their main course. Ideally, solutions to these puzzles don’t make use of contentful assumptions like this.
[/spoiler]

-FrL-

Noone Special’s solution assumes it is possible to tell whether it is day or night. Not a very strong assumption, but an assumption nonetheless.

-FrL-

If all you want to know is who is the liar, you can do it in one question: “What would you say if I asked if you were the liar?” Both characters would say “No”, but presumably the liar will mendaciously claim the opposite.

You can apply the same technique to any other one question to which you must know the truthful answer, tho’ in this case you won’t know if your responder is the liar or not.You ask, for instance “What would you say if I asked if it is raining today?”. If it is raining, the truth-teller would say “Yes”, and he will say so. The liar would say “No”, but being at pains to conceal this fact from you he will say “Yes”.

All predicated on the supposition that both respondents are flawlessly logical and entirely rules-driven.

Damnit, that’s the one I came in here to post!

The problem with most of these solutions is that they assume the ability to ask multiple questions. Given that ability, the problem is trivial as the numerous solutions here indicate.

The classical liar/truth teller problem is:

There’s two people: a liar and a truth teller.
They have a factual piece of information you want.
You’re only allowed to ask one question.

If you ask a question you know the answer to, you establish trustworthiness but won’t get the information. If you ask for the information, you won’t know whether or not the answer you get is true. So the puzzle is to figure out a single question that will reveal the unknown information along with the trustworthiness of the speaker.

I was referring to the first post, I didn’t see the second one.

I was referring to the second post, I didn’t see the first one. :smiley:

-FrL-

There is no such question, unless the thing you want to know is just who’s trustworthy. Assuming you ask a yes-no question, you’ll get (at most) one bit of information in your answer, but to determine both who’s who and the answer to your question, you’d need two bits.

Also, you want to make sure that your question is phrased as a yes-no. For instance, the question “If I were to ask you which path leads to the village, what would you tell me?” is no good. If you happen to ask that question of the liar, he’s free to answer “supercalifragilisticexpialidoceous”, or “banana”, or “mu”, since none of those things is what he would tell you (and hence, all of them are lies, in response to the question “what would you tell me?”). To avoid this problem, you could instead ask “If I were to ask you whether the left road leads to the village, what would you say?”.

I’ve seen it worded such that one bit is enough, something like “There’s a village of truth-tellers and a village of liars. At a fork in the road, one member of each village is standing by the road that leads to their village…”

Basically, by determining which village is which, you get which teller is which for free; the bits are not independent.

Usually, though, you’re right – the question is really to determine the factual question, and determining the truth-teller is a red herring to make you “use up” your one bit of information.

On my island, there are three tribes (which all look alike).

One tells only truths; one tells only lies; one varies randomly.

One representative from each tribe is standing in front of a junction of three paths, only one of which leads to the village.
You have one question to get to the village.

[spoiler on] Did you know they are serving free beer in the village? [spoiler off]

Just follow the crowd… :smiley:

Ah, see! I figured you’d all come up with better solutions, and you did! :stuck_out_tongue:

No, Frylock, no. You weren’t mistaken at all. I knew Labrynth had a version in it, but couldn’t remember how it went. I was just mentioning it to illustrate that I wanted to eliminate the possibility of the two individuals being some sort of mythical or fantastical entities for the purposes of this exercise. And yes, your way is also better.

Heh, I was just feeling clever (what with the little trap I’d formed with my lead-in questions) and wanted to show off what I had thought up, and figured it’d be fun to see what kinds of things SDMB’ers would come up with.

So far I like the “ask one question with a painfully obvious answer” approach the best. It seems highly “portable” (and by that I mean it could probably be adapted to be viable in any iteration of this puzzle).