0% found this document useful (0 votes)
118 views13 pages

Chapter 2. Logic: 2.1. Statements

1) The document discusses logic and statements. A statement is a sentence that can be classified as true or false. 2) Key logical connectives are introduced - conjunctions "and", disjunctions "or", negations "not", and conditionals "if...then". Truth tables are used to determine the truth values of statements combined with these connectives. 3) Implications and logical equivalences are discussed. Two statements are logically equivalent if they always have the same truth value according to their truth tables. Examples demonstrate implications and equivalences between statements using laws of logic.

Uploaded by

Heng Choc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
118 views13 pages

Chapter 2. Logic: 2.1. Statements

1) The document discusses logic and statements. A statement is a sentence that can be classified as true or false. 2) Key logical connectives are introduced - conjunctions "and", disjunctions "or", negations "not", and conditionals "if...then". Truth tables are used to determine the truth values of statements combined with these connectives. 3) Implications and logical equivalences are discussed. Two statements are logically equivalent if they always have the same truth value according to their truth tables. Examples demonstrate implications and equivalences between statements using laws of logic.

Uploaded by

Heng Choc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

1

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.

Example 2.1 Each of the following sentences is a statement:


1. The number 3 is even.
2. Birds can fly.
3. The product of two odd numbers must be odd.
4. Everyone in this classroom can speak Cantonese.
5. The 85th digit in the decimal expansion of is 3.
6. If 2 is greater than 3, then the sun rises from the west.
None of the following sentences can be regarded as a statement in the above sense:
7. The number 4 is stupid.
8. Please come to my office today.
2

9. Can you lend me some money?

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.

2.2. Conjunctions, Disjunctions and Negations


We now consider different modes of combining statements:
(i) Conjunctions
The conjunction of two statements P and Q, denoted by P Q, is a statement which is true if
both P and Q are true; otherwise it is false. Thus the truth value of a conjunction P Q is uniquely
determined by the truth values of its components P and Q. For example, let P and Q be statement 1
and 2 of Example 2.1 respectively, then their conjunction P Q is a new statement
The number 3 is even and Birds can fly,
which is false since P is false (even Q 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
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.

(Or equivalently, The number 3 is odd.)

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.

Example 2.3 Consider the statement:


If you get an A for MATH1001, then I buy you a cheesecake.
The above statement is true either if you really get an A for MATH1001 and I then buy you a cheesecake, or you do not get an A for MATH1001 (in this case, it does not matter whether I buy you a
cheesecake or not). The only situation that this statement becomes false is that, if you got an A for
MATH1001, but I did not buy you a cheesecake (that is, I have broken my promise!)
2

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.

2.4. Implication and Logical Equivalence

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

the statement P Q is true.

Other equivalent ways of saying P implies Q include: Q follows from P ; P is a sufficient


condition for Q; Q is a necessary condition for P .

Example 2.4 Let P and Q be statements. Show that P Q P .


Solution. To show that the above is an implication, we need to show that the conditional P Q P
is always true, regardless of the truth values of P and Q. This can be seen from the following truth table:

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

Example 2.5 Consider the open sentences


P (x) : x = 10 and Q(x) : |x| = 10.
Show that we have the implication 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. If
x 6= 10, then P (x) is false. But |x| can be 10 or not equal to 10, that is, Q(x) can be true or false.
In any case, P (x) Q(x) is true for x 6= 10 (since the hypothesis is false). Combining with the case
x = 10, we have P (x) Q(x) is true for any real number x. In other words, P (x) Q(x) for any
real number x.
2

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

the statement P Q is true.

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.

Example 2.6 Consider the open sentences


P (x) : x = 10 or x = 10

and

Q(x) : |x| = 10.

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

(commutative law of conjuction)

(iii) P Q and Q P

(commutative law of disjuction)

(iv) P (Q R) and (P Q) R

(associative law of conjuction)

Ch2/MATH1001/2012/YMC/2012-13/2nd

(v) P (Q R) and (P Q) R

(associative law of disjuction)

(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)

(De Morgans law)

(ix) (P Q) and ( P ) ( Q)

(De Morgans law)

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 ) 

Remark The statement ( Q) ( P ) is known as the contrapositive of the conditional P Q.


Example 2.9 tells us that the conditional and its contrapositive are logically equivalent. The fact that
they are equivalent will be essential when we discuss Proof by Contrapositive later.

Tautologies and Contradictions


Let P be any statement. The statement P ( P ) is always true regardless of the truth value of
P . Such statement is known as a tautology and we denote it by T. Another example of a tautology is
given by ( Q) (P Q) (verify it!)
On the other hand, the statement P ( P ) is always false regardless of the truth value of P . Such
statement is known as a contradiction and we denote it by F. Another example of a contradiciton is
given by (P Q) (Q ( P )) (verify it!)
The following are some laws involving tautologies and contradictions:
P T T,

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

P (x) is true for any x S,

and
x S, P (x) means

There exists at least one x S such that P (x) is true.

Next we consider the situation when we need to find the negations of statements containing quantifiers. For example,
(x S, P (x))

means

It is not case that P (x) is true for all x S.

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)) is logically equivalent to

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

Not every integer is even.

It is logically equivalent to
x Z, P (x) which means

Some integer is not even.

Moreover,
(x Z, P (x))

means

No integer is even.

It is logically equivalent to
x Z, P (x)

which means

Every integer is not even.

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.

2.6. Some Applications


Besides using them to count, sets can also be used to represent logical implications. For example,
let C be the set of all good cats and M be the set of animals that catch mice. Then the statement All
good cats catch mice can be written as x C, x M , that is, C M . With this interpretation,
sets can be used to deduce logical conclusions. For example, if C M , then M c C c (here we take
the set of all animals as the universal set). Hence we can conclude that An animal that cant catch
mice cannot be a good cat.

Example 2.11 Consider the following statements:


(a) Irrational people can never be smart.
(b) Rational people are always careful.
(c) Great men are always energetic.
(d) Energetic people are always careless.
(e) Artful people are always smart.

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

which uses fewer switches.

13

You might also like