You are on page 1of 56

Discrete Mathematics

Quantifiers
Logic using propositions are incapable of
describing most of the statements in
mathematics and computer science
such as the use of variables
Quantification
• Predicate – relationship between objects
Examples:
x<3 x>y x + y < 25

• Atomic formula - a formula for which the


terms do not involve any of the logical
operations (and, or, Implications, biconditional,
negation), but propositional letters and
constants from the universal set.
Example: P(x,y), Q(x1,x2)
Examples of Predicates
• let P(x,y,z) denotes “ x + y = z”

• let Q(x1,x2) denotes “x1 – x2  0”

• let M(x,y) denotes “x is married to y”

• let E(x,y) denote “x = y”

Note:
P(x,y,z), Q(x1,x2), M(x,y), and E(x,y)
are atomic formulas
Quantifiers
• Definition:
Let P(x) be a statement (predicate) involving x
and let D be a set.

P is a propositional function with respect to D


P(x) is a proposition
D is the domain of discourse of P.
Examples:
1. n2 + 2n is an odd number
(D = set of odd numbers)
2. x2 – x – 6 = 0 (D = 3, -2)
Universal quantifier
• Universally quantified statement:
x, P(x)
where:
 - universal quantifier P(x) – proposition
which means:
• For every x, P(x) • For all x, P(x)
• For any x, P(x)
• x, P(x) is true if P(x) is true for every x in D;
x, P(x) is false if P(x) is false for at least one
x in D.
Existential quantifier
• Existentially quantified statement:
x, P(x)
where:
 - existential quantifier P(x) – proposition
which means:
• For some x, P(x) • There exists x, P(x)
• For at least one x, P(x)

• x, P(x) is true if P(x) is true for at least one x in D;


• x, P(x) is false if P(x) is false for every x in D.
Examples of Quantification
• Validate the ff. quantified statements:
1. for every real number x, x2  0
2. for every real number x,
if x > 1 then x + 1 > 1
3. for every real number x, x2 -1 0
4. for every positive integer n,
if n is even then n2 + n + 19 is prime
5. for some real number x, x = 2
x2 + 1 5
Examples of Quantification
• Validate the ff. quantified statements:
6. for every real number x, x = 2
x2 + 1 5
7. for some positive integer n, if n is prime then
n+ 1, n+ 2, n+3, and n+4 are not prime
8. For some real number x, x >1
x2 + 1
9. for every real number x, for every real number
y, if x2 + y2 then x < y.
10. for every real number x, for some real number
y, if x2 + y2 then x < y.
Assignment
• Determine the truth value of each statement. The
domain of discourse is the set of real numbers:
1. for every x, x2 > x
2. for some x, x2 > x
3. for every x, if x > 1 then x2 > x
4. for every x, if x > 1 then x < 1
x2 + 1 3
5. for every x, for every y, x2 < y + 1
6. for every x, for every y, x2 + y2 = 9
7. for every x, for some y, x2 + y2  0
Assignment (cont.)
• Determine the truth value of each statement. The
domain of discourse is the set of real numbers:

8. for every x, for every y, if x < y then x2 < y2


9. for every x, for some y, if x < y then x2 = y2
10. for every x, for every y, if x = y then x2 = y2
Multiple Quantifiers
• You can have multiple quantifiers on a
statement

• xy P(x, y)
– “For all x, there exists a y such that P(x,y)”

• xy P(x,y)
– There exists an x such that for all y P(x,y) is true”
Negation and Quantification
• Consider:
~ (x (P(x) ) )
- means, there does not exist even one x in
the universal set that makes P(x) true.
Thus, ~ ( x (P(x) ) )  x ( ~P(x) )

~ (x (P(x) ) )
- means P(x) is not true for all x in the
universal set.
Thus, ~ (x (P(x) ) )  x (~P(x) )
Negation Examples
1. ~(x(y (P(x,y) ) )
 x ~(y (P(x,y) ) )
 x y ~(P(x,y) )

2. ~(x(y (P(x,y) ) )
 x y ~(P(x,y) )
Exercise #1: Find the negation
1. ~(x  N (x is prime → x2 + 1 is even)
 x  N ~(x is prime → x2 + 1 is even)

since: (p →q )  ~p  q
 x  N ~(x is not prime  (x2 + 1) is even)

since: ~(p  q )  ~p  ~q
 x  N (x is prime  x2 + 1 is odd)
Exercises: Find the negation
2. ~(x  Q (x > 0  x3 = 2) )
 x  Q ~(x > 0  x3 = 2) )
 x  Q (x  0  x3  2) )

Your turn..
3. ~(x (y (xy = y) ) )

4. ~(x(y (x < y → (z (x < z  z <y) ) ) ) )


Validate the ff. quantified statements:

1. For universal set N, x ( (x+3=2)  (x-2 =1))


2. For universal set N, x ( (x-3=1)  (x>3) )
3. For universal set N, x ( (x+ 3 =2)  (x-2=1) )
4. For universal set N, x ( (x-3=1)  (x>3) )
5. x ( ( x2 – 2x + 1 = 0)  (x  x) )
6. x ( ( x  3)  (x >3) )
Discrete Mathematics

PROOFS
Mathematical Induction
Theorem
• A proposition that has been proven to be
true.

Example:
1. If the two sides of a triangle are equal, then
the angles opposite them are equal.
2. If the diagonals of quadrilateral bisect each
other then the quadrilateral is a
parallelogram.
Proof
• An argument that establishes the truth of a
theorem.

• Proof Derivation:
– Equivalence rules – describe logical equivalences

– Inference Rules / Deductive– describe when a


weaker statement can be deduced from a stronger
statement.
Equivalence Rules (A  B)
Equivalence Name

p  ~ (~p) Negation
p → q  ~p  q Implication
~(p  q)  ~p  ~q De Morgan’s laws
~(p  q)  ~p  ~q
pqqp Commutative
pqqp
p  ( q  r)  (p  q)  r Associative
p  ( q  r)  (p  q)  r
Inference
• To prove the theorem means to show that the
implication is a tautology.

• Example:
( p  (p → q) ) → q

• Could be written as:


p
p→q -> it is called inference
-----------
q
Inference Form
• Form: p1
p2 hypotheses or
: premises
pn .
q conclusion

• Means (p1  p2  …  pn) → q


Basic Rules of Inference
• Identity p If p is true, then p
will ALWAYS be
______ true
 p

• Examples:
a. q b. ~r
q ~ r
Basic Rules of Inference
• Conjuction (And) p
q
______
 pq

• Conjuction (And) Elimination


If p  q is true, pq pq
then p will ______ ______
ALWAYS be true  p  q
Basic Rules of Inference

• Disjunction (Or) p
If p is true, then p  q ________
will ALWAYS be true  pq

• Disjunction (Or) Elimination


If p  q is true, and p is pq pq
false, then q must be true ___~p___ ___~q___
 q  p
Basic Rules of Inference
• Modus Ponens p→q Latin word for
p “affirmative
• Example: ________ mode”
~ p→q  q
~p
q
• Modus Tollens p→q Latin word for
___~q___ “denial mode”
• Example:  ~p
~r→s
~s
r
Inference Rules
Inference Name
Conjunction
(And)
Modus ponens

Modus tollens

(p  q) → p or (p  q) → q And Elimination
(q  p) → q or (q  p) → p (Simplification)
p → (p  q) Disjunction (Or)
q → (q  p) (Addition)
Inference Rules for Propositions

Inference Name
Hypothetical
syllogism
Disjunctive
syllogism
(Or Elimination)
Inference Example
• Use truth table to prove the following:
p
p→q q (also known as Modus ponens)

Let S be the statement: [ p  (p→q) ] → q


p q p→q p(p→q) S
T T T T T
T F F F T
F T T F T
F F T F T
Examples
• Is the ff. arguments valid? (Rules of Inference)
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.

Argument is valid although the conclusion may


be false
Examples
• Is the ff. arguments valid? (Modus Ponens)
Smoking is healthy.
If smoking is healthy, then cigarettes are
prescribed by physicians. .
 Cigarettes are prescribed by physicians.

Argument is valid, however the conclusion is


false
Examples
• Is the ff. arguments valid?
If taxes are lowered, then income rises.
Income rises. .
 Taxes are lowered.
Exercises
1. Prove that
Contrapositive:
p→q  ~q →~p

• Solution:
p→q (given)
Modus
ponens: ~q → ~p (Contrapositive)
~q (given)
p→q
~p (Modus ponens)
p
q
Exercises
1.1 Prove that pq
r
r → ~q
p
• Solution:
pq
p
r
~q
r → ~q
Exercises (cont.)
2. Prove that
Hypo Syllogism:
p→q
q→r
Solution:
p→r
p
q
p→q s
q→r
q→s
r→s
Exercises (cont.)
3. Prove that
Solution:
p→r
r→s p →s
~p
x  ~s
~s
u  ~x
~x
~u
Your Turn…
4. Prove that

5. [ (p → ~q)  (~q→ ~r)  p ] → ~r

6. [ (p→r)(r→s)(w ~s)(~w u) ~u ] →~p


Exercises:
• Write a proof sequence for the assertion:
1. p
p→q r
q→r

2. pq
~p q
Exercises:
• Write a proof sequence for the assertion:
3. p → q ~q → ~p

4. p 5. p → (q  r)
qr pr p
~p  ~q s → ~r
s
q → ~p
p .
F
Exercises:
• Write a proof sequence for the assertion:
6. [p→(q  r)]  (~q  ~r) →~p

7. {~p  q  [q → (p  r)] } → r
Modus Badus
• Fallacy of affirming the conclusion
• Consider the following: q q
p→q q → p
p p
• Is this true?
p q p→q q(p→q)) (q(p→q)) → p
T T T T T
T F F F T Not a
F T T T F valid
rule!
F F T F T
Modus Badus
• Consider the following: ~p
p→q
~ q
• Is this true?

p q p→q ¬p(p→q)) (¬p(p→q)) → ¬q


T T T F T
T F F F T Not a
F T T T F valid
rule!
F F T T T
Discrete Mathematics

Mathematical Induction
Mathematical Induction
• Method of proving a formula

• Principles:
– Step 1: Basic Step S(1) is true
– Step 2: Inductive Step if S(1) is true for all i< n+1,
then S(n+1) is true
Example #1
1. Show that 1+2+3+…+ n = n(n+1)
2
Solution:
Step 1: S(1) or let n = 1
n = n (n + 1)
2
1 = 1 (1 + 1)
2
1 = 2/2 = 1 TRUE
Example #1 (cont.)
1. Show that 1+2+3+…+ n = n(n+1)
2
Solution:
Step 2: S(n+1) or let n = n + 1 to show:
= (n+1) (n+1+1)
2
= (n+1) (n+2)
2
Example #1 (cont.)
1 + 2 + 3 +…+ n = n(n+1) Show that:
2 (n+1) (n+2)
2
Since the last term on the left side is + n then add
both sides with (n+1):
1 + 2 + 3 +…+ n + (n+1) = n(n+1) + (n+1)
2
= n(n+1) + 2(n+1)
2
= (n+1)(n+ 2)
2
Example #2
2. Show that if r  1, then
a + ar1 + ar2 + … + arn = a(rn+1 -1)
r-1
Step 1: Since r  1 then let n=0

ar0 = a(r0+1 -1)


r-1
a(1) = a(r1 -1)
r-1
a = a
Example #2
2. Show that if r  1, then
a + ar1 + ar2 + … + arn = a(rn+1 -1)
r-1
Step 2: let n = n+1
Show that: a(rn+2 -1)
r-1
a + ar1 + ar2 + … + arn = a(rn+1 -1)
r-1
a + ar1 + ar2 + … + arn + arn+1 = a(rn+1 -1) + arn+1
r-1
= a(rn+1 -1) + (r-1) arn+1 = a(rn+2 -1)
r-1 r-1
Example #3
3. Show that n!  2n-1 for n 1
Step 1: S(1) let n = 1
n!  2n-1
1!  21-1
1  20
1  1 TRUE
Example #3 (cont.)
3. Show that n!  2n-1 for n 1
Step 2: S(n+1) let n = n+1 to show:
 2n+1-1
 2n
Left side equation:
(n+1)! = (n+1) n! ex: 5! = 5  4!
 (n+1) 2n-1
 2 • 2n-1 n+1  2 since n  1
 21 • 2n-1
 2n
Example #3 (cont.)
3. Show that n!  2n-1 for n 1
Step 2: S(n+1) let n = n+1
(n+1)!  2n+1-1
(n+1) n!  2n but n!  2n-1
2 • 2n-1  2n since n  1 so 1+1 =2
21 • 2n-1  2n
2n  2n
Example #4
4. Show that 5n – 1 is divisible by 4 for all n1
Step 1: Let n = 1
51 – 1 = 4 is divisible by 4

Step 2: Let n = n + 1
5n+ 1 – 1 = 5 * 5n – 1
= (4 + 1) * 5n – 1
= 4 * 5n + 5n – 1
Note: (5n – 1) is divisible by 4
4 * 5n is divisible by 4
Exercises:
• Using induction, verify each equation for every
positive integer n.
1. 1 + 3 + 5 + … + (2n -1) = n2
2. 1•2 + 2•3 + 3•4+ …+ n(n+1) = n(n+1) (n+2)
3
3. 1(1!) + 2(2!) + … + n(n!) = (n+1)! -1
4. 12 + 22 + 32 +… + n2 = n(n+1)(2n+1)
6
5. 12 - 22 + 32 -… + (-1)n+1n2 = (-1)n+1n(n+1)
2
Exercises:
6. 13 + 23+ 33 + … + n3 =  n(n +1)  2
 2 
7. 1 + 1 + 1 + … + 1 = n
1• 3 3 • 5 5 • 7 (2n-1) (2n+1) 2n+1

8. 1 + a + a2+ … + an-1 = an-1


a-1
Discrete Mathematics

End of Presentation

You might also like