## Counter logic: Solution

Submitted by Marianne on November 16, 2015Imagine that I have three counters X, Y and Z. They are coloured red, white and blue, but not necessarily in this order. One, but only one, of the following statements is true:

X is red

Y is not red

Z is not blue

Can you work out the colours of the counters?

*This puzzle was suggested to us by Ems Lord, as part of her wonderful article celebrating the bicentenary of the birth of George Boole.*

### Solution

We know that only one of the three statements is true. If we assume that each statement is true in turn we can see if that leads to a contradiction. Let's try the first statement. If "X is red" is true then "Y is not red" is false, forcing Y is be red — a contradiction since only one counter can be red. Now the second statement. If "Y is not red" is true then "Z is not blue" and "X is red" are both false. That forces Z to be blue and since X cannot be red, none of the counters is red — that's also a contradiction, since one of them must be red. Finally, consider the third statement to be true. If "Z is not blue" is true then "Y is not red" is false, making Y a red counter. The statement "X is red" is also false, leading to X being blue and Z being white as the solution.

We can also solve this puzzle using the binary algebra system developed by George Boole. A true statement comes with a truth value of 1 and a false statement with a truth value of 0. The AND operation is represented by multiplication and the OR operation by addition (see this article to find out more).

Let’s write for the statement that counter is red, for the statement that counter is red, and so on. Here are some things we can deduce from the set-up.

1) Since one of the counters is definitely red, the statement "X is red OR Y is red OR Z is red" is true, so

(The same is true for each of the other two colours.)

2) Since only one counter can be red, the statement "X is red AND Y is red" must be false, so

(The same is true for any pair of counters and for any colour.)

3) Since a counter can only have one colour, the statement " is blue AND is red" is false, so

(The same is true for any pair of colours and any counter.)

Now suppose that the first statement is true, so This means that the second statement is false, so

which means that

This implies that

contradicting fact 2) above. Hence the first statement is false.

Suppose the second statement is true, so

implying that

This means the other two statements are false, so

so

By fact 3) above this means that

It follows that

contradicting fact 1 above. Therefore, the second statement is false.

It follows that the true statement must be the last one, so

The first and second statements are false, so

From fact 3) above it follows that

From fact 1) we have

Therefore which means that Therefore, counter is blue, counter Y is red and counter Z is white.