Sunday, February 4, 2018

Inspector Craig, Logical Detective

Inspired by the puzzles of Raymond Smullyan, I've been playing with various puzzle types that he either invented or popularised. Earlier I posted some knight and knave puzzles, and a a page of puzzles inspired by his "Portia's Caskets" puzzles, and now another has joined the pile: The Case Files of Inspector Craig.

Here's an example of the kind of puzzles you will find on the page:


Your goal is to classify each suspect as either innocent, guilty, or unknown (in the case where the evidence cannot support either guilt or innocence).

Depending on how familiar you are with logical symbols, it may help to simplify the language used to describe the clues - if we use the letter X to mean "X is guilty," we can express the statements above a bit more formally:

There are two key techniques for solving these puzzles: 1) start with one of the statements, say A, and see if applying the propositions will lead to a contradiction; and 2) start with the statement "A or B or C" and work out the implications of each case - if there is a result that all three lead to, then that must be true.

We can use the first method starting with B. If we assume B is guilty then since B always uses A as an accomplice (B implies A), A must be guilty. However we also have a statement that says that A never works with B (A implies not B), which means that B is innocent. Since assuming B is guilty ended up showing that B is innocent (B implies not B), then B must not have been guilty.

Using the second method, we know that either A or B or C is guilty. We already know that B is innocent, so that leaves us with A and C. If A is guilty, we can't determine much else. However if C is guilty, then since C always uses A as an accomplice (C implies A), then A is also guilty. So, no matter which of the two alternatives we choose, A is guilty.

Unfortunately, there is no way to know whether or not C is guilty based on this reasoning, so we are left to make this selection:


Which turns out to be correct.

Try a few out here: https://dmackinnon1.github.io/inspectorCraig/