Chapter 2 SMA
Chapter 2 SMA
Learning Outcomes:
2.1 Introduction
Logic is the discipline that deals with the methods of reasoning. On an elementary
level, logic provides rules and techniques for determining whether a given argument is
valid.
AUGUSTUS DE MORGAN
15
GEORGE BOOLE
Examples of proposition:
1. Sofia is a doctor.
2. The earth is round.
3. Cairo is the capital of Japan.
4. SMA1034 is the course code for Introduction to Discrete Mathematics.
5. Tun Mahathir is the 7th Prime Minister of Malaysia.
6. What is my name.
7. I have three sisters.
16
Example 1:
Which of the following are statement/proposition?
a. 2+3 = 5.
b. 3− x = 5.
c. Take two aspirins.
d. The temperature on the surface of the planet Venus is 800 F .
e. The sun will come out tomorrow.
Solution:
a. Is a statement that happen to be true.
e. Is a statement since it is either true or false, but not both, although we would
have to wait until tomorrow to find out if it is true or false.
In logic, the letters p, q, r , ... denote the propositional variables: Variable that can be
replaced by proposition.
Negation
Let p be a proposition. The statement “It is not the case that p ” is another proposition,
called the negation of p . The negation of p is denoted by ~ p and read “not p ”.
17
Example 2:
Each of the following is a negation.
p ~p
T F
F T
Notes:
Such a table, giving the truth values of a compound statement in terms of its
component parts, is called truth table.
Example 3:
Give the negation of the following statements:
a. p : 2 + 3 1
b. q : It is cold.
Solution:
a. ~ p : 2 + 3 is not greater than 1 . That is, ~ p : 2 + 3 1 . Since p is true in this
case, ~ p is false.
Conjunction
If p and q are propositions, the conjunction of p and q is the compound proposition
“ p and q ”, denoted by p q . The following is the truth table.
p q pq
T T T
T F F
F T F
F F F
18
Example 4:
Each of the following is a conjunction.
Example 5:
Form the conjunction of p and q for each of the following.
a. p : It is snowing. q : I am cold.
b. p: 23 q : − 5 −8
c. p : It is snowing q: 35
Solution:
a. p q : It is snowing and I am cold.
b. p q : 2 3 and −5 −8
c. p q : It is snowing and 3 5 .
Disjunction
If p and q are proposition of p and q is the compound propositions ‘ p or q ’,
denoted by p q. The following is the truth table.
p q pq
T T T
T F T
F T T
F F F
Example 6:
Each of the following is a disjunction.
19
Example 7:
Form the disjunction of p and q for each of the following.
a. p : 2 is the positive integer. q : 2 is a rational number.
b. p: 2+3 5 q : Paris is the capital of Sweden.
Solution:
a. p q : 2 is a positive integer or 2 is a rational number. Since p is true, the
disjunction p q is true, even though q is false.
b. p q : 2 + 3 5 or Paris is the capital of Sweden. Since both p and q are
false, p q is false.
Compound Statement
In general, a compound statement may have many component parts, each of which is
itself a statement, represented by some propositional variables.
Example 8:
( p q) (~ p) is an example of compound statement. Make a truth table for
( p q) (~ p) .
Solution:
p q pq ~p ( p q) (~ p)
T T T F T
T F F F F
F T F T T
F F F T T
2.2.2 Quantifiers
An element of {x | P( x)} is an object t for which the statement P(t ) is true. Consider
the following example:
P( x) : x 8
20
Example 9:
Let A = x x is an integer less than 8 . Here P( x) is the sentence “ x is an integer
less than 8.” The common property is “is an integer less than 8.” P(1) is the statement
“ 1 is an integer less than 8.” Since P(1) is true, 1 A .
Universal Quantification
x P( x)
a. For each …
b. For every …
c. For any …
Example 10:
a. The sentence P( x) : −(− x) = x is a predicate that make sense for real numbers
x . The universal quantification of P( x), x P( x) , is a true statement, because
for all real numbers, −(− x) = x .
Existential Quantification
x P( x)
21
Existential quantification can also be stated in English as:
1. There is some …
2. There exists …
3. There is at least …
Notes:
For a predicate with several variables, we may apply both universal and existential
quantification. In this case, the order does matter.
Example 11:
a. Let Q( x) : x + 1 4 . The existential quantification of Q( x), x Q( x) , is a true
statement, because Q ( 2 ) is a true statement.
Example 12:
a. Let D be the set of n n diagonal matrices. Consider the statement M D
−1
such that M does not exists. To determine if this statement is true or false,
we must decide if there is an n n diagonal matrix that does not have an
inverse.
Example 13:
Let A and B be n n matrices.
22
Example 14:
Let p : For all positive integers n, n + 41n + 41 is a prime number. Then ~ p
2
a.
is “There is at least one positive integer n for which n2 + 41n + 41 is not prime.”
b. Let q : There is some integer k for which 12 = 3k . Then ~ q : For all integers
k , 12 3k .
Example 15:
Let p : The empty set is a subset of any set A . For p to be false, there must be an
element of that is not in A , but this is impossible. Thus p is true.
p q p→q
T T T
T F F
F T T
F F T
Example 16:
Each of the following is an implication.
Example 17:
Form the implication p → q for each of the following.
a. p : I am hungry q : I will eat.
b. p : It is snowing. q : 3+5 = 8
Solution:
a. If I am hungry, then I will eat.
b. If it is snowing, then 3 + 5 = 8 .
23
Converse and Contrapositive
p q p→q q→ p
T T T T
T F F T
F T T F
F F T T
p q p→q ~ q →~ p
T T T T
T F F F
F T T T
F F T T
Example 18:
Give the converse and contrapositive of the implication “If it is raining, then I get wet”.
Solution:
We write:
p : It is raining.
q : I get wet.
24
Equivalence or Biconditional
p q pq
T T T
T F F
F T F
F F T
Example 19:
Each of the following is an equivalence.
Example 20:
Is the following equivalence a true statement?
3 2 if and only if 0 3 − 2 .
Solution:
Let p be the statement 3 2 and let q be the statement 0 3 − 2 . Since both p
and q are true, we conclude that p q is true.
Example 21:
Compute the truth table of the statement ( p → q) (~ q → ~ p) .
Solution:
p q p→q ~q ~p ~ q →~ p ( p → q) (~ q → ~ p)
T T T F F T T
T F F T F F T
F T T F T T T
F F T T T T T
25
Notes:
a. Tautology is a statement that true for all possible values of its propositional
variables.
Example 22:
Solution:
a.
p ~p p ~ p
T F F
F T F
b.
p q p→q pq ( p → q ) ( p q)
T T T T T
T F F T F
F T T T T
F F T F F
Example 23:
The binary operation has the commutative property; that is, p q q p . The truth
table for ( p q) (q p) shows the statement is a tautology.
p q pq q p ( p q) (q p)
T T T T T
T F T T T
F T T T T
F F F F T
26
Example 24:
p q p→q ~p (~ p) q
T T T F T
T F F F F
F T T T T
F F T T T
Theorem 1:
Commutative properties
1. pq q p
2. pq q p
Associative properties
1. p (q r ) ( p q) r
2. p (q r ) ( p q) r
Distributive properties
1. p (q r ) ( p q) ( p r )
2. p (q r ) ( p q ) ( p r )
Idempotent properties
1. p p p
2. p p p
Properties of negation
1. ~ (~ p) p
2. ~ ( p q) (~ p) (~ q)
3. ~ ( p q) (~ p) (~ q)
27
Theorem 2:
a. ( p → q) (~ p) q
b. ( p → q) (~ q → ~ p)
c. ( p q) ( ( p → q) (q → p) )
d. ~ ( p → q) ( p ~ q)
e. ~ ( p q) ( ( p ~ q) ( q ~ p) )
Theorem 3:
a. ~ ( x P( x) ) x ~ P( x)
b. ~ ( x P( x) ) x ( ~ P( x) )
c. x P( x) → Q( x) x P( x) → x Q( x)
d. x ( P( x) Q( x) ) x P( x) x Q( x)
e. x ( P ( x) Q( x) ) x P( x) x Q( x)
f. ( ( x P( x) ) ( x Q( x) ) ) → x P( x) Q( x) is a tautology.
g. x ( P( x) Q( x) ) → x P( x) x Q( x) is a tautology.
Theorem 4:
a. ( p q) → p b. ( p q) → q
c. p → ( p q) d. q → ( p q)
e. ~ p → ( p → q) f. ~ ( p → q) → p
g. ( p ( p → q)) → q h. (~ p ( p q)) → q
i. (~ q ( p → q)) →~ p j. (( p → q) (q → r )) → ( p → r )
28
2.4 Methods of Proof
The validity of the arguments depends only on the form of the statements involved and
not on the truth values of the variables.
An argument is valid if and only if it is impossible for all the premises to be true and the
conclusion to be false.
RULES OF INFERENCE:
p→q
q→r
p→r
p→q
p
q
p→q
~q
~ p
pq
~p
q
Addition: p → ( p q) is a tautology.
p
p q
Simplication: ( p q) → p is a tautology.
pq
p
29
Conjunction: ( p) (q) → ( p q) is a tautology.
p
q
p q
Resolution: ( p q) (~ p r ) → (q r ) is a tautology.
pq
~ pr
q r
Example 25:
Is the following argument valid?
If you invest in the stock market, then you will get rich.
If you get rich, then you will be happy.
If you invest in the stock market, then you will be happy.
Solution:
Argument is valid, although the conclusion may be false.
Example 26:
Is the following argument valid?
Smoking is healthy.
If smoking is healthy, then cigarettes are prescribed by physicians.
Cigarettes are prescribed by physicians.
Solution:
The argument is valid since it is form modus ponens. However, the conclusion is
false.
30
Example 27:
Is the following argument valid?
Solution:
Let p : taxes are lowered, and q : income rises.
p→q
q
p
Example 28:
For each of the following, is the argument valid? If valid, then state its rules of inference.
31
Solution:
p→q
q
p
p→q
p
q
p→q
p
q
pq
p
q
p→q
q
p
32
METHODS OF PROOF
In practice, the construction of proofs is an art and must be learned in part from
observation and experience. The choice of intermediate steps and methods of deriving
them is a creative activity that cannot be precisely described. But a few simple
techniques are applicable to a wide variety of settings.
a. Direct Method
b. Indirect Method
c. Proof by Contradiction
d. Counterexample
e. Mathematical Induction
Definition 1:
Let n be an integer. We call n even if n is divisible by 2 i.e. if there exists an integer
r so that n = 2r . If n is not even, then we call n odd and find for this case that there
exists an integer s where n = 2s + 1 .
Solution:
2
Let p : n is odd and q : n is odd. We have to prove that p → q is true. Instead, we
prove the contrapositive ~ q → ~ p .
We thus show that if n is even, then n 2 is even, which is the contrapositive of the given
statement. Hence the given statement has been proved.
Solution:
The statement can be restated in the form xy R( x, y) . Thus, to approve this result,
we would need to provide steps, each of which would true for all x and y . To disprove
the result, we need only find one example for which the implication is false.
Since ( −3 ) = 32 , but
2
−3 3 , the result is false. Our example is called a
counterexample, and another counterexample would do just as well.
33
Example 31: (Proof by Contradiction)
Prove that there is no rational number p / q whose square is 2. In other words, show
that 2 is irrational.
Solution:
Please try …
Solution:
Please try …
Solution:
Since k and l are odd, we may write k = 2a + 1 and l = 2b + 1 , for some integers a, b.
This is due tu Definition 1.
Then
k + l = (2a + 1) + (2b + 1) = 2(a + b + 1),
by virtue of the commutative and associative laws of addition and the distributive law
of multiplication over addition i.e. all of which hold for integers.
Solution:
Now for n = 0 it is true that n2 = 02 = 0 = n. And if n = 1, it is also true that
n2 = 12 = 1 = n. However, we cannot conclude n2 = n for every integer n . The rule of
universal generalization does not apply here, for we cannot consider the choice of 0
(or 1) as an arbitrarily chosen integer.
34
Example 35: (What method?)
For all integers k and l , if k and l are both odd, then their product kl is also odd.
Solution:
Since k and l are both odd, we may write k = 2a + 1 and l = 2b + 1 , for some integers
a and b because of Definition 1.
We should not assume, however, that every theorem can be so readily proved in a
variety of ways. Investigate the following example.
Example 36:
If m is an even integer, then m + 7 is odd.
Solution:
We shall prove in three ways i.e.
m + 7 = 2a + 7 = 2a + 6 + 1 = 2(a + 3) + 1.
Suppose that m + 7 is not odd, hence even. Then, m + 7 = 2b for some integer b and
m = 2b − 7 = 2b − 8 + 1 = 2(b − 4) + 1,
35
3. Proof by Contradiction
Now assume that m is even and that m + 7 is also even. (This assumption is the
negation of what we want to prove.)
m = 2c − 7 = 2c − 8 + 1 = 2(c − 4) + 1
with c − 4 an integer, so m is odd. Now we have our contradiction. How and why?
We started with m even and deduced m odd. An impossible situation, since no integer
can be both even and odd. How did we arrive at this dilemma? Simple. We made a
mistake! This mistake is the false assumption, namely, m + 7 is even, that we wanted
to believe at the start of the proof. Since the assumption is false, its negation is true,
and so we now have m + 7 odd.
Solution:
Consider the negation of the conclusion that is, suppose that 0 x 5 and
0 y 5. Under these circumstances, we find that 0 = 0.0 x . y 5.5 = 25, so the
product xy does not exceed 25.
Example 38:
Show, by mathematical induction, that for all n 1,
1 + 2 + 3 + ... + n =
( n ( n + 1)) .
2
36
Solution:
Basic Step:
1=
(1(1 + 1))
2
Inductive Step:
We must now show that for k 1 , if P ( k ) is true, then P ( k + 1) must also be true.
We assume that for some fixed k 1 ,
1 + 2 + 3 + ... + k =
( k ( k + 1))
2
1 + 2 + 3 + ... + k + ( k + 1)
and we have:
(MUST START FROM LHS)
k (k + 1)
(1 + 2 + 3 + ... + k ) + ( k + 1) = + (k + 1)
2
k
= (k + 1) + 1
2
(k + 1)(k + 2)
=
2
( k + 1) ( ( k + 1) + 1)
= : RHS of P ( k + 1)
2
37
Example 39:
Prove that the following statement is true:
2 + 4 + 6 + ... + 2n = n ( n + 1)
Solution:
Basic Step:
Inductive Step:
P ( k ) : 2 + 4 + 6 + ... + 2k = k ( k + 1)
P ( k + 1) : 2 + 4 + 6 + ... + 2 ( k + 1) = ( k + 1) ( k + 1) + 1 = ( k + 1)( k + 2 )
LHS of P ( k + 1) : 2 + 4 + 6 + ... + 2k + 2 ( k + 1) = k ( k + 1) + 2 ( k + 1)
= ( k + 1)( k + 2 ) : RHS of P ( k + 1)
Example 40:
Let A1 , A2 , A3 , ..., An be any n sets. We show by mathematical induction that
n n
Ai = Ai
i =1 i =1
(This is an extended version of one of De Morgan’s laws). Let P(n) be the predicate
that the equality holds for any n sets we prove by mathematical induction that for all
n 1, P(n) is true.
Solution:
Basic Step:
Inductive Step:
38
k +1
i =1 Ai = A1 A2 ... Ak Ak +1
= ( A1 A2 ... Ak Ak +1 )
= ( A1 A2 ... Ak ) Ak +1
k
= Ai Ak +1
i =1
k +1
= Ai
i =1
Example 41:
Prove that the following statement is true for n is a nonnegative integer:
1 + 21 + 22 + ... + 2n = 2( n+1) −1
Solution:
Basic Step:
n = 0, P ( 0 ) : 2( 0+1) − 1 = 1 is true.
Inductive Step:
P(k + 1) :1 + 21 + 22 + ... + 2k +1 = 2( k + 2) − 1
LHS of P ( k + 1) :1 + 21 + 22 + ... + 2k + 2(
k +1)
( )
= 2( k +1) − 1 + 2k +1
= 2 2( k +1) − 1
= 2( k + 2) − 1 : RHS of P ( k + 1)
By the principle of mathematical induction, it follows that P(n) is true for all n 0.
Example 42:
Consider the following recursive definition of the factorial function:
1 ! = 1, n ! = n (n − 1) !, n 1
n −1
Suppose we wish to prove for all n 1, n ! 2 . We proceed by mathematical
n −1
induction. Let P(n): n ! 2 . Here n0 is 1.
39
Solution:
Basic Step:
Inductive Step:
Thus, P(k + 1) is true. By the principle of mathematical induction, it follows that P(n)
is true for all n 1.
Notes:
A slightly different form of mathematical induction is easier to use in some proofs. In
the strong form of mathematical induction or strong induction, the induction step
is to show that
P(n0 ) P(n0 +1) P(n0 +2) P(k ) → P(k + 1)
40
TUTORAN 1: PROPOSITIONS AND LOGICAL OPERATIONS
a. Is 2 a positive number?
b. x2 + x + 1 = 0
c. Study logic.
d. There will be snow in January.
e. If stock prices fall, then I will lose money.
3. In each of the following, form the conjunction and the disjunction of p and q .
a. 2 3 or 3 is a positive integer.
b. 2 3 or 3 is a positive integer.
c. 2 3 or 3 is not a positive integer.
d. 2 3 or 3 is not a positive integer.
5. Find the truth value of each proposition if p and r are true and q is false.
a. ~ p (q r ) b. p (~ (q ~ r ))
c. ( r ~ q) ( p r ) d. (q r ) ( p ~ r )
41
TUTORAN 2: CONDITIONAL STATEMENTS
a. p → (q → p)
b. q → (q → p)
5. Find the truth value of each statement if p and q are true and r , s, and t are
false.
a. ~ ( p → q)
b. (~ p) → r
c. ( p → s) ( s → t )
d. t →~ q
42
TUTORAN 3: METHODS OF PROOF
a. ( p → q) (q → r ) b. ~ ( p → q)
(~ q) r p
p ~ q
4. For each of the following statements, provide an indirect proof by stating and
proving the contrapositive of the given statement.
b. For all integers k and l , if k + l is even, then k and l are both even
or both odd.
9. Let m, n be two positive integers. Prove that if m, n are perfect squares, then
the product mn is also a perfect square.
10. Prove or disprove: If m, n are positive integers and m, n are perfect squares,
then m + n is a perfect square.
12. Prove that for all real numbers x and y , if x + y 100 , then x 50 or y 50.
43
14. Let n be an integer. Prove that n is odd if and only if 7n + 8 is odd.
15. Let n be an integer. Prove that n is even if and only if 31n + 12 is even.
16. Prove that the structure (odd integers, +,* ) is closed with respect to * .
44
TUTORAN 4: MIXED QUESTIONS
a. pq b. pq
c. ~p d. ~q
3. p : x 50
q : x 40
a. ~p b. ~q
c. pq d. pq
e. ~ pq f. ~ p ~ q
a. p ~ q
b. q (~ p q)
c. p → (q ~ r )
d. ( p q) r
45
5. Propositions p, q, r and s are defined as follows:
a. ( x P( x) ) b. (y Q( y) )
c. ~ ( x P( x) ) d. ~ ( y Q( y) )
8. Determine the truth value for each of the following statements. Assume
x, y .
46
9. Construct truth tables to determine whether the given statement is a tautology,
a contingency, or an absurdity.
a. q (~ q p)
b. p → (q → p )
c. (q p) (q ~ p)
d. ( p q) → p
e. p (q ( p → r ))
10. For each pair of expressions, construct truth tables to see if the two compound
propositions are logically equivalent.
a. p → q, ~ q → ~ p
b. p q, ( p → q ) (q → p )
c. ~ ( p q), ( p ~ q) (q ~ p)
d. ~ p → (q r ), ( p q) p
e. p → q, q → p
47
TUTORAN 5: MATHEMATICAL INDUCTION
n ( 2n + 1)( 2n − 1)
12 + 32 + 52 + ... + ( 2n − 1) =
2
a.
3
5n ( n + 1)
b. 5 + 10 + 15 + ... + 5n =
2
n ( n + 1)( 2n + 1)
c. 12 + 22 + 32 + ... + n2 =
6
a −1n
d. 1 + a + a 2 + ... + a n−1 =
a −1
e. a + ar + ar + ... + ar
2 n −1
=
(
a 1− rn ) for r 1
1− r
a. Use P ( k ) to show P ( k + 1) .
b. Is P(n) true for all n 1?
n 2 ( n + 1) + 4
2
n ( n + 1)
2
6. Prove that 1.1! + 2.2! + 3.3! + ... + n.n ! = ( n + 1)! − 1 whenever n is a positive
integer.
48
7. Prove using mathematical induction that:
n ( n + 1)( n + 2 )
1.2 + 2.3 + 3.4 + ... + n ( n + 1) =
3
Whenever n is a positive integer.
8. Show that:
( −1) n ( n + 1)
n −1
1 − 2 + 3 − ... + ( −1)
n −1
2 2 2
n 2
=
2
Whenever n is a positive integer.
1 + 5 + 9 + 13 + ... + ( 4n − 3) = n ( 2n − 1) .
(2n + 1)2
12. Prove 1 + 2 + 3 + +n .
8
13. Find the least n for which the statement is true and then prove that
(1 + n 2 ) < 2n .
14. Find the least n for which the statement is true and then prove that 10n < 3n.
(n + 1)2
15. Use mathematical induction to prove that 1 + 2 + 3 + +n .
2
49