# Who is the truth teller (logic puzzle)

I am not entirely sure if I am going on the right pass here in solving the following logical puzzle:

There are 3 people.
$X$ says only one person is lying. $Y$ says exactly two people are lying. $Z$ says all of us are lying.

This is how I tried to solve it, I used the negation for lying and normal form for truth.

$Z: \lnot X\wedge \lnot Y\wedge \lnot Z$ so,

$\lnot Z: X \vee Y\vee Z$ , which forms a contradiction as Z can't be a truth teller

So, $Y: (\lnot X\wedge\lnot Y\wedge Z)\vee(\lnot X\wedge\lnot Z\wedge Y)\vee(\lnot Z\wedge\lnot Y\wedge X)$

But the first brackets form a contradiction as Z is a liar, so that can be canceled out

so,$Y:(\lnot X\wedge\lnot Z\wedge Y)\vee(\lnot Z\wedge\lnot Y\wedge X)$ Here I think I can't go any further because, both could be correct.

Thus, I move to the X,

$X:(\lnot X\wedge Y\wedge Z)\vee(\lnot Y\wedge Z\wedge X)\vee(\lnot Z\wedge Y\wedge X)$ Here again we cancel out two of them for the same reason like $Y$.

so, $X:(\lnot Z\wedge Y\wedge X)$

And here I just tried if $X$ is true then, $Y$ and $x$ are true which shows contradiction in $Y$ so $X$ is a liar as well and thus $Y$ is the truth teller?

Now, my question is whether this was correct, and if anyone can show me an alternative shorter/faster way to solve this? Thanks in advance.

• You have already shown that $Z$ is a liar. It is not possible for both $X, Y$ and to be true. So, $X$ cannot be true. Y is making a truthful statement. – Doug M Jan 18 '18 at 18:57
• You meet two people. The first one says, "tomorrow's lottery numbers are 4 6 12 23 29 35". The second one says, "we're both lying". What do? – hmakholm left over Monica Jan 19 '18 at 22:24

If X says the truth, then Y and Z lie. Contradiction.

If Z says the truth, then X, Y and Z lie. Since this implies that X, Y and Z say the truth (because the number of liars can not be $1$, $2$ or $3$) and what they say can not happen at once, this is a contradiction.

So only Y can say the truth. I can not find any contradiction in this case.

Given that the three statements are mutually exclusive, at least two of them are false, so at least two of them are lying. They can't all three lie though, since that would mean $Z$ is speaking the truth. Hence, exactly two of them are lying, meaning that $Y$ is telling the truth.

I like both the answers posted before mine, but if you want an algebraic approach to this kind of puzzles--one that requires almost no thinking--you proceed as follows.

"If $Z$ is truthful, $X$, $Y$, and $Z$ lie" is translated into

$$Z \leftrightarrow (\neg X \wedge \neg Y \wedge \neg Z) \enspace.$$

Simplifying, we get $\neg Z \wedge (X \vee Y)$. Then, "If $X$ is truthful, one of $X$, $Y$, $Z$ lies" simplifies to

$$X \leftrightarrow (X \wedge Y)$$

when taking $\neg Z$ into account. Further manipulation yields $\neg X \vee Y$, which combined with $\neg Z \wedge (X \vee Y)$ gives $\neg X \wedge Y \wedge \neg Z$, which implies $Y$'s statement.

The puzzle is well-posed because it has exactly one solution.