rec.puzzles Archive

Three men stand at a fork in the road.

logic/smullyan/fork.three.men Added material

Problem

Three men stand at a fork in the road.  One fork leads to Someplaceorother;
the other fork leads to Nowheresville.  One of these people always answers
the truth to any yes/no question which is asked of him.  The other always
lies when asked any yes/no question.  The third person randomly lies and
tells the truth.  Each man is known to the others, but not to you.
What is the least number of yes/no questions you can ask of these men and
pick the road to Someplaceorother?  Does the answer change if the third
man randomly answers?  What if you just want to identify them?
Show solution
One question, and you only need one man of any type:  "If I were to ask
you whether the left fork leads to Someplaceorother, and you chose to
answer that question with the same degree of truth as you answer this
question, would you then answer 'yes'?"

The truthteller will say "yes" if the left fork leads to Someplaceorother,
and "no" otherwise.  The liar will answer the same, since he will lie about
where the left fork leads, and he will lie about lying.  The randomizer
may either lie or tell the truth about this one question, but either way
he is behaving like either the truthteller or the liar and thus must
correctly report the road to Someplaceorother.

If however the third person randomly answers yes or no it is clear that
you must ask at least two questions, since you might be asking the
first one of the randomizer and there is nothing you can tell from his
answers.

Start by asking A "Is B more likely to tell the truth than C?"

If he answers "yes," then:
   If A is truthteller, B is randomizer, C is liar.
   If A is liar, B is randomizer, C is truthteller.
   If A is randomizer, C is truthteller or liar.

If he answers "no," then:
   If A is truthteller, B is liar, C is randomizer.
   If A is liar, B is truthteller, C is randomizer.
   If A is randomizer, B is truthteller or liar.

In either case, we now know somebody (C or B, respectively) who is
either a truthteller or liar.  Now, use the technique for finding
information from a truthteller/liar, viz., you ask him the following
question:  "If I were to ask you if the left fork leads to
Someplaceorother, would you say 'yes'?"

If the answer is "yes," take the left fork, if "no" take the right fork.

If you just want to identify the three men, there are several ways to
proceed.  Perhaps the simplest is to ask the man identified as either a
truthteller or a liar some question like "Is one plus one equal to
two?"  If he answers "yes," then he is the truthteller, else he is the
liar.  If he is the truthteller, ask him if another man is the liar.
By process of elimination you know the identity of the third man.  If
he is the liar, ask him the same question, but disbelieve the answer.
Then again by process of elimination you know the identity of the third
man.

Additional material

[ Editor: a variant with two brothers who lie a fixed fraction of the
time, posted in 1996 by Lovett Shahar <shalov@zoot.tau.ac.il>: ]

> there was a man who came to a fork in the road, only one way is
> correct.  in the crossroads stood 2 brothers, one always tells the
> truth 1/3 of the times and lies 2/3 of the time, and one who lies 1/3
> of the time and tells the truth 2/3 of the time.
> u can ask 3 questions, find which is the correct path?

I will assume that "lies 2/3 of the time" means that if I ask three
questions, it is guaranteed that exactly two of the answers will be lies -
similarly for the other statements.  Obviously this is different from just
having a 2/3 probability of lying - if the latter were the case, we could
never determine the correct answer with certainty.  I'm also assuming
that given a yes/no question, they *must* answer either 'yes' or 'no'.

Pick one of the brothers and ask:  "If I asked you three times in a row if
I should take the left fork, would you say 'yes' more often than 'no'?"
Repeat question twice more (to the same brother).  If you get two 'yes'
and one 'no', take the left fork - if you get two 'no' and one 'yes', take
the right.

-- Jim Yingst <yingst@u.arizona.edu>