Todays Lecture Chapter 1 Sections 1.3 & 1.4 ICS 6B Predicates - - PDF document

today s lecture
SMART_READER_LITE
LIVE PREVIEW

Todays Lecture Chapter 1 Sections 1.3 & 1.4 ICS 6B Predicates - - PDF document

Todays Lecture Chapter 1 Sections 1.3 & 1.4 ICS 6B Predicates & Quantifiers 1.3 Boolean Algebra & Logic Nested Quantifiers1.4 Lecture Notes for Summer Quarter, 2008 Michele Rousseau Set 2 Ch.


slide-1
SLIDE 1

1

ICS 6B Boolean Algebra & Logic

Lecture Notes for Summer Quarter, 2008 Michele Rousseau Set 2 – Ch. 1.3, 1.4

Today’s Lecture

Chapter 1 Sections 1.3 & 1.4

  • Predicates & Quantifiers 1.3
  • Nested Quantifiers1.4

Lecture Set 2 - Chpts 1.3, 1.4 2

Chapter 1: Section 1.3

Predicates & Quantifiers

Predicates

Not everything can be expressed as T/F… so we

use Predicate Logic

The term predicate is used similarly in

grammar

  • Subject: What we make an assertion about
  • Subject: What we make an assertion about
  • Predicate: What we assert about the subject

4

For Example

“Socrates is Mortal” What is the Subject? Socrates What is the Predicate? being mortal “X i l h 20” “X is less than 20” What is the Subject? X What is the Predicate? less than 20 Predicates become propositions once we add variables which we then can quantify.

Lecture Set 2 - Chpts 1.3, 1.4 5

Propositions

“X is less than 20” Variable: x Predicate: less than 20 So we say, Let Px denote the statement “x 20”

  • r Px: :x 20
  • r Px: : x 20

Px has no truth value until the variable x is bound For example: P3 Set x3 so P3 : 320 True P 25 is False P‐32 is True

Lecture Set 2 - Chpts 1.3, 1.4 6

slide-2
SLIDE 2

2

Another Example

“The security alarm is beeping in DBH” Let Ax denote the statement

“The security alarm is beeping in building x” So what would the truth value of ADBH be? How about AELH?

Lecture Set 2 - Chpts 1.3, 1.4 7

Multiple Variables

You can also have multi‐variable predicates For example

  • Let R be the 3‐variable predicate Rx,y,z:: xyz
  • Find the truth value of

◘ R2,‐1,5

  • x1, y‐1, z5
  • R2,‐1,5 is ‐215 which is false
  • Now try

◘ R3,4,7 True ◘ Rx,4,y x, y not bound

Lecture Set 2 - Chpts 1.3, 1.4 8

Quantifiers

Tell us the range of elements that the

proposition is true over

In other words… over how many objects

the predicate is asserted.

Lecture Set 2 - Chpts 1.3, 1.4 9

Universal Quantifier

Notation : ∀xPx

  • ∀ is the universal quantifier

In English

The Universal Quantification of P(x) is the statement. “P(x) for all values of x in the domain”

In English

  • “for all x Px holds”
  • “for every x Px holds”
  • “for each x Px holds

A counterexample of ∀xPx is an element

for which Px is false

Lecture Set 2 - Chpts 1.3, 1.4 10

The Universe

Propositions in predicate logic are

statements on objects of a universe.

The universe is thus the domain of the

individual variables. It b

It can be

  • the set of real numbers
  • the set of integers
  • the set of all cars on a parking lot
  • the set of all students in a classroom
  • etc…

Lecture Set 2 - Chpts 1.3, 1.4 11

For Example:

“All cars have wheels”

∀xPx UAll cars

  • Px denotes x has wheels

Lecture Set 2 - Chpts 1.3, 1.4 12

slide-3
SLIDE 3

3

Universal Quantifier & Conjunction

If you can list all of the elements in the universe of discourse Then ∀xPx is equivalent to the conjunction Px1 Px2 Px3 … Pxn If there were only 4 cars c1, c2, c3, c4 in our previous example Uc1, c2, c3, c4 The we could translate the statement ∀xPx to Pc1 Pc2 Pc3 Pc4

Lecture Set 2 - Chpts 1.3, 1.4 13

Truth value of Universal Quantification

What is the truth value of ∀xPx

U1,2,3,4 Px x* 25 100 FALSE – Why? y 4*25 is not 100

What is the truth value of ∀xPx

U1,2,3 Px x2 10 TRUE

Lecture Set 2 - Chpts 1.3, 1.4 14

Existential Quantification

Notation: ∃xPx

  • ∃ is the existential quantifier

The Existential Quantification of P(x) is the statement. “There exists an element x in the domain such that P(x)”

In English:

  • “There exists an x such that Px”
  • “There is an x such that Px”
  • “There is at least one x such that Px holds”
  • “For some x Px”
  • “I can find an x such that Px”

Lecture Set 2 - Chpts 1.3, 1.4 15

Existential Quantifier

∃x means at least 1 object in the universe

.. followed by Px means that Px is true for at least 1 object in the universe.

For example: For example:

“Somebody loves you” ∃xPx Px is the predicate meaning: “x loves you” Uall living creatures

Lecture Set 2 - Chpts 1.3, 1.4 16

Existential Quantifier & Disjunction

If you can list all of the elements in the universe of discourse Then ∃ xPx is equivalent to the Disjunction Px1 Px2 Px3 … Pxn If there were only 5 living creatures me bear If there were only 5 living creatures me, bear, cat, steve, pete in our previous example Ume, bear, cat, steve, pete Then we could translate ∃xPx to Pme Pbear Pgirl Psteve Ppete

Lecture Set 2 - Chpts 1.3, 1.4 17

Truth value of Existential Quant.

What is the truth value of ∃ xPx

U1,2,3 Px x* 25 100 True 4*25 is not 100

What is the truth value of ∃ xPx

U1,8,20 Px x2 10 True – Why?

Lecture Set 2 - Chpts 1.3, 1.4 18

slide-4
SLIDE 4

4

Uniqueness Quantifier

AKA Unique Existential Quantifier Notation: ∃! xPx or ∃1 xPx

The Uniqueness Quantifier of P(x) is the statement. “There exists a unique x in the domain such that P(x)”

In English:

  • “There is a unique x such that Px”
  • “There is one and only one x such that Px”
  • “One can find only one x such that Px.”

Lecture Set 2 - Chpts 1.3, 1.4 19

Truth value of Uniqueness Quant.

What is the truth value of ∃! xPx

U1,2,3 Px x* 25 100 False 4*25 is not 100

What is the truth value of ∃! xPx

U1,8,20 Px x2 10 True

Lecture Set 2 - Chpts 1.3, 1.4 20

Some terms

Bound – if a specific value is assigned to it

  • r if it is quantified

Free –if a variable is not bound. Scope ‐ the part of the logical expression

to which the quantifier is applied Examples ∃ xPx,y ∀x∃ yPx,y Qx,y

Lecture Set 2 - Chpts 1.3, 1.4 21

Bound Free Bound Bound Free Bound

Reading Quantified Formulas

Read Left to right

Example let U the set of airplanes let Fx, y denote "x flies faster than y". , y y ∀x∀y Fx, y can be translated initially as: "For every airplane x the following holds: x is faster than every any airplane y".

Lecture Set 2 - Chpts 1.3, 1.4 22

More Examples

Translate: ∀ x ∃ y Fx, y “For every airplane x the following holds: for some airplane y, x is faster than y".

  • r "Every airplane is faster than some airplane".

Translate: ∃ x∀y Fx, y

Note: These are not equivalen5

"There exist an airplane x which satisfies the following:

  • r such that for every airplane y, x is faster than y".
  • r "There is an airplane which is faster than every airplane“
  • r "Some airplane is faster than every airplane".

Translate: ∃ x ∃ y Fx, y For some airplane x there exists an airplane y such that x is faster than y"

  • r “Some airplane is faster than some airplane".

23

More Examples

UR all the real numbers Px,y: x,* y0 ∀x∀y Px, y Which of these are True? ∀x∀y Px, y False ∀x∀y Px, y ∀ x ∃ y Px, y ∃ x∀y Px, y ∃ x ∃ y Px, y

24

False True True True

slide-5
SLIDE 5

5

Negation of Quantifiers

∀ x Px ∃x Px and ∃ x Px ∀ x Px For Example Px reprsents “x is happy” Upeople "There does not exist a person who is happy" is equivalent to "Everyone is not happy".

Lecture Set 2 - Chpts 1.3, 1.4 25

Negation of Quantifiers

∀ x Px ∃x Px and ∃ x Px ∀ x Px For Example Px reprsents “x is happy” Upeople "There does not exist a person who is happy" is equivalent to "Everyone is not happy".

Lecture Set 2 - Chpts 1.3, 1.4 26

DeMorgan’s Laws

Lecture Set 2 - Chpts 1.3, 1.4 27

English to Logical Expressions

Fx: x is a fleegle Sx: x is a snurd Tx: x is a thingamabob Ufleegles, snurds, thingamabobs “ Everything is a fleegle” ∀ x Fx ∃x Fx “ Nothing is snurd” ∀ x Sx ∃x Sx “ All fleegles are snurds” ∀ x Fx Sx ∀ x Fx Sx ∀ x Fx Sx ∃xFx Sx

28

More English Translations

“ Some fleegles are thingamabobs” ∃ x Fx Tx ∀ x Fx Tx “ No snurd is a thingamabob” ∀x Sx Tx ∃x Sx Tx “If any fleegle is a snurd then it's also a thingamabob” ∀ x Fx SxTx ∃xFx Sx Tx

Lecture Set 2 - Chpts 1.3, 1.4 29

HOMEWORK for SECTION 1.3

1,3,5,7,19,23

Lecture Set 2 - Chpts 1.3, 1.4 30

slide-6
SLIDE 6

6

Chapter 1: Section 1.4

Nested Quantifiers

What are Nested quantifiers?

If one quantifier is within the scope of the

  • ther.
  • Eg.

U:R U:R ∀ x ∃ yx y0 ∀ x ∀ yxyyx ∀ x ∀ y ∀ zxyzxyz

Lecture Set 2 - Chpts 1.3, 1.4 32

Translating into English

Translate: U:R ∀ x ∀ yxyyx ∀ x “For every real number x” ∀ “F l b ” ∀ y “For every real number y” xyyx “xy is equal to y x” “For every real number x and for every real number y, xy is equal to y x”

Lecture Set 2 - Chpts 1.3, 1.4 33

Translating to English

Translate: U: R ∀ x ∀ yx0 y0 xy0 “For every real number x and every real number y if x 0 and y 0 then xy 0” number y, if x 0 and y 0, then xy 0

Lecture Set 2 - Chpts 1.3, 1.4 34

Switching order

If the quantifiers are the same switching

  • rder doesn’t matter
  • ie. All ∀’s or all ∃’s
  • ∀ x ∀ y Px,y ∀ y ∀ x Px,y
  • ∃ x ∃ y Px,y ∃ y ∃ x Px,y

If the quantifiers are different then order

matters

  • ∀ x ∃ y Px,y ∃ y ∀ x Px,y

Lecture Set 2 - Chpts 1.3, 1.4 35

NOT Equivalent