48. A More Interesting Case

- Let's move on to a more interesting case, said the King.

Alice perked up her ears.

- This time, three accused individuals, A, B, and C, stood before the court, began the King. - The court knew that one of them was a knight, one a liar, and one a spy. But who was who, the court did not know. First, A accused B of being the spy. Then B accused C of being the spy, after which C, pointing either at A or at B, declared: "The real spy is he!" The court exposed the spy.

Who is the spy?

- Hold on, hold on! exclaimed Alice. - You don't mean to say, Your Majesty, that I should solve the problem without knowing who C pointed to?
- When I read about this case in a book as a child, replied the King, - I also thought that the information was insufficient to solve the problem. But then I thought a bit more and realized that the information provided is indeed sufficient. Yes, yes! You didn't mishear: the given information is enough to solve the problem!

Who is the spy?
48. A more interesting case. The problem would have been unsolvable if the conditions did not mention that the court identified the spy after C pointed to him, since we know that the court managed to determine which of the three was the spy, and this is a very important "clue"!

Suppose that C accused A of being the spy. With this information, the judge could not have determined who the spy was, as it only allows us to assert that either A is the spy, B is a liar, and C is a knight, or B is the spy, A is a knight, and C is a liar, or C is the spy, A is a liar, and B is a knight.

Thus, if C pointed to A as the spy, the judge could not have identified the real spy.

Now let's consider what would have happened if C pointed to B. In that case, B would have been accused of being the spy by two people: A and C. The accusations made by A and C are either both true or both false. If they were both true, then B would indeed be the spy, and since A and C both told the truth, they would both have to be knights (the "position" of the spy is occupied by B). But according to the problem, among the defendants A, B, and C, there cannot be two knights. Therefore, the accusations against B for being a spy are false. So, B is not the spy. Could A be the spy? No, because if A were the spy, the mutual accusations of B and C for being a spy would be false. Therefore, B and C would both be liars (which contradicts the conditions of the problem). The only possible case remains: the spy is C (B, who accused C of being a spy, is a knight, and A, who accused B, is a liar).

Thus, if C pointed to A as the spy, the judge could not have determined who among the three was actually the spy. But if C pointed to B, the judge could determine that the spy is C. Since the judge knew who A pointed to, C must have pointed to B, and the judge, based on the information received, identified C as the spy.