A says:
“B is a knave.”
B says:
“A and C are of the same type.”
Knights tell the truth and Knaves lie.
What is C? (i.e. a knight, or a knave?)
Let $a,b,c$ be booleans that mean "A, B or C (respectively) tells the truth". Also assume that if X says Y, then either both X and Y are true or both are false (i.e. X=Y). Then your statements are:
1. $a = \bar{b}$, from A says "B is a knave"; and
2. $b = (a=c)$, from B says "A and C are of the same type".
Substituting (1) into (2) gives us
$\bar{a} = (a = c)$. This reduces to $\bar{c}$ for $a=T$ as well as for $a=F$.
So
C is a knave.
Use truth table to find out what is C
If A is knight, then B is knave, means A and C are different type. A is knight so C is Knave
If A is knave, then B is knight, means A and C are same type. A is knave so C is Knave
We are given:
A: B is knave
B: A = C.
If A is knight: then B is knave and A ≠ C so C is knave.
If A is knave: then B is knight and A = C so C is knave.
Therefore C is knave.
Assume that B is a knight (telling the truth). Therefore, A and C are the same type. A has asserted that B is a knave (lies). But this is false, by the assumption. Therefore, A is a knave (lies). Since A and C are the same type, C is a knave (lies).
Assume now that B is a knave (lies). Therefore, A and C are of different types. A has asserted that B is a knave (lies). This is true, by the assumption. Therefore, A is a knight (telling the truth). Since A and C are of different types, C is a knave (lies).
Since regardless of what we assume B to be, C is deduced to be a knave (lies), we conclude that C is a knave.
Note that we make no assumptions about A; we only make assumptions about B, and reason from the consequence of that assumption. Further, we ultimately do not know anything about A or B.
If C is a Knight, and so is B, then A is too, but A would be lying.
If C is a Knight, and B is a Knave, then A is a Knave, but then B is a Knight. Contradiction.
Conclusion: C is a Knave
$A$ says $B$ is a Knave is equivalent to $B$ says $A$ is a Knave - exactly one of $A$ and $B$ is a Knight.
Define a new operator $[X=]$, with $X$ a Boolean variable. If $X$ is true, $[X=]$ becomes $=$, otherwise it becomes $\ne$.
Now we have $B\implies \lnot A$ and $B\implies (A\;\;[B=]\;\;C)$.
And $(A\;\;[\lnot A=]\;\;C)\implies C=\text{false}$ - so C is a Knave.
$(A\;\;[B=]\;\;C)$ is a boolean ternary operator, written $\triangle(A,B,C)$. $B$ can be seen as switching between a XOR gate (X,0,false) and a NXOR gate (N,1,true).
The truth table is:
A | B | C | out |
---|---|---|---|
0 | X | 0 | 0 |
0 | X | 1 | 1 |
0 | N | 0 | 1 |
0 | N | 1 | 0 |
1 | X | 0 | 1 |
1 | X | 1 | 0 |
1 | N | 0 | 0 |
1 | N | 1 | 1 |
It can also be written as:
$$(\lnot A \land \lnot B \land C) \lor (\lnot A \land B \land \lnot C) \lor (A \land \lnot B \land \lnot C) \lor (A \land B \land C)$$
and:
$$A+B+C-AB-BC-CA+ABC$$
Rows $3$ and $5$ give the result for this question ($A=\lnot B$ and
out
is true imply $C=0$).
Let’s look at every possible scenario. First, we assume…
Scenario 1: A is a knight. They are telling the truth.
Then, it is true that B is a knave, and they are lying. So, A and C are not of the same type. Then, if A is a knight, then C is a knave.
Now we will assume…
Scenario 2: A is a knave. They are lying.
Then, it is false that B is a knave. So, B is a knight, and they tell the truth. That means A and C are of the same type. If A is a knave, then so is C.
So, we conclude that:
No matter whether A and B are knights or knaves, C will be a knave.
Another way of looking at it: if C were a knight, B's statement would be tantamount to claiming that A is a knight, which would be tantamount to claiming that B is a knave. But that's impossible, as no knight or knave can ever claim to be a knave. Therefore C must be a knave.