0% found this document useful (0 votes)
2 views

Predicates II

The document discusses the concepts of bound and free variables in logical expressions, emphasizing the importance of quantifiers and their scopes. It provides examples of negating quantified expressions, translating English statements into logical forms, and the implications of nested quantifiers. Additionally, it explores quantification with multiple variables and offers exercises for expressing relationships using quantifiers.

Uploaded by

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

Predicates II

The document discusses the concepts of bound and free variables in logical expressions, emphasizing the importance of quantifiers and their scopes. It provides examples of negating quantified expressions, translating English statements into logical forms, and the implications of nested quantifiers. Additionally, it explores quantification with multiple variables and offers exercises for expressing relationships using quantifiers.

Uploaded by

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

Precedence

• When a quantifier is used on the variable x, we


say that this occurrence of the variable is bound.
• An occurrence of a variable that is not bound by
a quantifier or set equal to a particular value is
said to be free.
• The part of a logical expression to which a
quantifier is applied is called the scope of this
quantifier. Consequently, a variable is free if it is
outside the scope of all quantifiers in the formula
that specifies this variable.
• In the statement the variable x is bound
by the existential quantification but the
variable y is free because it is not bound
by a quantifier and no value is assigned to
this variable.
• In the statement all variables are bound.
The scope of the first quantifier, is the
expression P(x) A Q(x) because 3x is
applied only to P(x) A Q(x), and not to the
rest of the statement.
Example
What are the scope of these expressions?
Are all the variables bound?

x( x  y 1)
x( p ( x)  q ( x))  xR( x)
x( p ( x)  q ( x))  yR( y )

6
Equivalence
• we can distribute a universal quantifier
over a conjunction. Furthermore, we can
also distribute an existential quantifier over
a disjunction.
• However, we cannot distribute a universal
quantifier over a disjunction, nor can we
distribute an existential quantifier over a
conjunction.
Negating quantified expressions

Negations of the following statements


“There is an honest politician”
“Every politician is dishonest”
(Note “All politicians are not honest” is ambiguous)
“All Americans eat cheeseburgers”
10
Example
What are the negations of x( x 2  x) and x( x 2 2) ?

 x( x 2  x) x( x 2 2)
x ( x 2  x) x ( x 2 2)
x( x 2  x) x( x 2 2)

Show  x( p ( x)  q ( x)) x( p ( x)   q ( x))

 x( p ( x)  q ( x)
x( ( p ( x)  q ( x)))
x( ( p ( x)  q ( x)))
x( p ( x)   q ( x))

11
Translating English into logical
expressions
• “Every student in this class has studied
calculus”
Let c(x) be the statement that “x has
studied calculus”. Let s(x) be the
statement “x is in this class”
x c( x) if the domain consists of students of this class
x s ( x)  c( x) if the domain consists of all people
x s ( x)  c( x) ? if the domain consists of all people

12
Using quantifiers in system
specifications
• “Every mail message larger than one
megabyte will be compressed”
Let s(m,y) be “mail message m is larger
than y megabytes” where m has the
domain of all mail messages and y is a
positive real number. Let c(m) denote
“message m will be compressed”
m( s ( m,1)  c ( m))

13
Example
• “If a user is active, at least one network
link will be available”
Let a(u) represent “user u is active” where
u has the domain of all users, and let s(n,
x) denote “network link n is in state x”
where n has the domain of all network
links, and x has the domain of all possible
states, {available, unavailable}.
u a (u )  n s (n, available)
14
Nested quantifiers
Nested quantifiers
Let the variable domain be real numbers

xy ( x  y ) 0
same as xq ( x)
where q ( x) is yp ( x, y ) and p ( x, y ) is x  y 0

xy ( x  y  y  x)
xyz ( x  ( y  z ) ( x  y )  z )
xy (( x  0)  ( y  0)  ( xy  0))

where the domain for these variables


consists of real numbers
16
Quantification as loop
• For every x, for every y
– Loop through x and for each x loopthrough
xyp( xy, y )
– If we find p(x,y) is true for all x and y, then the
statement is true
– If we ever hit a value x for which we hit a value for
which p(x,y) is false, the whole statement is false
• For every x, there exists y
– Loop through x until we find a y that p(x,y) is true
– If for every x, we find such a y,then
xypthe
( x, statement
y) is
true

17
Quantification as loop
• xyp( x, y ) : loop through the values for x
until we find an x for which p(x,y) is always
true when we loop through all values for y
– Once found such one x, then it is true
• : loop though the values for x
xyp( x, y )
where for each x loop through the values of y
until we find an x for which we find a y such
that p(x,y) is true
– False only if we never hit an x for which we never
find y such that p(x,y) is true
18
Order of quantification
Let p ( x, y ) be the statement x  y  y  x,
and the domain is real number
xyp( x, y )
xyp( x, y ) yxp( x, y ) ?

Let q ( x, y ) be the statement x  y 0,


and the domain is real number
yxq( x, y ) : What does it mean? Is it true?
xyq( x, y ) : What does it mean? Is it true?
yxp( x, y ) xyp( x, y ) ?
19
Quantification of two variables

20
Quantification with more
variables
Let q ( x, y, z ) be the statement x  y  z ,
and the domain is real number
xyzq( x, y, z ) : What does it mean? Is it true?
zxyq( x, y, z ) : What does it mean? Is it true?

21
Translating mathematical
statements
• “The sum of two positive integers is
always positive”
xy (( x  0)  ( y  0)  ( x  y  0))
where the domain for both variables consists of
all integers

xy ( x  y  0)
where the domain for both variables consists of
all positive integers
22
Example
• “Every real number except zero has a
multiplicative inverse”

x(( x 0)  y ( xy 1))


where the domain for both variables consists of real numbers

23
Translating statements into
English
• x(c( x)  y (c( y )  f ( x, y ))) where c(x)
is “x has a computer”, f(x,y) is “x and y are
friends”, and the domain for both x and y
consists of all students in our school
• xyz (( f ( x, y )  f ( x, z )  ( y  z ))   f ( y, z ))
where f(x,y) means x and y are friends,
and the domain consists of all students in
our school

24
Negating nested quantifiers
 xy ( xy 1)
xy ( xy 1)
xy ( xy 1)
xy ( xy 1)
• There does not exist a woman who has taken
a flight on every airline in the world
waf ( p ( w, f )  q ( f , a ))
waf ( p ( w, f )   q ( f , a ))
where p(w,f) is “w has taken f”, and q(f,a) is “f
is a flight on a
25
Let L(x, y) be the statement "x loves y," where the domain
for both x and y consists of all people in the world.
Use quantifiers to express each of these statements.
a) Everybody loves Jerry.
b) Everybody loves somebody.
c) There is somebody whom everybody loves.
d) Nobody loves everybody.
e) There is somebody whom Lydia does not love.
t) There is somebody whom no one loves.
g) There is exactly one person whom everybody loves.
h) There are exactly two people whom Lynn loves.
i) Everyone loves himself or herself.
j) There is someone who loves no one besides himself
or herself.
Let P (x, y) be the statement "student x has
taken class y," where the domain for x
consists of all students in your class and
for y consists of all computer science
courses at your school. Express each of
these quantifications in English.

You might also like