Imagine 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.
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
This means the other two statements are false, 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.
Even if his symbolism led to the logic gates of the modern computer, I still need someone to explain the precise advantages of the Boolean approach to this kind of puzzle over the succinct classical type of reasoning presented in the first paragraph in the above solution.
For one thing the original article on this website appears to promise us something better, and presumably quicker, than "trial and improvement". Yet both methods presented entail two steps: trying the first then the second statements to see what would follow from supposing them to be true, and finding them to result in contradictions. All that Boole seems to provide here is an extra layer of symbolism to decipher. How does it help specially, for example, to know that Xr + Yr + Zr = 1? And that it is contradicted by Xr + Yr + Zr = 0?
I could be missing the point of course, perhaps in hoping for some kind of algorithm or set of arithmetical rules that can be applied unthinkingly rather like steps in long division.