Chapter 2. Logic: 2.1. Statements
Chapter 2. Logic: 2.1. Statements
Ch2/MATH1001/2012/YMC/2012-13/2nd
Chapter 2. Logic
2.1. Statements
In this chapter, we shall be mainly concerned with statements. A statement is a sentence of which
it is meaningful to say whether its content is true or false.
Every statement has a truth value, namely True (T) or False (F), but not both. Sometimes it may
not be immediately clear whether a given statement is true or false. Sentence 5 above is an example.
In fact, for a sentence to be a statement, it is not required that we are able to determine its truth value.
A sentence whose truth value depends on the input of certain variable is not a statement but an
open statement.
Example 2.2 Consider the sentence
P (x) : 4x = 16.
Then it is clear that the truth value of P (x) depends on x. It is true when x = 4, that is, P (4) is a
true statement; otherwise it is false, for example, P (1), P () are false statements.
2
The possible truth values of a statement are often given in a table, called a truth table. For two
statements P and Q, there are four possible combinations of truth values for P and Q:
Ch2/MATH1001/2012/YMC/2012-13/2nd
P
T
T
F
F
Q
T
F
T
F
For three statements P , Q and R, there are eight possible combinations of truth values for P , Q
and R:
P
T
T
T
T
F
F
F
F
Q
T
T
F
F
T
T
F
F
R
T
F
T
F
T
F
T
F
In general, a truth table involving n statements contains 2n possible combinations of truth values
for these statements.
Q
T
F
T
F
P Q
T
F
F
F
Ch2/MATH1001/2012/YMC/2012-13/2nd
(ii) Disjunctions
The disjunction of two statements P and Q, denoted by P Q, is a statement which is false if both
P and Q are false; otherwise it is true. For example, using the statements P and Q as before, we can
form a new statement P Q
The number 3 is even or Birds can fly,
which is true since Q is true (even P is false).
The truth table for P Q is as follows:
P
T
T
F
F
Q
T
F
T
F
P Q
T
T
T
F
(iii) Negations
Each of the conjuction and disjunction combines two statements into a new statement. The negation transforms a single given statement to a new one. The negation of a statement P , denoted by
P , is a statement which has the opposite truth value of P . The truth table for P is as follows:
P
T
F
P
F
T
The usual way to express a negation is to put the word not into a statement or to delete it from a
statement. For example, using the statements P and Q as before, their negations are
P : The number 3 is not even.
and
Q : Birds cannot fly.
Exercise Write down the negation of the statement Some students in HKU do not live in a hall.
2.3. Conditionals
The if-then combination provides another way of forming a new statement. The conditional of
two statements P and Q is the statement
If P then Q
Ch2/MATH1001/2012/YMC/2012-13/2nd
and is denoted by P Q. Here P is called the hypothesis and Q is called the consequent of the
conditional.
The conditional P Q is false when P is true and Q is false; otherwise it is true. The truth table
for P Q is as follows:
P
T
T
F
F
Q
T
F
T
F
P Q
T
F
T
T
For example, using the statements P and Q as before, the conditional is the statement
If the number 3 is even, then Birds can fly.
This is a conditional with a false hypothesis and a true consequent. Therefore it is a true statement.
The Biconditional
The statement Q P is called the converse of the statement P Q. For example, the converse
of the statement in Example 2.3 is: If I buy you a cheesecake, then you get an A for MATH1001.
The biconditional of two statements P and Q, denoted by P Q, is the conjunction
(P Q) (Q P )
of the conditional and its converse. This means
If P then Q
and If Q then P
or in short, P if and only if Q, or simply P iff Q. The truth table for P Q is as follows:
Ch2/MATH1001/2012/YMC/2012-13/2nd
P
T
T
F
F
Q
T
F
T
F
P Q
T
F
T
T
QP
T
T
F
T
(P Q) (Q P )
T
F
F
T
or in short,
P
T
T
F
F
Q
T
F
T
F
P Q
T
F
F
T
Observe that the biconditional P Q is true when both P and Q have the same truth values;
otherwise it is false.
Implication
The conditional P Q is a statement. It may have truth value either T or F. If we want to
emphasize that the conditional is true, then we shall use the implication P implies Q. Symbolically,
we denote by P Q the statementP implies Q. That is to say,
P Q means
P
T
T
F
F
Q
T
F
T
F
P Q
T
F
F
F
P QP
T
T
T
T
2
Ch2/MATH1001/2012/YMC/2012-13/2nd
Logical Equivalence
If we want to emphasize that the biconditional P Q is true, then we shall say that P is logically
equivalent to Q, written as P Q. That is to say,
P Q means
In other words, two statements are logically equivalent if they have the same truth values. Other
equivalent ways of saying P is equivalent to Q include: P if and only if Q or P is necessary and
sufficient for Q.
and
Show that we have the equivalence P (x) Q(x) for any real number x.
Solution. If x = 10, then both P (10) and Q(10) are true. Hence P (10) Q(10) is true. The same
situation holds when x = 10, that is, P (10) Q(10) is true. On the other hand, if x is not
equal to 10 or 10, then P (x) is false and in this case |x| cannot be 10, that is, Q(x) is false. Hence
both P (x) and Q(x) are false for any real number x other than 10 or 10. Thus P (x) Q(x) is
true for any real number x other than 10 or 10. It follows that P (x) Q(x) for any real number x. 2
Example 2.7 Each of the following pair of statements are logically equivalent:
(i) ( P ) and P
(double negation)
(ii) P Q and Q P
(iii) P Q and Q P
(iv) P (Q R) and (P Q) R
Ch2/MATH1001/2012/YMC/2012-13/2nd
(v) P (Q R) and (P Q) R
(vi) P (Q R) and (P Q) (P R)
(distributive law)
(vii) P (Q R) and (P Q) (P R)
(distributive law)
(viii) (P Q) and ( P ) ( Q)
(ix) (P Q) and ( P ) ( Q)
Let us verify (v), (vi) and (viii); others are left as exercise. The truth table for the two statements in
(v) is as follows:
P
T
T
T
T
F
F
F
F
Q
T
T
F
F
T
T
F
F
R
T
F
T
F
T
F
T
F
P Q
T
T
T
T
T
T
F
F
QR
T
T
T
F
T
T
T
F
P (Q R)
T
T
T
T
T
T
T
F
(P Q) R
T
T
T
T
T
T
T
F
For (vi):
P
T
T
T
T
F
F
F
F
Q
T
T
F
F
T
T
F
F
QR
T
F
F
F
T
F
F
F
R
T
F
T
F
T
F
T
F
P Q
T
T
T
T
T
T
F
F
P R
T
T
T
T
T
F
T
F
P (Q R)
T
T
T
T
T
F
F
F
(P Q) (P R)
T
T
T
T
T
F
F
F
For (viii):
P
T
T
F
F
Q
T
F
T
F
P
F
F
T
T
Q
F
T
F
T
P Q
T
F
F
F
(P Q)
F
T
T
T
( P ) ( Q)
F
T
T
T
Ch2/MATH1001/2012/YMC/2012-13/2nd
Example 2.8 Show that the statements P Q and ( P ) Q are logically equivalent.
Solution. The truth table below suggests their equivalence:
P
T
T
F
F
Q
T
F
T
F
P
F
F
T
T
P Q
T
F
T
T
( P ) Q
T
F
T
T
2
Example 2.9 Show that the statements P Q and ( Q) ( P ) are logically equivalent.
Solution. Instead of using the truth table, we are going to apply the laws from Example 2.7 and 2.8
to show the equivalence:
P Q ( P ) Q Q ( P ) ( ( Q)) ( P ) ( Q) ( P )
P T P,
P F P,
P F F,
( T) F,
( F) T
Exercise Apply the laws from Example 2.7, 2.8, 2.9, tautologies and contradictions, prove the following
equivalence of statements:
(i) (P Q) P ( Q)
Ch2/MATH1001/2012/YMC/2012-13/2nd
(ii) P (P Q) P Q
(iii) (P Q) P T
(iv) ( P ) (Q ( Q)) P
(v) P {[R (P Q)] [(R P ) (R Q)]} P
2.5. Quantifiers
Consider the statement The square of every real number is nonnegative. This statement can be
rephased as For every real number x, we have x2 0. Each of the phrases
for every, for each, for all, for any, whenever
is referred to as the universal quantifier and is commonly denoted by the symbol . The above statement
can then written as
x R, x2 0.
If we write P (x) as the open sentence P (x) : x2 0, then we can also write the above as x R, P (x).
This means that for any x in the set of real numbers (the universal set in this example), the property
P (x) holds.
Now consider another statement There exists an integer x such that x2 = 2. Each of the phrases
there exists, there is, for some, for at least one
is referred to as the existential quantifier and is commonly denoted by the symbol . Hence we can
write the above statement as
x Z such that x2 = 2 or
x Z, x2 = 2.
In summary, if P (x) is any open sentence, and if we are concerning the elements x in some universal
set S, then we have
x S, P (x)
means
and
x S, P (x) means
Next we consider the situation when we need to find the negations of statements containing quantifiers. For example,
(x S, P (x))
means
This means P (x) is false for at least one x S, that is, x S, P (x). Likewise, (x S, P (x))
means P (x) is false for all x S, that is, x S, P (x). To summarize, we have
(x S, P (x)) is logically equivalent to
x S, P (x),
x S, P (x).
10
Ch2/MATH1001/2012/YMC/2012-13/2nd
Example 2.10 Consider the open sentence P (x) : x is an even integer. Then
(x Z, P (x))
means
It is logically equivalent to
x Z, P (x) which means
Moreover,
(x Z, P (x))
means
No integer is even.
It is logically equivalent to
x Z, P (x)
which means
A statement may contain two (or more) quantifiers. For example, For any integer x and for any
integer y, the sum x + y is an integer. can be written as
x Z, y Z, x + y Z.
It is understood that interchanging x Z and y Z will not affect the meaning of the statement.
Hence we can also write the above statement as
x, y Z, x + y Z.
Here is an example involving two existential quantifiers: There exists a real number x, there exists
a real number y such that xy = 1. can be written as
x R, y R, xy = 1.
Similarly, interchanging x R and y R will not affect the meaning of the statement. Hence we
can also write the above statement as
x, y R, xy = 1.
The two quantifiers and can also be used together. For example, For any integer x, there
exists an integer y such that y > x. This can be written as
x Z, y Z, y > x.
It says that for each integer, we can find a greater one. This is certainly a true statement. For example,
if you give me x = 27, then I can take y = 30, 100, or 2415. Note that, unlike the previous examples,
the order of the two quantifiers is important to the meaning of the statement. Reversing the quantifiers
gives
y Z, x Z, y > x.
This statement is indeed false. It says that I can find an integer y so that if you give me an integer
x, then my y is greater than your x. This cannot be true since if your integer is y + 1, then it would
be an integer greater than my y. Hence we are not allowed to interchange the positions of and as
such a switching will change the meaning of the statement. Here is another example:
Ch2/MATH1001/2012/YMC/2012-13/2nd
11
(i) In every course in HKU, there is a student who fails the final examination.
(ii) There is a student who in every course in HKU fails the final examination.
Suppose all statements above are true. Let S, R, E, C, G, A be the set of all people who are Smart,
Rational, Energetic, Careless, Great and Artful respectively. Then the five statements above are equivalent to
(a) Rc S c .
(b) R C c , or equivalently C Rc .
(c) G E.
(d) E C.
(e) A S, or equivalently S c Ac .
Thus we have
G E C R c S c Ac .
We conclude that great man is not artful. In particular, we can draw the conclusion that G S c , that
is, all great men are not smart, or equivalently, smart people can never be great, as we also have
S Gc .
2
Ch2/MATH1001/2012/YMC/2012-13/2nd
12
Another area of application concerns switching circuits. As shown in the diagram below, the position
of a single switch allows us to control the on/off of an equipment.
In many circumstances, more complicated systems of switches are needed in order to achieve satisfactory control of some equipments. For example, an air-conditioning system might be controlled by
the thermostats in two rooms. If the temperature in either room exceeds 25o C, then the thermostat in
that room will close a switch to turn on the air-conditioning system. In such case, the switches should
be interconnected in parallel as shown below:
On the other hand, the door to the vault of a bank might be controlled electronically so that it
cannot be opened unless two separate keys are used to close two electric switches simultaneously. That
is, the switches are inter-connected in series, as shown below:
Clearly, when switches are in parallel, we achieve a closed circuit when one or both switches are
closed. Likewise, when switches are in series, a closed circuit is achieved when both switches are closed.
More complicated control pattern can be achieved by combining parallel and series switches suitably.
For example, a voting machine for three people P , Q and R can be designed in the following way: The
statement we want is (P Q) (P R) (Q R) (win by simple majority), which is realized by the
following circuit:
Ch2/MATH1001/2012/YMC/2012-13/2nd
13