0% found this document useful (0 votes)
19 views18 pages

CS210 Slides 03 04 Nested Quantifiers

This document discusses predicate logic and nested quantified expressions. It begins by defining universal and existential quantifiers. It then explains that predicates can have multiple variables, and each variable must be bound by a quantifier for the expression to be a proposition. The order of quantifiers is important, as expressions with the same quantifiers but in a different order may not be logically equivalent. Negating nested quantified expressions involves iteratively applying the rules for negating single quantifiers.

Uploaded by

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

CS210 Slides 03 04 Nested Quantifiers

This document discusses predicate logic and nested quantified expressions. It begins by defining universal and existential quantifiers. It then explains that predicates can have multiple variables, and each variable must be bound by a quantifier for the expression to be a proposition. The order of quantifiers is important, as expressions with the same quantifiers but in a different order may not be logically equivalent. Negating nested quantified expressions involves iteratively applying the rules for negating single quantifiers.

Uploaded by

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

Discrete Mathematics

Predicate Logic

Predicates and Propositional Functions


Universal and Existential Quantifiers
Negating Quantified Statements
Nested Quantified Expressions

Imdad ullah Khan and Malik Jahan Khan

Imdad ullah Khan (LUMS) Predicate Logic 1/1


Quantified Expression: Recap
Propositional function becomes proposition when specific value is
given to variable
Quantifiers make it proposition for a range of values

Universal Quantifier: ∀
∀x P(x) := P(x) (is true) for all values of x in the UoD

Proposition ∀x P(x) is True iff for every x in UoD, P(x) is True

Existential Quantifier: ∃
∃x P(x) := P(x) (is true) for some value(s) of x in the UoD

Proposition ∃x P(x) is True iff for at least one x in UoD, P(x) is True

Imdad ullah Khan (LUMS) Predicate Logic 2/1


Nested Quantified Expressions
Predicates can have more than one variables

P(x, y ) : x teaches course y in LUMS


Q(x, y , z) : x is an instructor of course y in university z
S(x, y , z) : x + y = z

Each variable needs to be given value or quantified to make the predicate


a proposition

Imdad ullah Khan (LUMS) Predicate Logic 3/1


Nested Quantified Expressions: Binding Variables
Predicates can have more than one variables

Each variable needs to be given value or quantified to make the predicate


a proposition

∀x P(x, y ) is not a proposition


. The variable x is ‘bound’, while y is ‘free’

∀x ∀y P(x, y ) is a proposition (both variables are bound)

∀x ∃y ∀z Q(x, y , z) is a proposition (all variables are bound)

Imdad ullah Khan (LUMS) Predicate Logic 4/1


Nested Quantified Expressions: Binding Variables

∀x, ∀y P(x, y ) ≡? ∀x P(x, y ) ∧ ∀y P(x, y )

LHS: Both x and y are bound

RHS: x is bound in the first predicate and y is free

RHS: y is bound in the second predicate and x is free

RHS is not even a proposition

Imdad ullah Khan (LUMS) Predicate Logic 5/1


Nested Quantified Expressions: Order is important
Order of quantifier is extremely important

∀x∃y P(x, y ) is not the same as ∃y ∀x P(x, y )

P(x, y ) : x teaches course y in LUMS

∀x ∃y P(x, y ): For every instructor, there is a course that (s)he teaches

∃y ∀x P(x, y ): There is a course that every instructor teaches

∃x ∀y P(x, y ): There is an instructor who teaches all the courses

∀y ∃x P(x, y ): For every course, there is an instructor who teaches it

Imdad ullah Khan (LUMS) Predicate Logic 6/1


Nested Quantified Expressions: Order is important
Order of quantifier is extremely important

∀x∃y P(x, y ) is not the same as ∃y ∀x P(x, y )

Q(x, y , z) : x is an instructor of course y in university z

∀z ∀y ∃x Q(x, y , z): In every uni. for every course there is an instructor

∀z ∃x ∀y Q(x, y , z): In every uni. there is an instructor for all courses

∃x ∀z ∀y Q(x, y , z): There is an instructor for every course in every uni.

Imdad ullah Khan (LUMS) Predicate Logic 7/1


Nested Quantified Expressions: Order is important

1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1

∀ row x ∃ column y A[x][y ] = 1 ∃ column y ∀ row x A[x][y ] = 1


Every row has at least one 1 There is a column with all 1’s
Both tables satisfy this First table does not satisfy this
Second table satisfy this

Imdad ullah Khan (LUMS) Predicate Logic 8/1


Nested Quantified Expressions: Order is important

1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1

∀ row x ∀ column y A[x][y ] = 1 ∀ column y ∀ row x A[x][y ] = 1


Every cell has a 1 Every cell has a 1
First table does not satisfy this First table does not satisfy this
Second table satisfy this Second table satisfy this

Imdad ullah Khan (LUMS) Predicate Logic 9/1


Nested Quantified Expressions: Order of Quantifiers

1
1 1
1 1
1
1

∃ row x ∃ column y A[x][y ] = 1 ∃ column x ∃ row y A[x][y ] = 1


There is a 1 in the table There is a 1 in the table
Both tables satisfy this Both tables satisfy this

Imdad ullah Khan (LUMS) Predicate Logic 10 / 1


Nested Quantified Expressions
Order of quantifier is extremely important

∀x∃y P(x, y ) is not the same as ∃y ∀x P(x, y )

If both quantifiers are the same then order does not matter

Imdad ullah Khan (LUMS) Predicate Logic 11 / 1


Nested Quantified Expressions

Goldbach conjecture (1742)


Every even integer greater than 2 can be written as sum of two primes

∀n ∈ N, ((n > 2) ∧ (n even)) → (∃p, q ∈ P, n = p + q)

Vinogradov (1937)
Every sufficiently large odd number is the sum of three primes

∃K ∈ N, ∀n ≥ K , ((n odd) → ∃p, q, r ∈ P, n = p + q + r )

Imdad ullah Khan (LUMS) Predicate Logic 12 / 1


Truth Values of Nested Quantified Expressions

Statement When True? When False?

∀x∀y P(x, y ) P(x, y ) is true for There is a pair x, y for


∀y ∀x P(x, y ) every pair x, y which P(x, y ) is false

For every x, there is a y There is an x such that


∀x∃y P(x, y )
for which P(x, y ) is true P(x, y ) is false for every y
There is an x for which For every x there is a y
∃x∀y P(x, y )
P(x, y ) is true for every y for which P(x, y ) is false
∃x∃y P(x, y ) There is a pair x, y for P(x, y ) is false for
∃y ∃x P(x, y ) which P(x, y ) is true every pair x, y

Imdad ullah Khan (LUMS) Predicate Logic 13 / 1


Nested Quantified Expressions
Express each of these system specifications using predicates with UoD’s,
quantifiers, and logical connectives

1 At least one console must be accessible during every fault condition


2 The e-mail address of every user can be retrieved whenever the
archive contains at least one message sent by every user on the system
3 For every security breach there is at least one mechanism that can
detect that breach if and only if there is a process that has not been
compromised
4 There are at least two paths connecting every two distinct endpoints
on the network
5 No one knows the password of every user on the system except for
the system administrator, who knows all passwords

Imdad ullah Khan (LUMS) Predicate Logic 14 / 1


Nested Quantified Expressions
Translate these statements expressing some mathematical fact into English
Let the Universe of discourse for all variables be real numbers

ICP 2-27 ∀x∃y (x + y = 0)


Every real number has an additive inverse
ICP 2-28 ∃x∀y (x + y = y )
There exists an additive identity

ICP 2-29 ∀x∃y (x 6= 0) → (xy = 1)
Every non-zero real number has a multiplicative inverse
ICP 2-30 ∃x∀y (xy = y )
There exists a multiplicative identity

Imdad ullah Khan (LUMS) Predicate Logic 15 / 1


Negating Nested Quantified Expressions
Recall

¬∀x P(x) ≡ ∃x ¬P(x) ¬∃x P(x) ≡ ∀x ¬P(x)

Negate nested quantified statement using iterative applications of


negating quantifiers

¬ ∀x ∃y P(x, y ) ≡ ∃x ∀y ¬ P(x, y )

¬ ∃x ∀y P(x, y ) ≡ ∀x ∃y ¬ P(x, y )

Imdad ullah Khan (LUMS) Predicate Logic 16 / 1


Negating Nested Quantified Expressions
P(x, y ) : x teaches course y in LUMS

Negate the following statement in plain English

For every course, there is an instructor teaching it

Next translate it into a quantified expression

Negate the quantified expression

Translate the negated quantified expression into plain English and


compare with the one you got earlier

Imdad ullah Khan (LUMS) Predicate Logic 17 / 1


Nested Quantified Expressions: Summary

All variables in multivariable predicates need to be bound


Each variable can be quantified differently
Order of different quantifiers is extremely important
For same quantifiers order does not matter
It is tricky to translate English statements to nested quantified
statement and vice-versa
Requires extensive practice
Negating nested quantified statement is just nested applications
negating quantified statements

Imdad ullah Khan (LUMS) Predicate Logic 18 / 1

You might also like