discrete mathematics. predicates - the universal quantifier 11/28/2015 suppose p(x) is a predicate...

33
Discrete Mathematics

Upload: carol-may

Post on 14-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Discrete Mathematics

Page 2: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Predicates - the universal quantifier

04/18/23

Suppose P(x) is a predicate on some universe of discourse.Ex. B(x) = “x is carrying a backpack,” x is set of CSER1209 students.

The universal quantifier of P(x) is the proposition:“P(x) is true for all x in the universe of discourse.”

We write it x P(x), and say “for all x, P(x)”

x P(x) is TRUE if P(x) is true for every single x.x P(x) is FALSE if there is an x for which P(x) is false.

Page 3: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Predicates - the universal quantifier

04/18/23

Let A = {1, 2, 3, 4, 5}. Determine the truth value of each of the following statements:(a) (∀x ∈ A)(x + 3 < 10) (b) (∀x ∈ A)(x + 3 ≤ 7)

(a) True. For every number in A satisfies x + 3 < 10.

(b) False. For if x = 5, then x + 3 is not less than or equal 7. In other words, 5 is not a solution to the given condition.

Page 4: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Predicates - the existential quantifier

04/18/23

Another way of changing a predicate into a proposition.

Suppose P(x) is a predicate on some universe of discourse.Ex. C(x) = “x has a candy bar,” x is set of cser1209 students.

The existential quantifier of P(x) is the proposition:“P(x) is true for some x in the universe of discourse.”

We write it x P(x), and say “for some x, P(x)”

x P(x) is TRUE if there is an x for which P(x) is true. x P(x) is FALSE if P(x) is false for every single x.

Page 5: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Predicates - the existential quantifier

04/18/23

Let A = {1, 2, 3, 4, 5}. Determine the truth value of each of the following statements:(a) (∃x ∈ A)(x + 3 = 10) (b) (∃x ∈ A)(x + 3 < 5)

(a)False. For no number in A is a solution to x + 3 = 10.

(b)True. For if x0 = 1, then x0 + 3 < 5, i.e., 1 is a solution.

Page 6: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Predicates - more examples

04/18/23

L(x) = “x is a lion.”F(x) = “x is fierce.”C(x) = “x drinks coffee.”

All lions are fierce.

Some lions don’t drink coffee.

Some fierce creatures don’t drink coffee.

Universe of discourse is all creatures.

x (L(x) F(x))

x (L(x) C(x))

x (F(x) C(x))

Page 7: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Predicates - more examples

04/18/23

B(x) = “x is a hummingbird.”L(x) = “x is a large bird.”H(x) = “x lives on honey.”R(x) = “x is richly colored.”

All hummingbirds are richly colored.

No large birds live on honey.

Birds that do not live on honey are poorly colored.

Universe of discourse is all creatures.

x (B(x) R(x))

x (L(x) H(x))

x (H(x) R(x))

Page 8: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

ExampleTranslate each of these statements into

logical expressions using predicates, quantifiers, and logical connectives.a) No one is perfect.b) Not everyone is perfect.c) All your friends are perfect.d) At least one of your friends is perfect.e) Not everybody is your friend or someone is not perfect.

x P(x)

x P (x)

x(F(x) P (x))

x(F(x) P (x))

(x F(x) (xP(x))

Let P (x) be "x is perfect";let F(x) be "x is your friend";

Page 9: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Predicates - quantifier negation

04/18/23

Not all large birds live on honey.

x P(x) means “P(x) is true for every x.”

What about x P(x) ?Not [“P(x) is true for every x.”]“There is an x for which P(x) is not true.”

x P(x)

So, x P(x) is the same as x P(x).

x (L(x) H(x))

x (L(x) H(x))

Page 10: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Predicates - quantifier negation

04/18/23

No large birds live on honey.

x P(x) means “P(x) is true for some x.”

What about x P(x) ?Not [“P(x) is true for some x.”]“P(x) is not true for all x.” x P(x)

So, x P(x) is the same as x P(x).

x (L(x) H(x))

x (L(x) H(x))

Page 11: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Predicates - quantifier negation

04/18/23

So, x P(x) is the same as x P(x).So, x P(x) is the same as x P(x).

General rule: to negate a quantifier, move negation to the right, changing quantifiers as you go.

Page 12: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Predicates - quantifier negation

04/18/23

Negate each of the following statements:(a) ∃x ∀y P(x, y)(b) ∀ x ∀y P(x, y) (c) ∃y ∃x ∀z P(x, y, z)

Use ¬∀ x p(x) ≡ ∃x¬ p(x) and ¬∃ x p(x) ≡ ∀x¬ p(x):(a) ¬ (∃x∀y, p(x, y)) ≡ ∀x∃y¬ p(x, y)(b) ¬ (∀x∀y, p(x, y)) ≡ ∃x∃y¬ p(x, y)(c) ¬ (∃y ∃x ∀z, p(x, y, z)) ≡ ∀y ∀x ∃z¬ p(x, y, z)

Page 13: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Predicates - free and bound variables

04/18/23

A variable is bound if it is known or quantified. Otherwise, it is free.

Examples:P(x) x is freeP(5) x is bound to 5x P(x) x is bound by quantifier

Reminder: in a proposition, all variables must be

bound.

Page 14: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Predicates - the meaning of multiple quantifiers

04/18/23

xy P(x,y)

xy P(x,y)

xy P(x,y)

xy P(x,y)

P(x,y) true for all x, y pairs.

For every value of x we can find a (possibly different) y so that P(x,y)

is true.

P(x,y) true for at least one x, y pair.

There is at least one x for which P(x,y) is always true.

quantification order is not commutative.

Suppose P(x,y) = “x’s favorite class is y.”

Page 15: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Predicates - multiple quantifiers

04/18/23

To bind many variables, use many quantifiers!

Example: P(x,y) = “x > y”x P(x,y)xy P(x,y)xy P(x,y)x P(x,3)

a) True proposition

b) False proposition

c) Not a proposition

d) No clue

c)

b)

a)

b)

Page 16: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Proofs - how do you know?

04/18/23

The following statements are true:If I am Mila, then I am a great swimmer.

I am Mila.

What do we know to be true?I am a great swimmer!

How do we know it?

Page 17: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Proofs - how do you know?

04/18/23

A theorem is a statement that can be shown to be true.

A proof is the means of doing so.

Axiom, postulates,

hypotheses and previously

proven theorems.

Rules of inference

Proof

Page 18: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Proofs - how do you know?

04/18/23

The following statements are true:If I am Mila, then I am a great swimmer.

I am Mila.

What do we know to be true?I am a great swimmer!

What rule of inference can we use to justify

it?

Page 19: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Proofs - Modus Ponens

04/18/23

I am Mila.If I am Mila, then I am a great swimmer.

I am a great swimmer!p

p q

q

Tautology:

(p (p q)) q

Inference Rule:

Modus Ponens

Page 20: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Proofs - Modus Tollens

04/18/23

I am not a great skater.If I am Erik, then I am a great skater.

I am not Erik!

q

p q

p

Tautology:

(q (p q)) p

Inference Rule:

Modus Tollens

Page 21: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Proofs - Addition

04/18/23

I am not a great skater.

I am not a great skater or I am tall.

p

p q

Tautology:

p (p q)

Inference Rule:

Addition

Page 22: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Proofs - Simplification

04/18/23

you are sleepy and I am not a great skater.

you are sleepy.

p q

p

Tautology:

(p q) p

Inference Rule:

Simplification

Page 23: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Proofs - Disjunctive Syllogism

04/18/23

I am a great eater or I am a great skater.

I am not a great skater.

I am a great eater!p q

q

p

Tautology:

((p q) q) p

Inference Rule:

Disjunctive

Syllogism

Page 24: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Proofs - Hypothetical Syllogism

04/18/23

If you are an athlete, you are always hungry.

If you are always hungry, you have a snickers in your backpack.

If you are an athlete, you have a snickers in your backpack.

p q

q r

p r

Tautology:

((p q) (q r)) (p r)

Inference Rule:

Hypothetical Syllogism

Page 25: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Proofs - A little quiz…

04/18/23

Amy is a computer science major.

Amy is a math major or a computer science major.

Addition

If Ernie is a math major then Ernie is geeky.Ernie is not geeky!

Ernie is not a math major.Modus Tollens

Page 26: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Proofs - A little proof…

04/18/23

Here’s what you know:Ellen is a math major or a CS major.If Ellen does not like discrete math, she is not a CS major.

If Ellen likes discrete math, she is smart.

Ellen is not a math major.

Can you conclude Ellen is smart?M CD CD SM

Page 27: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Proofs - A little proof…

04/18/23

1. M C Given2. D C Given3. D S Given4. M Given

5. C DS (1,4)

6. D MT (2,5)

7. S MP (3,6)

Ellen is smart!

Page 28: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Proofs - A little proof…(Another approach)

04/18/23

1. M C Given2. D C Given3. D S Given4. M Given

5. C Disjunctive Syllogism (1,4)

6. C D Contrapositive of 2

7. C S Hypothetical Syllogism (6,3)

8. S Modus Ponens (5,7)

Ellen is smart!

Page 29: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Challenge..

Here’s what you know:

"It is not sunny this afternoon and it is colder than yesterday" "We will go swimming only if it is sunny" "If we do not go swimming, then we will take a canoe trip" "If we take a canoe trip, then we will be home by sunset“

Can you conclude "We will be home by sunset."

p be the proposition "It is sunny this afternoon," q the proposition "It is colder than yesterday," r the proposition "We will go swimming," s the proposition "We will take a canoe trip," and t the proposition "We will be home by sunset."

p q

r p

r s

s t

t

Page 30: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying
Page 31: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

Challenge..

Here’s what you know:

"If you send me an e-mail message, then I will finish writing the program," "If you do not send me an e-mail message, then I will go to sleep early," "If I go to sleep early, then I will wake up feeling refreshed"

Can you conclude "If I do not finish writing the program, then I will wake up feeling refreshed."

p be the proposition "You send me an e-mail message," q the proposition "I will finish writing the program," r the proposition "I will go to sleep early," and s the proposition "I will wake up feeling refreshed."

p q

p r

r s

q s

Page 32: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying
Page 33: Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying

THANK YOU