0% found this document useful (0 votes)
28 views

CS101 - Chapter4 Discrete Math

The document discusses propositional functions and quantifiers. It defines propositional functions as statements involving variables that are either true or false depending on the value assigned to the variable. It also defines universal and existential quantifiers, and provides examples to illustrate their usage.

Uploaded by

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

CS101 - Chapter4 Discrete Math

The document discusses propositional functions and quantifiers. It defines propositional functions as statements involving variables that are either true or false depending on the value assigned to the variable. It also defines universal and existential quantifiers, and provides examples to illustrate their usage.

Uploaded by

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

Free Powerpoint Templates

Page 1
Introduction
Logic that deals with propositions is
incapable of describing most of the
statements in mathematics and
computer science.
Recall that a proposition is a
statement that is either true or false,
thus, the statement:
p: n is an odd integer.
is not a proposition because whether
p is true or false depends on the
value of n. If n = 103, p is true and
false if n = 8.
Free Powerpoint Templates
Page 2
Introduction

Most of the statements in


mathematics and computer
science use variables. Thus,
we must extend the system
of logic to include such
mathematical statements.

Free Powerpoint Templates


Page 3
Domain of Discourse
Definition:
Let P(x) be a statement
involving the variable x and let
D be a set. We call P a
propositional function (with
respect to D) if for each x in D,
P(x) is a proposition. We call D
the domain of discourse of P.

Free Powerpoint Templates


Page 4
Domain of Discourse : Example
Let P(n) be the statement
n is an odd integer
and let D be the set of positive
integers.
– P is a propositional function with
domain of discourse D since for
each n in D, P(n) is a
proposition, that is, for each n in
D, P(n) is true or false but not
both.
Free Powerpoint Templates
Page 5
Domain of Discourse : Example

– If n = 1, P(1) is true, that is,


1 is an odd integer
– If n = 2, P(2) is false, that is,
2 is an odd integer
is false.

Free Powerpoint Templates


Page 6
Propositional Function
By itself, it is neither true nor false.
However, for each x in its domain
of discourse, P(x) is a proposition
and is, therefore, either true or
false.
We can think of a propositional
function as defining a class of
propositions, one for each element
of its domain of discourse.

Free Powerpoint Templates


Page 7
Propositional Function
If for example, P is a
propositional function with
domain of discourse equal to
the set of positive integers, we
obtain the class of propositions
P(1), P(2), . . . .
in which each of P(1), P(2), . . .
is either true or false.
Free Powerpoint Templates
Page 8
Examples of Propositional Function
• n2 + 2n is an odd integer

- D = set of positive integers

• x2 - x - 6 = 0

- D = set of real numbers

Free Powerpoint Templates


Page 9
Examples of Propositional Function

• The student gets a GPA of 2.0 or


better during the second semester
of SY 2002- 2003

- D = set of students

• The actress has won a FAMAS


award.

- D = set of actresses
Free Powerpoint Templates
Page 10
Universal and Existential
Quantifiers
Most of the statements in mathematics
and computer science use terms such
as "for every" and "for some." For
example in mathematics we have the
statements:
– For every triangle T, the sum of the
angles of T is equal to 180°.
– For some triangle S, the sum of two
angles is less than 90o.

Free Powerpoint Templates


Page 11
Universal Quantifiers
Definition:
Let P be a propositional function with
domain of discourse D. The statement
for every x, P(x)
is said to be a universally quantified
statement. The symbol  means "for
every." Thus the statement for every x,
P(x) may be written
x, P(x).

Free Powerpoint Templates


Page 12
Universal Quantifiers

The symbol  is called a universal


quantifier. The statement for
every x, P(x) is true if P(x) is true
for every x in D. The statement for
every x, P(x) is false if P(x) is false
for at least one x in D.

Free Powerpoint Templates


Page 13
Existential Quantifiers

Definition:
The statement
for some x, P(x)
is said to be an existentially
quantified statement. The symbol 
means "for some." Thus the statement
for some x, P(x) may be written
x, P(x).

Free Powerpoint Templates


Page 14
Existential Quantifiers

The symbol  is called an


existential quantifier. The
statement for some x, P(x) is
true if P(x) is true for at least
one x in D. The statement for
some x, P(x) is false if P(x) is
false for every x in D.

Free Powerpoint Templates


Page 15
Remarks on definition of
Quantifiers
Free or Bound Variable
– We call the variable x in the
propositional function P(x) a free
variable.
– The idea is that x is "free" to roam over
the domain of discourse.
– We call the variable x in the universally
quantified statement
x, P(x)
or in the existentially quantified
statement
x, P(x)
Free Powerpoint Templates
a bound variable . Page 16
Remarks on definition of
Quantifiers
– The idea is that x is "bound" by the
quantifier  or .
– We previously pointed out that a
propositional function does not have a
truth value. On the other hand,
quantified statements have
corresponding truth values.
– In general, a statement with free
(unquantified) variables is not a
proposition and a statement with no
free variables (no unquantified
variables) is a proposition.
Free Powerpoint Templates
Page 17
Remarks on definition of
Quantifiers
The symbol  may be read "for every,"
"for all," or "for any."
The symbol  may be read "for some,"
"for at least one," or "there exists."
Sometimes, to specify the domain of
discourse D, we write a universally
quantified statement as
for every x in D, P(x)
and we write an existentially quantified
statement as
for some x in D, P(x).
Free Powerpoint Templates
Page 18
Remarks on definition of
Quantifiers
The universally quantified statement
for every x, P(x)
is false if for at least one x in the
domain of discourse, the proposition
P(x) is false. A value x in the domain
of discourse that makes P(x) false is
called a counterexample to the
statement
for every x, P(x).
Free Powerpoint Templates
Page 19
Quantifiers : Example1

The statement for every real


number x, x2  0 is a universally
quantified statement. The domain
of discourse is the set of real
numbers. The statement is true
because, for every real number
x, it is true that the square of x is
positive or zero.

Free Powerpoint Templates


Page 20
Quantifiers : Example2
Prove that the universally quantified statement
for every real number x, if x > 1,
then x + 1 > 1
is true.

Proof:
We must verify that the statement
if x > 1, then x + 1 > 1 is true for every
real number x.
Let x be any real number
whatsoever. It is true that for any real
number x, either xFree 1Powerpoint
or x > 1. Templates
Page 21
Quantifiers : Example2
Case1: x  1
The conditional proposition
If x > 1, then x + 1 > 1 is true
because the hypothesis x > 1 is
false. (Recall that when the
hypothesis is false, the
conditional proposition is true
regardless of whether the
conclusion is true or false.)
Free Powerpoint Templates
Page 22
Quantifiers : Example 2

Case 2: x > 1
x>1→x+1>1+1>1
(API)
→ x + 1 > 1 (transitivity of >)
hence the conditional proposition
if x > 1, then x + 1 > 1 is true.

Free Powerpoint Templates


Page 23
Quantifiers : Example 2

Thus, we have shown that for every


real number x, the proposition
if x > 1, then x + 1 > 1
is true. Therefore the universally
quantified statement for every real
number x, if x > 1, then x + 1 > 1 is
true.

Free Powerpoint Templates


Page 24
Quantifiers : Example 3

The universally quantified


statement for every real number x,
x2 - 1 > 0 is false since, if x = 1,
the proposition 12 - 1 > 0 is false.
The value 1 is a counterexample
to the statement for every real
number x, x2 - 1 > 0.

Free Powerpoint Templates


Page 25
Quantifiers : Example 3

Note:
To show that the universally
quantified statement
for every x, P(x}
is false, it is sufficient to find one
value x in the domain of discourse for
which the proposition P(x} is false,
that is, it is sufficient to give a
counterexample.
Free Powerpoint Templates
Page 26
Quantifiers : Example 3

The method of disproving the statement


for every x, P(x}
is quite different from the method used to
prove that the statement is true. To prove
that
for every x, P(x}
is true, we must, in effect, examine every
value of x in the domain of discourse and
show that for every x, P(x} is true.

Free Powerpoint Templates


Page 27
Quantifiers : Example 4

The universally quantified statement


for every positive integer n,
if n is even, then n2 + n + 19 is
prime
is false.

Free Powerpoint Templates


Page 28
Quantifiers : Example 4

A counterexample is obtained by
taking n = 38. The conditional
proposition if 38 is even, then 382 + 38
+ 19 is prime is false because the
hypothesis 38 is even is true, but the
conclusion 382 + 38 + 19 is prime is
false. 382 + 38 + 19 is not prime since
it can be factored:
382 + 38 + 19 = 38  38 + 38 + 19
= 19(2  38 + 2 + 1) = 19  79.
Free Powerpoint Templates
Page 29
Quantifiers : Example 5

The existentially quantified statement


x 2
for some real number x, 2 
x 1 5
is true because it is possible to find at
least one real number x for which the
proposition
x 2
 is true.
x 1 5
2

Free Powerpoint Templates


Page 30
Quantifiers : Example 5

For example, if x = 2, we obtain the


true proposition
2 2

2 1 5
2

It is not the case that every value of


x results in a true proposition. For
example, the proposition
1 2
 is false.
1 1
2
5
Free Powerpoint Templates
Page 31
Quantifiers : Example 6
• The existentially quantified statement
for some positive integer n, if n is
prime, then n + 1, n + 2, n + 3, and
n + 4 are not prime.
is true because we can find at least
one integer n that makes this
conditional proposition true.
• For example, if n = 23, we obtain the
true proposition
if 23 is prime, then 24, 25, 26, and
27 are not prime.
Free Powerpoint Templates
Page 32
Quantifiers : Example 6

This conditional proposition is


true because both the hypothesis
“23 is prime" and the conclusion
"24, 25, 26, and 27 are not prime"
are true.

Free Powerpoint Templates


Page 33
Quantifiers : Example 6

Some values of n make the conditional


proposition
for some positive integer n, if n is
prime, then n + 1, n + 2, n + 3, and n + 4
are not prime
true (e.g., n = 23, n = 47), while others
make it false (e.g., n = 2, n = 101).

Free Powerpoint Templates


Page 34
Quantifiers : Example 6

The point is that we found one


value that makes the proposition
for some positive integer n, if n is
prime, then n + 1, n + 2, n + 3, and
n + 4 are not prime
true which makes the given
existentially quantified statement
true.

Free Powerpoint Templates


Page 35
Generalized De Morgan Laws
for Logic
Theorem:
If P is a propositional function, each
pair of propositions in (a) and (b)
has the same truth values (i.e.,
either both are true or both are
false).
(a )x, P ( x); x, P ( x)

(b)x, P ( xFree x, P (Templates


); Powerpoint x)
Page 36
Generalized De Morgan Laws
for Logic
Proof of (a):
- Suppose that the proposition x, P( x)
is true.
- Then the proposition x, P(x) is false.
- By Definition above, the proposition
x, P(x) is false precisely when P(x) is
false for at least one x in the domain of
discourse.
Free Powerpoint Templates
Page 37
Generalized De Morgan Laws
for Logic
Proof of (a):
- But if P(x) is false for at least one x in the
domain of discourse, P (x) is true for at least
one x in the domain of discourse.
- Again by definition of quantifiers, when P(x)
is true for at least one x in the domain of
discourse, the proposition x, P (x) is true. ---
Thus if the proposition x, P( x) is true, the
proposition x, P(x) is true.

Free Powerpoint Templates


Page 38
Generalized De Morgan Laws
for Logic : Example 7
 Verify that the existentially quantified statement
1
for some real no. x, 2 1
x 1
is false.
 Solution.
1
We must show that 2  1 is false for every real
1 x 1
number x. Now 2  1 is false precisely when
1 x 1
 1 1
is true. Thus, we must show that 2 1
x2 1 x 1
is true for every real number x.
Free Powerpoint Templates
Page 39
Generalized De Morgan Laws
for Logic : Example 7
 Let x be any real number whatsoever.
Since 0  x2, we may add 1 to both
sides of this inequality to obtain 1  x2
+ 1. If we divide both sides of this last
inequality by x2 + 1, we obtain

1
 1
x 1
2

Free Powerpoint Templates


Page 40
Generalized De Morgan Laws
for Logic : Example 7
1
 Therefore the statement  1 is true
x 1
2
for every real number x.
1
 Thus 1 is false for every real
x 1
2

number x. We have shown that the


existentially quantified statement
1
for some real no. x, 2 1
x 1

Free Powerpoint Templates


is false. Page 41
Generalized De Morgan Laws
for Logic : Example 7
 The example just given illustrates the use
of the Generalized de Morgan’s Law for
Logic.
 In the example, it was shown that an
existentially quantified statement
for some real number x, P(x)
can be proven false by proving that a
related universally quantified statement
for every real number x, ~P(x)
is true.
Free Powerpoint Templates
Page 42
Generalized De Morgan Laws
for Logic : Example 7
 A universally quantified proposition
generalizes the compound proposition
P1  P2  . . .  Pn (1)

in the sense that the individual propositions


P1 , P2 , . . . , Pn
are replaced by an arbitrary family P(x),
where x is a member of the domain of
discourse, and (1) is replaced by
for every x, P(x)
Free Powerpoint Templates
(2)
Page 43
Generalized De Morgan Laws
for Logic : Example 7

 The proposition (1) is true if and only


if Pi is true for every i = 1, . . . , n.
 The truth value of proposition (2) is
defined similarly, that is (2) is true if
and only if P(x) is true for every x in
the domain of discourse.

Free Powerpoint Templates


Page 44
Generalized De Morgan Laws
for Logic : Example 7
 Similarly, an existentially quantified
proposition generalizes the compound
proposition
P1  P2  . . .  Pn (3)
in the sense that the individual propositions
P1  P2  . . .  Pn
are replaced by an arbitrary family P(x),
where x is a member of the domain of
discourse, and (3) is replaced by
for some x, P(x).
Free Powerpoint Templates
Page 45
Generalized De Morgan Laws
for Logic : Example 7
 The preceding observations explain how the
above theorem generalizes De Morgan's laws for
logic (Law 2.5). Recall that the first De Morgan
law for logic states that the propositions
P1  P2  ...  Pn andP1  P 2  ...  P n
have the same truth values.
 In the above theorem part (b),
P1  P 2  ...  P n x, P ( x)
is replaced by
and P1  P2  ...  Pn is replaced by x, P ( x).
Free Powerpoint Templates
Page 46
GDML : Example 8
Statements in words often have more
than one possible interpretation.
Consider the well-known quotation
from Shakespeare
All that glitters is not gold.
One possible interpretation of this
quotation is:
Nothing that glitters is gold
(i.e., a gold object never glitters).
Free Powerpoint Templates
Page 47
GDML : Example 8

However, this is surely not what


Shakespeare intended.
The correct interpretation is:
Not all that glitters is gold or
Something that glitters is not gold.

Free Powerpoint Templates


Page 48
GDML : Example 8
If we let P(x) be the propositional
function "x glitters" and Q(x) be the
propositional function "x is gold,"
the first interpretation becomes
x,( x)  Q( x)
for all P
and the second interpretation
becomes
x,( x)  Q ( x)
for all P

Free Powerpoint Templates


Page 49
GDML : Example 8
From Chapter 2 [Law 2.4], we have
seen that
p  q  ~p  q  ~(p  q)  ~(~p  q)
 ~(p  q)  p 
~q.
Hence, the truth values of the
propositional function
P( x)  Q( x)
for some x,Px   Q(x) and
for some x, are the
same. Free Powerpoint Templates
Page 50
GDML : Example 8
Using the Generalized De Morgan
Laws for Logic, the truth values of
for some xP,x   Q(x) and
for all x, P ( x)  Q( x) are
the same.

Thus an equivalent way to represent


the second interpretation is
.
for all x, P ( x)  Q( x)
Free Powerpoint Templates
Page 51
GDML : Example 8
Comparing the symbolic
representations of the two
interpretations, we see that the
ambiguity results from whether the
negation applies to Q(x) (the first
interpretation) or to the entire
statement
for all x, P(x) → Q(x)

(the second interpretation).

Free Powerpoint Templates


Page 52
A Generalization

For positive statements, the words


"any," "all," "each," and "every"
have the same meaning.

Free Powerpoint Templates


Page 53
A Generalization
In negative statements, the situation changes.
The statements
Not all C1 is C2
Not each C1 is C2
Not every C1 is C2
are considered to have the same meaning as
Some C1 is not C2.
whereas Not any C1 is C2
means No C1 is C2 .

Free Powerpoint Templates


Page 54
GDML : Example 9
Suppose that the domain of discourse
is the set of real numbers.
Consider the statement
for every x, for some y, x + y = 0.
The meaning of this statement is that
for any x whatsoever, there is at least
one y, which may depend on the choice
of x, such that x + y = 0.
We can show that the statement
for every x, for some y, x + y = 0
is true.
Free Powerpoint Templates
Page 55
GDML : Example 9
For any x, we can find at least one y,
namely y = - x, such that x + y = 0 is true.
Suppose that we revise the above
statement to read
for some y, for every x, x + y = 0.
If this statement is true, then it is possible
to select some value of y such that the
statement
for every x, x + y = 0
is true.

Free Powerpoint Templates


Page 56
GDML : Example 9

However, we can disprove this last


statement with a counterexample.
For example, we might take x = 1 – y.
We then obtain the false statement
1 – y + y = 0.
Therefore the statement
for some y, for every x, x + y = 0
is false.

Free Powerpoint Templates


Page 57
GDML : Example 10
Let P(x, y) be the statement
if x2 < y2, then x < y.
This statement has its domain of discourse
the set of real numbers.
Now, the statement
for every x, for every y, P(x, y)
is false.
A counterexample is x = 1, y = -2. In this
case, we obtain the false proposition
if 12 < (-2) 2, then 1 < -2.
Free Powerpoint Templates
Page 58
GDML : Example 10
The statement
for every x, for some y, P(x, y)
is true.
To prove this, we need to show that for
every x, the proposition
for some y, if x2 < y2, then x < y
is true by exhibiting a value of y for
which
if x2 < y2, then x < y is true.
Free Powerpoint Templates
Page 59
GDML : Example 10

Indeed, if we set y = 0, we obtain


the true proposition
if x2 < 0, then x < 0.
The conditional proposition is
true, because the hypothesis
x2 < 0 is false.

Free Powerpoint Templates


Page 60
GDML : Example 10
The statement
for every y, for some x, P(x,
y) is true.
To justify this, we show that for
every y, the proposition
for some x, if x2 < y2, then x <
y
is true by exhibiting a value of x for
which
if x2 < y2, then x < y is true.
Free Powerpoint Templates
Page 61
GDML : Example 10

Indeed, if we set x = |y| + 1, we


obtain the true proposition
if (|y| + 1)2 < y2, then |y| + 1 < y.
The conditional proposition is true,
because the hypothesis is false.

Free Powerpoint Templates


Page 62
Rule 1: Proving / Disproving
quantified statements
To prove that the universally
quantified statement
for every x, P(x)
is true, show that for every x in the
domain of discourse, the proposition
P(x) is true.
Showing that P(x) is true for a
particular value x does not prove that
for every x, P(x)
is true. Free Powerpoint Templates
Page 63
Rule 2: Proving / Disproving
quantified statements
To prove that the existentially
quantified statement
for some x, P(x)
is true, find one value of x in the
domain of discourse for which P(x)
is true.
One value suffices.

Free Powerpoint Templates


Page 64
Rule 3 : Proving/Disproving
quantified statements
To prove that the universally
quantified statement
for every x, P(x)
is false, find one value of x (a
counterexample) in the
domain of discourse for which
P(x) is false.
Free Powerpoint Templates
Page 65
Rule 4: Proving/Disproving
quantified statements
To prove that the existentially quantified
statement
for some x, P(x)
is false, show that for every x in the domain
of discourse, the proposition P(x) is false.
Showing that P(x) is false for a particular
value of x does not prove that
for some x, P(x)
is false. Free Powerpoint Templates
Page 66
Free Powerpoint Templates
Page 67
Free Powerpoint Templates
Page 68
Mathematical System
 A mathematical system consists of
axioms, definitions, and undefined terms.
 Axioms are assumed true.
 Definitions are used to create new
concepts in terms of existing ones .
 Theorem is a proposition that has been
proved to be true. Special kinds of
theorems are referred to as lemmas and
corollaries.

Free Powerpoint Templates


Page 69
Mathematical System
 Special kinds of theorems are
referred to as lemmas and
corollaries.
-- A lemma is a theorem that is
usually not too interesting in its own
right but is useful in proving another
theorem.
-- A corollary is a theorem that
follows quickly from another theorem.
 Proof is an argument that
establishes the truth of a theorem.
Free Powerpoint Templates
Page 70
Example 1
 Euclidean geometry is an example of
a mathematical system. Among the
axioms are:
1. Given two distinct points, there is
exactly one line that contains them.
2. Given a line and a point not on the
line, there is exactly one line parallel
to the line through the point.

Free Powerpoint Templates


Page 71
Example 1

 The terms point and line are


undefined terms that are
implicitly defined by the
axioms that describe their
properties.

Free Powerpoint Templates


Page 72
Among the definitions in this
system are:
 Two triangles are congruent if
their vertices can be paired so
that the corresponding sides and
corresponding angles are equal.
 Two angles are supplementary if
the sum of their measures is
180°.

Free Powerpoint Templates


Page 73
Examples of theorems in this
system are:
• If two sides of a triangle are
equal, then the angles opposite
them are equal.
• If the diagonals of a quadrilateral
bisect each other, then the
quadrilateral is a parallelogram.

Free Powerpoint Templates


Page 74
An example of a corollary in
Euclidean geometry is
 If a triangle is equilateral, then it is
equiangular.

-- This corollary follows immediately


from the first theorem given above
for this example.

Free Powerpoint Templates


Page 75
Free Powerpoint Templates
Page 76
Direct Proof

Theorems are often of the form


For all x1, x2, . . . , xn, if p(x1,
x2, . . . ,xn), then q(x1, x2, . . . , xn).
This universally quantified statement
is true provided that the conditional
proposition
if p(x1, x2, . . . , xn),
then q(x1, x2, . . ., xn) (*)

Free Powerpoint Templates


Page 77
Direct Proof
is true for all x1, x2, . . . , xn in the
domain of discourse. To prove (*),
we assume that x1, x2, . . . , xn are
arbitrary members of the domain of
discourse. If p(x1, x2, . . . , xn) is
false, by definition of the truth
value for implication, (*) is true.
Thus, we need only consider the
case that p(x1, x2, . . . , xn) is true.
Free Powerpoint Templates
Page 78
Direct Proof
A direct proof assumes that
p(x1, x2, . . . , xn) is true and then,
using p(x1, x2, . . . , xn) as well as
other axioms, definitions, and
previously derived theorems,
shows directly that q(x1, x2, . . . ,
xn) is true.

Free Powerpoint Templates


Page 79
Example
For all real numbers d, d1, d2, and x, prove
that
If d = min {d1, d2} and x  d, then x  d1 and x 
d2 .
Proof.
Assume that d, d1, d2, and x are arbitrary real
numbers. Then it suffices to assume that
d = min { d1, d2} and x  d
is true and then show that
x  d1 and x  d2
is also true.

Free Powerpoint Templates


Page 80
Example
From the definition of min, it
follows that d  d1 and d  d2. From
x  d and d  d1, we may derive x
 d1 from a theorem on real
numbers (Transitive Property of
Inequality). From x  d and d  d2,
we may derive x  d2 for the same
reason. Therefore, x  d1 and x 
d2.
Free Powerpoint Templates
Page 81
Free Powerpoint Templates
Page 82
Proof by contradiction
A proof by contradiction establishes
the proposition
if p(x1, x2, . . . , xn),
then q(x1, x2, . . . , xn) (*)
by assuming that the hypothesis p is
true and that the conclusion q is false
and then, using p and as well as
other axioms, definitions, and
previously derived theorems, derives
a contradiction.
Free Powerpoint Templates
Page 83

r

Contradiction
A contradiction is a proposition of
the form r Λ ~ r (r may be any
proposition whatever).
A proof by contradiction is
sometimes called an indirect proof
since to establish (*) using proof by
contradiction, one follows an indirect
route: derive r , then conclude that
(*) is true.

Free Powerpoint Templates


Page 84
Contradiction
The only difference between the
assumptions in a direct proof and
a proof by contradiction is the
negated conclusion.
In a direct proof the negated
conclusion is not assumed,
whereas in a proof by
contradiction the negated
conclusion is assumed.

Free Powerpoint Templates


Page 85
Contradiction
Proof by contradiction may be justified
by noting that the propositions
pq
and
pqrr
are equivalent. The equivalence is
immediate from the following truth table.

Free Powerpoint Templates


Page 86
Contradiction
p q r pq p ~ q r  ~ r pqrr
T T T T F F T
T T F T F F T
T F T F T F F
T F F F T F F
F T T T F F T
F T F T F F T
F F T T F F T
F F F T F F T

Free Powerpoint Templates


Page 87
Example
Prove, by contradiction, the following statement:
For all real numbers x and y, if x + y  2,
then either x  1 or y  1.
Proof.
Suppose that the conclusion is false. Then, x <
1 and y < 1. (Remember that negating an or
results in an and (De Morgan’s laws for logic).
From the properties of inequality in Algebra, we
may add these inequalities to obtain
x + y < 2.

Free Powerpoint Templates


Page 88
Example
At this point, we have derived the
contradiction p , where
p: x + y  2.
Thus we conclude that the
statement is true.
Suppose that we give a proof by
contradiction of (*) in which, as in the
above example, we deduce . In effect, we
have proved.
q p (1.4.2)
This special case of proof by contradiction
is called proof by contrapositive.
Free Powerpoint Templates
Page 89
Free Powerpoint Templates
Page 90
Deductive Reasoning

In constructing a proof, we must


be sure that the arguments used
are valid. In this section we make
precise the concept of a valid
argument and explore this concept
in some detail.

Free Powerpoint Templates


Page 91
Deductive Reasoning
 Consider the following sequence of propositions.
The bug is either in module 17 or in module 81.
The bug is a numerical error.
Module 81 has no numerical error. (1)
 Assuming these statements are true, it is
reasonable to conclude:
The bug is in module 17.
(2)

Free Powerpoint Templates


Page 92
Deductive Reasoning
 This process of drawing a conclusion from
a sequence of proposition is called
deductive reasoning.
 The given propositions, such as (1), are
called hypotheses or premises.
 The proposition that follows from the
hypotheses, like (2), is called the
conclusion.
 A (deductive) argument consists of
hypotheses together with a conclusion.
Many proofs in mathematics and computer
science are deductive arguments.

Free Powerpoint Templates


Page 93
Deductive Reasoning
 Any argument has the form
If p1 and p2 and . . . and pn, then q. (3)
 Argument (3) is said to be valid if the
conclusion follows from the hypotheses:
that is, if p1 and p2 and . . . and pn are
true, then q must also be true. This
discussion motivates the following
definition.

Free Powerpoint Templates


Page 94
Deductive Reasoning
 An argument is a sequence of
propositions written
p1
p2
:
pn or
q
p1 and p2 , . . . , pn /

Free Powerpoint Templates


Page 95
Deductive Reasoning
 The propositions p1 and p2 , . . . ,
pn are called the hypotheses (or
premises) and the proposition q is
called the conclusion.
 The argument is valid provided
that if p1 and p2 and p3. . . and pn
are all true, then q must also be
true; otherwise, the argument is
invalid (or a fallacy).

Free Powerpoint Templates


Page 96
Deductive Reasoning
 In a valid argument, we sometimes
say that the conclusion follows from
the hypotheses. Notice that we are
not saying that the conclusion is
true; we are only saying that if you
grant the hypotheses, you must
also grant the conclusion. An
argument is valid because of its
form, not because of its content.
Free Powerpoint Templates
Page 97
Example 1

 Determine whether the argument

pq
p
q
is valid.

Free Powerpoint Templates


Page 98
Example 1
 [First solution.] We construct a truth table
for all the propositions involved:

p q pq p q

T T T T T

T F F T F

F T T F T

F F T F F

Free Powerpoint Templates


Page 99
Example 1
We observe that whenever the
hypotheses p q and p are true, the
conclusion q is also true; therefore, the
argument is valid.
 [Second solution.] We can avoid writing
the truth table by directly verifying that
whenever the hypotheses are true, the
conclusion is also true.
Suppose that p q and p are true. Then q
must be true, for otherwise p q would be
false. Therefore, the argument is valid.
Free Powerpoint Templates
Page 100
Example 2
Represent the argument
If 2 = 3, then I ate my hat.
I ate my hat.
 2=3

symbolically and determine whether the


argument is valid.

Free Powerpoint Templates


Page 101
Example 2

Solution.
If we let
p: 2 =3, q: I ate my hat.
the argument may be written

pq
q
p

Free Powerpoint Templates


Page 102
Example 2

If the argument is valid, then


whenever p  q and q are both
true, p must also be true. Suppose
that p  q and q are true. This is
possible if p is false and q is true. In
this case, p is not true; thus the
argument is invalid.

Free Powerpoint Templates


Page 103
Example 2

We can also determine the


validity of the argument in this
example by examining the truth
table of Example 1. In the third
row of the table, the hypotheses
are true and the conclusion is
false; thus the argument is
invalid.
Free Powerpoint Templates
Page 104
Example 2
If arguments contain more than
two or three different simple
statement as components, it is
cumbersome and tedious to use
truth tables to test their validity. A
more convenient method of
establishing the validity of some
arguments is to construct a formal
proof of validity.

Free Powerpoint Templates


Page 105
Formal proof of validity

A formal proof of validity for a given


argument is defined to be a sequence
of statements, each of which is either a
premise of that argument or follows
from preceding statements by an
elementary valid argument, and such
that the last statement in the sequence
is the conclusion of the argument
whose validity is being proved. This
definition must be completed and made
definite by specifying what is to count
as an elementary valid argument.
Free Powerpoint Templates
Page 106
Elementary valid argument

An elementary valid argument


is any argument that is a
substitution instance of an
elementary valid argument
form.

Free Powerpoint Templates


Page 107
Rules of Inference
The following list of argument forms
are regarded as elementary valid
argument forms and are considered
as the Rules of Inference.

1. Modus Ponens (M.P.) pq


p
q

Free Powerpoint Templates


Page 108
Rules of Inference

2. Modus Tollens 3. Hypothetical


(M.T.) Syllogism (H.S.)

pq pq
~q qr
~ p pr

Free Powerpoint Templates


Page 109
Rules of Inference

4. Disjunctive 5. Conditional Proof


Syllogism (D.S.)

pq pq
~p p  q  r 
q r

Free Powerpoint Templates


Page 110
Rules of Inference
6. Proof by Cases
pr
qr
 p  q  r

7. Destructive Dilemma (D.D.)

( p  q)  (r  s)
~ q ~ s
~ p  ~FreerPowerpoint Templates
Page 111
Rules of Inference
8. Constructive Dilemma (C.D.)

( p  q)  (r  s)
pr
q  s
9. Simplification (Simp.)
pq
p
Free Powerpoint Templates
Page 112
Rules of Inference
10. Conjunction (Conj.)
p
q
pq
11. Addition (Add.)

p
pq Free Powerpoint Templates
Page 113
Rules of Inference
These eleven Rules of Inference are
elementary valid argument forms,
whose validity is easily established by
truth tables. They can be used to
construct formal proofs of validity for a
wide range of more complicated
arguments. The names listed are
standard for the most part, and the use
of their abbreviations permits formal
proofs to be set down with a minimum of
writing.

Free Powerpoint Templates


Page 114
Example 3
Establish the validity of the following
arguments:
Either the Attorney General has imposed
a strict censorship or if Black mailed
the letter then Davis received a
warning.
If our lines of communication have not
broken down completely, then if Davis
received a warning then Emory was
informed about the matter.
Free Powerpoint Templates
Page 115
Example 3
If the Attorney General has imposed
a strict censorship, then our lines
of communication have broken
down completely.
Our lines of communication have not
broken down completely.
Therefore, if Black mailed the letter,
then Emory was informed about the
matter.

Free Powerpoint Templates


Page 116
Example 3

Solution:
Symbolically, the above arguments may
be written as:
A  ( B  D)
~ C  (D  E)
AC
~C
B  E
Free Powerpoint Templates
Page 117
Example 3
where
A: Attorney General imposes a strict
censorship.
B: Black mails the letter.
C: Our lines of communication
breaks down completely.
D: Davis receives a warning.
E: Emory was informed about the
matter.
Free Powerpoint Templates
Page 118
Example 3
To establish the validity of this
argument by means of a truth table
would require a table with thirty-two
rows. We can prove the given
argument valid, however, by
deducing its conclusion from its
premises by a sequence of just four
arguments whose validity has
already been established.
Free Powerpoint Templates
Page 119
Example 3

o From the third and fourth premises,


A  C and ~ C, we validly infer ~ A
by Modus Tollens.
o From ~ A and the first premises, A
v (B  D), we validly infer B  D
by a Disjunctive Syllogism.

Free Powerpoint Templates


Page 120
Example 3
o From the second and fourth
premises, ~ C  (D  E)
and ~ C, we validly infer D  E
by Modus Ponens.
o And finally, from these last two
conclusions (or subconclusions),
B  D and D  E, we validly
infer B  E by a Hypothetical
Syllogism.

Free Powerpoint Templates


Page 121
Example 3
o That its conclusion can be deduced
from its premises using valid
arguments exclusively, proves the
original argument to be valid.
o Here the elementary valid argument
forms Modus Ponens (M.P.), Modus
Tollens (M.T.), Disjunctive Syllogism
(D.S.), and Hypothetical Syllogism
(H.S.) are used as Rules of Inference
by which conclusions are validly
deduced from premises.

Free Powerpoint Templates


Page 122
o A more formal and more concise way
of writing out this proof of validity is to
list the premises and the statements
deduced from them in one column, with
“justifications” for the latter written
beside them. In each case the
“justifications” for a statement specifies
the preceding statements from which,
and the Rule of Inference by which, the
statements in question was deduced. It
is convenient to put the conclusion to
the right of the last premise, separated
from it by a slanting line which
automatically marks all of the
statements above it to be premises.
Free Powerpoint Templates
Page 123
Example 3
The formal proof of validity for the given argument can be written as
follows:

1.A v (B  D)
2. ~ C  (D  E)
3. A  C
4. ~ C /B  E
5. ~ A 3, 4, M.T.
6. B  D 1, 5, D.S.
7. D  E 2, 4, M.P.
8. B  E 6, 7, H.S.
Free Powerpoint Templates
Page 124
Example 3
One matter that needs to be emphasized here
is that any substitution instance of an
elementary valid argument form is an
elementary valid argument. Thus the
argument
~ C  (D  E)
~C
DE

Free Powerpoint Templates


Page 125
Example 3

is an elementary valid argument


because it is a substitution instance
of the elementary valid argument
form Modus Ponens (M.P.). It
results from
pq
p
q

Free Powerpoint Templates


Page 126
Example 3

by substituting ~C for p and D  E for


q; therefore, it is of that form even
though Modus Ponens is not the
specific form of the given argument.

Free Powerpoint Templates


Page 127
Rule of Replacement
There are many valid truth-functional
arguments that cannot be proved valid
using only the nine Rules of Inference.
However, if we can replace any part of a
compound statement by an expression
that is logically equivalent to the part
replaced, the truth value of the resulting
statement is the same as that of the
original statement. This is sometimes
called the Rule of Replacement or the
Principle of Extensionality.

Free Powerpoint Templates


Page 128
Rule of Replacement

Using this rule we can employ the


laws of logic that we have seen in
Chapter 2 to replace all or part of
a statement with a logically
equivalent statement without
changing the truth value of the
original statement.

Free Powerpoint Templates


Page 129
Rule of Replacement
Let us recall some of the commonly
used laws and introduce a few new
ones. We also write down their
names and abbreviations for ease
in writing justifications for our
proofs. These logically equivalent
expressions can replace each other
wherever they occur. We number
them consecutively after the first
eleven rules already stated.

Free Powerpoint Templates


Page 130
Rule of Replacement

12. De Morgan’s Laws (De M.)


~(p  q)  (~p  ~q)
~(p  q)  (~p  ~q)
13. Commutation (Com.)
pqqp
pqqp

Free Powerpoint Templates


Page 131
Rule of Replacement

14. Association (Assoc.)


p  (q  r)  (p  q)  r
p  (q  r)  (p  q)  r

15. Distribution (Dist.)


p  (q  r)  (p  q)  (p  r)
p  (q  r)  (p  q)  (p  r)

Free Powerpoint Templates


Page 132
Rule of Replacement

16. Double Negation (D.N.)


p  ~~p
17. Transportation (Trans.)
p  q  ~q  ~p
18. Material Implication (Impl.)
p  q  ~p  q

Free Powerpoint Templates


Page 133
Rule of Replacement

19. Material Equivalence (Equiv.)


p  q  ( p  q)  ( q  p)
p  q  (p  q)  (~p  ~q)
20. Exportation (Exp.)
( p  q)  r  p  ( q  r )
21. Tautology (Taut.)
ppp
ppp

Free Powerpoint Templates


Page 134
Example 4
Example 3 can also be solved using rule of
replacement for some steps as follows:
1. A v (B  D)
2. ~ C  (D  E)
3. A  C
4. ~ C /B  E
5. ~ A 3, 4, M.T.
6. B  D 1, 5, D.S.
7. ~~ C  (D  E) 2, Impl.
8. D  E 7, 4, D.S.
9. B  E 6, 8, H.S.

Free Powerpoint Templates


Page 135
Free Powerpoint Templates
Page 136
Axioms of Peano Arithmetic
1 is a natural number
If x is a natural number, then x + 1 is also
a natural number
There is no natural number, Z, such that
Z + 1 = 0.
Given natural numbers x and y, if x + 1 =
y + 1, then x = y.
If one can prove that if a property holds
for some natural number x then it holds
for x + 1, and if it can further be proven
that the same property holds for 1, then
the property holds for all natural numbers.
Free Powerpoint Templates
Page 137
Principle of Mathematical
Induction
Suppose that for each positive integer n
we have a statement S(n) that is either
true or false. Suppose that
S(1) is true; and (1)
if S(i) is true, for all i  n, then S(n + 1)
is true. (2)
Then S(n) is true for every positive
integer n.
Condition (1) is sometimes called the
Basis Step and condition (2) is
sometimes called the Inductive Step.
Free Powerpoint Templates
Page 138
Some Remarks on the
Principle of Mathematical Induction
The axiom allows us to prove that a
certain property holds for all natural
numbers.
The idea is that, in order to prove
that a formula (or theorem) about
natural numbers is true for all
natural numbers, we first verify (by
actual substitution) that the formula
is true for the number 1.
Free Powerpoint Templates
Page 139
Some Remarks on the
Principle of Mathematical Induction

Then, we prove that whenever the


formula is true for a natural number
n, it must also be true for n + 1.
Since it was verified to be true for 1,
then it had to be true for 2; and
since it was true for 2, it had to be
true for 3, and so on for all natural
numbers.
Free Powerpoint Templates
Page 140
Principle of Mathematical
Induction: Example 1
Prove by mathematical induction that
n
n(n  1)

i 1
i
2
Solution.
Let Sn denote the sum of the first n positive
integers
Sn = =1 + 2 + 3 + . . . + n.

Here, a sequence of statements is actually being


made, 1(2)
namely, 2(3)
S1  1  S2  1  2  3
2 2
3(4)
S3  1  2  3  6
2 Free Powerpoint Templates Page 141
Principle of Mathematical
Induction: Example 1
The formula is true for the first 3 natural numbers.
Assuming that all of the equations preceding the
(n + 1)st equation are true, then, in particular,
the nth equation is true, that is,
n(n  1)
S n  1  2  3  ...  n 
2
We must show that the (n + 1)st equation
(n  1)(n  2)
S n 1 
2
is true. Take note that

Sn+1 = 1 + 2, + . . . + n + (n + 1).

Free Powerpoint Templates


Page 142
Principle of Mathematical
Induction: Example 2
Use mathematical induction to show that
n!  2n-1 for n = 1, 2, . . . .
Proof:
Basis Step. We must show that the inequality is
true if n = 1. This is easily accomplished, since
1! = 1  1 = 21-1.
Inductive Step. We must show that if i !  2i-1 for
i = 1, . . . , n, then
(n + 1)!  2n.

Free Powerpoint Templates


Page 143
Principle of Mathematical
Induction: Example 2
To show that if i !  2i-1 for
i = 1, . . . , n, then (n + 1)!  2n
we assume that i!  2i-1 for i = 1, . . . , n. Then, in particular,
for i = n, we have n!  2n-1.

We can relate the 2 inequalities above by observing that


(n + 1)! = (n + 1)(n!).
Now
(n + 1)! = (n + 1)(n!)
 (n + 1)2n-1
 2 . 2n-1 since n + 1  2
= 2n. Templates
Free Powerpoint
Page 144
Principle of Mathematical
Induction: Example 2
Since we have shown that if i !  2i-1 for
i = 1, . . . , n, then (n + 1)!  2n

therefore, n!  2n-1 for n = 1, 2, . . . . is true.


We have completed the Inductive Step.
Since the Basis Step and the Inductive Step
have been verified, the Principle of
Mathematical Induction tells us that n!  2n-1 is
true for every positive integer n.
Free Powerpoint Templates
Page 145
Strong Form of Mathematical
Induction
The verification of the Inductive Step where
we assume that S (i ) is true for all i < n + 1
and then prove that S (n + 1) is true.
This formulation of mathematical induction is
called strong form of mathematical induction.
Often, as was the case in the preceding
examples, we can deduce S (n + 1)
assuming only S (n ).
indeed, the Inductive Step is often stated:

If S (n) is true, then S (n + 1) is true.


Free Powerpoint Templates
Page 146
Principle of Mathematical
Induction: Example 3
Use induction to show that if r  1,
n 1
a (r  1)
a  ar  ar  ...  ar 
1 2 n

r 1
for n = 0, 1, . . . .
The sum on the left is called a geometric
sum. In a geometric sum, the ratio of
consecutive terms (ar i + 1/ar i = r) is constant.
Proof:
Basis Step. The Basis Step, which in this
case is obtained by setting n = 0, is
which is true.
Free Powerpoint Templates
Page 147
Principle of Mathematical
Induction: Example 3
Inductive Step . Assume that statement is
true for n. Now,
n 1
n 1 a ( r  1)
a  ar  ar  ...  ar  ar 
1 2 n
 ar n 1
r 1

a (r n 1  1) ar n 1 (r  1)
 
r 1 r 1
a (r n  2  1)

r 1
Free Powerpoint Templates
Page 148
Principle of Mathematical
Induction: Example 3
Since the modified Basis Step and the
Inductive step have been verified, the
Principle of Mathematical Induction tells
us that
n 1
a ( r  1)
a  ar  ar  ...  ar 
1 2 n

r 1

is true for n = 0, 1, …

Free Powerpoint Templates


Page 149
Principle of Mathematical
Induction: Example 3
As an example of the use of the
geometric sum, if we take a = 1 and
r = 2 in the above expression, we
obtain the formula
n 1
2 1 n 1
1  2  2  2  ...  2 
2 3 n
 2  1.
2 1

Free Powerpoint Templates


Page 150
Principle of Mathematical
Induction: Example 3
The reader has surely noticed that in order
to prove the previous formulas one has to
be given the correct formulas in advance. A
reasonable question is: How does one
come up with the formulas? There are
many answers to this question. One
technique to derive a formula is to
experiment with small values and try to
discover a pattern. For example, consider
the sum 1 + 3 + . . . + (2n - 1). The
following table gives the values of this sum
for n = 1, 2, 3, 4.
Free Powerpoint Templates
Page 151
Principle of Mathematical
Induction: Example 3
n 1 + 3 + . . . + (2n –1)
1 1
2 4
3 9
4 16

Since the second column consists of squares, we conjecture


that
1 + 3 + . . . + (2n - 1) = n2
for every positive integer n.
The conjecture is correct and the formula can be proved by
mathematical induction Free
(seePowerpoint
ExerciseTemplates
Set 3.4 #1). Page 152
Principle of Mathematical
Induction: Example 4
Use induction to show that 5n - 1 is divisible by 4 for n
= 1, 2, . . . .
Proof:
Basis Step.
If n = 1, 5n - 1 = 51 - 1 = 4, which is divisible by 4.
Note that also 4 = 50 - 1 + 4  50
If n = 2, 52 - 1 = 25 - 1 = 24, which is divisible by 4.
Also 24 = 51 - 1 + 4  51

Free Powerpoint Templates


Page 153
Principle of Mathematical
Induction: Example 4
If n = 3, 53 - 1 = 125 - 1 = 124, which is
divisible by 4.
Again 124 = 52 - 1 + 4  52
:
:
If we look at the pattern, we can say that
5 n - 1 = 5 n-1 - 1 + 4  5 n-1.

Free Powerpoint Templates


Page 154
Principle of Mathematical
Induction: Example 4
Inductive Step.
Assume that 5n - 1 is divisible by 4
and that the above formula holds. We
must show that 5n+1 - 1 is divisible by
4. To relate the (n + 1)st case to the
nth case, we write
5 n+1 - 1 = (5 n - 1) + 4 . 5 n.

Free Powerpoint Templates


Page 155
Principle of Mathematical
Induction: Example 4
By assumption, 5 n - 1 is divisible by 4
and, since 4 . 5 n is divisible by 4, the
sum
(5 n - 1) + 4. 5 n = 5 n+1 - 1
is divisible by 4. Since the Basis Step
and the Inductive Step have been
verified, the Principle of Mathematical
Induction tells us that 5n - 1 is
divisible by 4 for n = 1, 2, . . .
Free Powerpoint Templates
Page 156
Principle of Mathematical
Induction: Example 5
For any set X with n elements, the
cardinality of the power set of X has 2n
elements, that is, n((X)) = 2n. Or
if |X| = n, then |(X)| = 2n
Proof. The proof is by induction on n.
Basis Step. If n = 0, X is the empty set.
The only subset of the empty set is the
empty set itself; thus
(X)  = 1 = 20 = 2n.
Thus the formula is true for n = 0.
Free Powerpoint Templates
Page 157
Principle of Mathematical
Induction: Example 5
Inductive Step. Assume that formula holds
for n. Let X be a set with X= n + 1.
Choose x  X. We divide (X) into two
classes. The first class consists of those
subsets of X that include x, and the second
class consists of those subsets of X that do
not include x. If we list the subsets of X that
do not include x,
X1, X2, . . . , Xk ,
then
Free Powerpoint Templates
Page 158
Principle of Mathematical
Induction: Example 5
X1  {x}, X2  {x}, . . . , Xk  {x}
is a list of the subsets of X that do
include x. Thus the number of subsets
of X that include x is equal to the
number of subsets of X that do not
include x. If Y = X – {x}, (Y) consists
precisely of those subsets of X that do
not include x. Thus (X)= 2(Y).
Since Y = n, by the inductive
assumption, (Y)= 2n.
Free Powerpoint Templates
Page 159
Principle of Mathematical
Induction: Example 5

Therefore,
(X) = 2(Y)= 2  2n =
2n+1.
Thus the formula holds for n + 1 and
the inductive step is complete. By the
Principle of Mathematical Induction,
Law 3.6.2 holds for all n  0.

Free Powerpoint Templates


Page 160

You might also like