1.3 predicates and quantifiers. chapter 1, section 3 predicates and quantifiers predicate e.g., if...

15

Click here to load reader

Upload: ava-oneill

Post on 27-Mar-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1.3 Predicates and Quantifiers. Chapter 1, section 3 Predicates and Quantifiers Predicate E.g., If it is sunny, Ill buy X. Here the parameter is X

1.3 Predicates and Quantifiers

Page 2: 1.3 Predicates and Quantifiers. Chapter 1, section 3 Predicates and Quantifiers Predicate E.g., If it is sunny, Ill buy X. Here the parameter is X

Chapter 1, section 3Predicates and Quantifiers

Predicate

• E.g., “If it is sunny, I’ll buy X.” Here the parameter is X.

Page 3: 1.3 Predicates and Quantifiers. Chapter 1, section 3 Predicates and Quantifiers Predicate E.g., If it is sunny, Ill buy X. Here the parameter is X

Chapter 1, section 3Predicates and Quantifiers

Quantifiers

• Universal quantification

• Existential quantification

Page 4: 1.3 Predicates and Quantifiers. Chapter 1, section 3 Predicates and Quantifiers Predicate E.g., If it is sunny, Ill buy X. Here the parameter is X

Chapter 1, section 3Predicates and Quantifiers

Universal Quantification

• Notation: ( x P(x))– This is read: “for all x P(x) is true.”

• This could be used to express the concept:– “Every sunny day I buy a red bag.”

Page 5: 1.3 Predicates and Quantifiers. Chapter 1, section 3 Predicates and Quantifiers Predicate E.g., If it is sunny, Ill buy X. Here the parameter is X

Chapter 1, section 3Predicates and Quantifiers

Example, universal quantification

• C(x) == "x has taken algebra”D(x) == "x is enrolled in discrete math”

x (D(x) C(x)) {is True} but

x (C(x) D(x)) {is False}

Page 6: 1.3 Predicates and Quantifiers. Chapter 1, section 3 Predicates and Quantifiers Predicate E.g., If it is sunny, Ill buy X. Here the parameter is X

Chapter 1, section 3Predicates and Quantifiers

Existential Quantification

• Notation: ( x P(x))– This is read “there exists an x such that

P(x) is true”

• This could be used to express the concept that at least once I bought a red bag.

Page 7: 1.3 Predicates and Quantifiers. Chapter 1, section 3 Predicates and Quantifiers Predicate E.g., If it is sunny, Ill buy X. Here the parameter is X

Chapter 1, section 3Predicates and Quantifiers

Example, existential quantification

x (C(x) D(x))

• This is TRUE – if we can find one person who has taken

algebra – AND is enrolled in discrete math, – OR find one person who hasn't taken algebra.

Page 8: 1.3 Predicates and Quantifiers. Chapter 1, section 3 Predicates and Quantifiers Predicate E.g., If it is sunny, Ill buy X. Here the parameter is X

Chapter 1, section 3Predicates and Quantifiers

From English to logical expressions

• Equivalent to :– there exists

– there is

– there is at least one

– there is some

– for some

– some

– for at least one

• Equivalent to :– for all

– all

– any for every

– every for any any

– for arbitrary

– an arbitrary

– for each

Page 9: 1.3 Predicates and Quantifiers. Chapter 1, section 3 Predicates and Quantifiers Predicate E.g., If it is sunny, Ill buy X. Here the parameter is X

Chapter 1, section 3Predicates and Quantifiers

Binding Variables

• E.g., y x P (x,y,z)

– bound variables y and x,

– and free variable z.

Page 10: 1.3 Predicates and Quantifiers. Chapter 1, section 3 Predicates and Quantifiers Predicate E.g., If it is sunny, Ill buy X. Here the parameter is X

Chapter 1, section 3Predicates and Quantifiers

Consider:

z y x P(x,y,z)

Page 11: 1.3 Predicates and Quantifiers. Chapter 1, section 3 Predicates and Quantifiers Predicate E.g., If it is sunny, Ill buy X. Here the parameter is X

Chapter 1, section 3Predicates and Quantifiers

More Examples

• Suppose P(x,y,z) is the predicate

“When I teach discrete math in semester x, student y does well on exam z.”

• Then x y z P(x,y,z) is the statement:

• Every time I teach discrete math, there is at least one student who does well on every exam."

Page 12: 1.3 Predicates and Quantifiers. Chapter 1, section 3 Predicates and Quantifiers Predicate E.g., If it is sunny, Ill buy X. Here the parameter is X

Chapter 1, section 3Predicates and Quantifiers

Order matters!

y x z P(x,y,z)

Page 13: 1.3 Predicates and Quantifiers. Chapter 1, section 3 Predicates and Quantifiers Predicate E.g., If it is sunny, Ill buy X. Here the parameter is X

Chapter 1, section 3Predicates and Quantifiers

Negation of quantifiers:

~ x P(x) x ~P(x)– true:

• P(x) is false for every x.

– false: • There is an x for which

P(x) is true.

~ x P(x) x ~ P(x)– true:

• There is an x for which P(x) is false.

– false: • P(x) is true for every x.

Page 14: 1.3 Predicates and Quantifiers. Chapter 1, section 3 Predicates and Quantifiers Predicate E.g., If it is sunny, Ill buy X. Here the parameter is X

Chapter 1, section 3Predicates and Quantifiers

Self Quiz

• Simplify the following by moving “~” inside the quantifiers and connectors:

~ x y z ( P(x) V ( Q(y) R(z)))

Page 15: 1.3 Predicates and Quantifiers. Chapter 1, section 3 Predicates and Quantifiers Predicate E.g., If it is sunny, Ill buy X. Here the parameter is X

Chapter 1, section 3Predicates and Quantifiers

Answer:

~ x y z ( P(x) V ( Q(y) R(z)))

x y z (~ P(x) (~ Q(y) V ~ R(z)))