You are on page 1of 5

The Island of Knights & Knaves

Introductory Logic

1 Introduction
The “Island of Knights & Knaves” is a classic problem in the study of logic. The island is
populated entirely by completely indistinguishable beings. Some are Knights and some
are Knaves. The only difference between them is that Knights always tell the truth while
Knaves always lie.

The puzzle provides an excellent way to introduce the idea of truth tables and valid
logical arguments to learners.

2 Logic
Computers and by association programming languages operate on a rigorous logical foun-
dation.
Definition 2.1. A proposition is a declarative sentence that is either true or false (but
not both). That is, a statement ends up having one of two possible truth values.
• If a statement is true, we will assign it the truth value T . If a statement is false,
we will assign it the truth value F . We will often think of statements as poten-
tially having one of the two possible truth values and we will often be tasked with
determining the truth value of the statement.
• Often we will represent a statement using propositional variables e.g. A, B, p, q, r, s
etc.
• We will then consider all possible ways of assigning truth values to variables rep-
resenting statements, often after combining several statements using logical con-
nectives to form compound propositions.

1
2.1 NOT (¬)
Given a simple statement A. If A is true then ¬A is false. If A is false then ¬A is true.
The statement A has only two possible truth values so there are only two rows in the
“truth table” for NOT.

A ¬A
T F
F T

2.2 AND (∩)


Given two simple statements A and B the compound statement A ∩ B has four possible
truth values. The statement A ∩ B is true only if A and B are both true.

A B ¬(A ∩ B)
T T F
T F T
F T T
F F T

2.3 OR (∪)
Given two simple statements A and B the compound statement A ∪ B has four possible
truth values. The statement A ∪ B is true if either or both of A and B are true.

A B (A ∪ B)
T T T
T F T
F T T
F F F

We can us the above to construct many propositions and to decide upon their truth
values.

3 Knights & Knaves Problems


In each of the problems that follow we begin by visiting the magical Island of Knights
and Knaves where Knights always tell the truth and Knaves always lie. Unfortunately
there is no way to distinguish a Knight from a Knave other than to ask them!

2
Example
You visit the island of Knights and Knaves where Knights always tell the truth and
Knaves always lie. Unfortunately there is no way to distinguish a Knight from a
Knave other than to ask them! You meet one person called A.

• A says, “I am a Knight”.

Is A a Knight or a Knave?

Solution There are of course only two possibilities here, either A is a Knight or A
is a Knave.

• If A were a Knight then A would tell the truth and say “I am a Knight”.

• If A were a Knave then A would lie and say “I am a Knight”.

It’s impossible for us to tell the difference so we cannot decide whether or not A is
a Knight or a Knave. We can use a truth table to illustrate this argument. Let

• p be the statement “A is a Knight”.

This statement can either be true or false. Now let’s make a column corresponding
to what A says. A says “I am a Knight” which is the same as statement p.
p p
TT
F F
We can see that the truth values of the two statements agree in both rows. In other
words it is possible that A is a Knight or a Knave.

Now let’s complicate things a little by introducing a second person!

3
Example
You visit the island of Knights and Knaves where Knights always tell the truth and
Knaves always lie. Unfortunately there is no way to distinguish a Knight from a
Knave other than to ask them! You meet two people A and B.

• A says “I am a Knave but B isn’t”.

Are A and B Knights? Knaves?

Solution
Let

• p be the statement “A is a Knight”.

• q be the statement “B is a Knight”.

Person A said “ ¬p ∩ q”. Since Knights always tell the truth the truth value of p
must coincide with the truth value of any statement made by A. In this case p and
¬p ∩ q must have the same truth value.

p q ¬p ( ¬ p ∩ q )
T T F F
T F F F
F T T T
F F T F

The truth value of p and ¬p ∩ q only coincide when p and q are both false i.e. A
and B are both Knaves.

4
Example
You visit the island of Knights and Knaves where Knights always tell the truth and
Knaves always lie. Unfortunately there is no way to distinguish a Knight from a
Knave other than to ask them! You meet three people A, B and C.

• A says “B or C is a Knave”.

• B says “C is a Knave”.

• C says “At least one of us is a Knave”.

Who if anyone is telling the truth?

Solution
Let

• p be the statement “A is a Knight”.

• q be the statement “B is a Knight”.

• r be the statement “C is a Knight”.

Person A said “ ¬q ∪ ¬r”. Since Knights always tell the truth the truth value of
p must coincide with the truth value of any statement made by A. In this case p
and ¬q ∩ r must have the same truth value.
Person B said “ ¬r”. Since Knights always tell the truth the truth value of q must
coincide with the truth value of any statement made by B. In this case q and ¬r
must have the same truth value.
Person C said “ ¬p ∪ ¬q ∪ ¬r”. Since Knights always tell the truth the truth value
of r must coincide with the truth value of any statement made by C. In this case
r and ¬p ∪ ¬q ∪ ¬r must have the same truth value.

p q r ¬p ¬q ¬r ¬q ∪ ¬r ¬p ∪ ¬q ∪ ¬r
T T T F F F F F
T T F F F T T T
T F T F T F T T
T F F F T T T T
F T T T F F F T
F T F T F T T T
F F T T T F T T
F F F T T T T T

The truth values of all of the statements only coincide in the third row of the table.
Therefore this is the only scenario which is logically consistent with the original
statements and we conclude that A and C are Knights while B is a Knave.

You might also like