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

Predicates and Quantifiers

This document discusses predicates and quantifiers. It defines predicates as propositional functions with variables, and gives examples of predicates and finding their truth values for given values. It introduces quantifiers like "for all" and "for some" represented by ∀ and ∃. It explains how quantifiers can make predicates into propositions and discusses their truth conditions. Examples are given to illustrate predicates, quantifiers, and their usage in writing mathematical and English statements.

Uploaded by

Atheer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views

Predicates and Quantifiers

This document discusses predicates and quantifiers. It defines predicates as propositional functions with variables, and gives examples of predicates and finding their truth values for given values. It introduces quantifiers like "for all" and "for some" represented by ∀ and ∃. It explains how quantifiers can make predicates into propositions and discusses their truth conditions. Examples are given to illustrate predicates, quantifiers, and their usage in writing mathematical and English statements.

Uploaded by

Atheer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Lecture 5

Predicates and Quantifiers

92
Motivation

• Is the answer of this question “x/2 < x?” true or false?


• At first look, this answer comes to the mind: 9/2 < 9 ✓
True, because half of anything is of course smaller 1/2 < 1 ✓
• However, if we look carefully from mathematical point 0/2 < 0 
of view and also if we remember from Lecture 1, then:
0/2 = 0 ✓
For x > 0, it is true. But for x  0, it is false
• So, for some values of x it is true, for some values it is -9/2 < -9 
false -9/2 > -9 ✓
• We can also say, for all values of x it can be true of false
• Statements like “x/2 < x”, the terms “for some”, “for all”
--- all these fall into predicates and quantifiers
• Exercise: Can you find some other examples like this?

93
Predicates

• “x/2 < x?” can be represented as: P(x): x/2 < x


• Here x is a variable, P is called predicate and P(x) is
called propositional function
• P(x) does not have a truth value without a value of x
• If x gets a value, then P(x) becomes a proposition (true Predicates
or false) with values
• Example: Decide the truth value of P(0), P(-2) and P(3), become
where P(x): x/2 < x propositions
• P(0) is 0/2<0, which is 0 < 0. So, false
• P(-2) is -2/2<-2, which is -1<-2. So, false
• P(3) is 3/2<0, which is 1.5<3. So, true
• Exercise: Find truth values of P(x): x/2>x for x= 0, -2, 3

94
Predicates

• There can be two or more variables in a predicate


• Example: Consider P(x, y): x-y = -(y-x)
• Here, P(x, y) is true for all values of x and y
• Example: Consider P(x, y): x-y = -(y-x). Verify that P(x) is
true for P(3,2), P(0,0), P(-1,-2) Predicates
• P(3,2) is 3-2 = -(2-3), which is 1 = -(-1). This is true with values
• P(0,0) is 0-0 = -(0-0), which is 0 = -0, which is 0=0. become
So, true propositions
• P(-1,-2) is -1-(-2) = -(-2-(-1)), which is -1+2 = -(-2+1),
which is 1 = -(-1), which is 1 = 1, so true
• Exercise: Find some values of x, y, z so that P(x, y, z):
x+y < z becomes sometimes true and sometimes false

95
Quantifiers

• “For some value”, “for all value” are called quantifiers


• “For some value” is written as  and is called existential
quantifier
• “For all values” is written as  and is called universal : existential
quantifier quantifier
• P(x) with  or  is written as xP(x) or xP(x)
• xP(x) is read as “for some value of x, P(x)”
• xP(x) is read as “for all values of x, P(x)” : universal
• Example: If P(x): x < x*(-1), then xP(x) reads as “there quantifier
exists a value of x so that x < x*(-1)”
• Example: If P(x): x < x*(-1), then xP(x) reads as “for all
possible values of x, x < x*(-1)”

96
English vs. Mathematical Statements

• Propositions expressed in English can be written by


predicates and quantifiers, and vice versa
• Example: Consider the statement: All persons have
beard
• This statement can be written as: xB(x), where x : some
means a person and B(x) means x has beard
• Example: Consider this proposition: xH(x), where x is a
student in this class and H(x) means x got 100% : all
• This proposition can be written in English as “There
is a student in this class who got 100% marks
• Exercise: Write “A man died” by predicate and quantifier
• Exercise: Write in English xG(x), where G(x): x is a girl

97
Any, Every, All

• When  is expressed in English, the terms any, all, every


are used in same meaning
• Example: Consider this proposition: xG(x), where G(x):
x is a good student in this class
• This proposition can be stated in English as follows,
all of which have the same meaning: =
• All students in this class are good any, every,
• Any student in this class is good all, each
• Every student in this class is good
• Exercise: Consider xP(x), where P(x): x is a healthy man
in this city. Express this proposition by all, every, any as
above

98
Some, Exists, At least one

• When  is expressed in English, the terms some, exists,


at least one are used in same meaning
• Example: Consider this proposition: xG(x), where G(x):
x is a good student in this class
• This proposition can be stated in English as follows,  =
all of which have the same meaning:
some, exists,
• Some student in this class is good
• There exists a student in this class who is good at least one
• At least one student in this class is good
• Exercise: Consider xP(x), where P(x): x is a healthy man
in this city. Express this proposition by some, exists, at
least one as above

99
Quantifiers

• xP(x) and xP(x) are propositions and have truth values


• xP(x) is true if for at least one value of x, P(x) is true
• xP(x) is false if for every value of x, P(x) is false  true:
• Example: Suppose that, P(x): x = x*2. Then, xP(x) is true when one
• Because, for x = 0, we get 0 = 0*2, which is 0 = 0 and true
is true. So, for x=0, xP(x) is true
• Example: Suppose that, P(x): x = x-1. Then, xP(x) is false
• Because, no value of x can make x = x-1 (you can try)  false:
• Exercise: Explain whether xP(x) is true or false for the when all
following propositions: false
• P(x): x < x*2
• P(x): |x| < x

100
Quantifiers

• xP(x) is true if for any value of x, P(x) is true


• xP(x) is false if at least one of x makes P(x) false
• Example: Suppose P(x): x = x*2. Then, xP(x) is false  true:
• Because, many values of x can make xP(x) false when all
• For example, for x = 2, we get 2 = 2*2, which is false true
• Example: Suppose P(x): x > x-1. Then, xP(x) is true
• Because, x > x-1 means x-x > -1, which is 0 > -1. This
is true, irrespective of the value of x  false:
• Exercise: Explain whether xP(x) is true or false for the when one
following propositions: false
• P(x): x  x*2
• P(x): |x|  x

101
Domain

• Sometimes, P(x) is expresses by mentioning more


precisely the range or set of value of x
• That range is called the domain of x, or simply domain
• Domain can determine the truth value of P(x)
• Example: Suppose P(x): x2 ≥ x where the domain of x is
the set of all integers. Then xP(x) is true domain
• Because, 02 ≥ 0, (-1)2 ≥ 1, 22 ≥ 2, so on … [… ]
• Example: Suppose P(x): x2 ≥ x where the domain is real
numbers (remember, real numbers include fractions)
• Then, xP(x) is false, because for positive fraction
less than 1, such as 0.1, 0.2, 0.5, etc., x2 ≥ x is false
• For example, (-0.5)2 = 0.25 < 0.5

102
How  and  can be Related

• When xP(x) is true, then xP(x) is also true


• Because, x is true for all values of x, including the one
that makes xP(x) true  true
• Example: Suppose that, P(x): x2/2 is even, where the means
domain is even integers.  true
• Then xP(x) is true. Because, for any even x, x = 2k,
for some integer k. So, P(x): x2/2 = (2k)2/2 = 4k2/2 =
2k2 = even, where k2 is another integer  false
• Now, we can say that xP(x) is also true, because, means
xP(x) is true  false
• Exercise: Explain why xP(x) is false means xP(x) is
also false

103
Counterexample

• Remember, to make xP(x) false, a single value of x is


enough, although there may be many such values of x
• Showing xP(x) false with such a single value of x is
called counterexample Counter-
• Example: Suppose, P(x): x3+1 > x2, with domain of all example
integers. Show that xP(x) is false by a counterexample
=
• The counterexample can be shown for x = -1
• Because, P(-1): (-1)3+1 > (-1)2, which is -1+1>1, false only 1 value
• Exercise: Find counterexample to prove that the for false
following propositions are false:
• xP(x), with P(x): x is sour, where domain is all fruits
• xP(x), P(x): x is sweet, with domain of all fruits

104
Negation of Quantifiers

• Example: Consider the statement: “All workers got


bonus”. What is the negation of this statement?
• This is little tricky, as there can be two ways to think
1. No worker got bonus
2. Some worker did not get bonus not all
• Which one is correct?
=
• It becomes easy if we use predicate and quantifier
• The statement with predicate and quantifier some not
becomes: xB(x) with B(x): person x got bonus
• Now, remember, xB(x) becomes false when for
some x, B(x) is false (all values of x are not required)
• So, the second way is correct (continue …)

105
Negation of Quantifiers

• (Continued from the previous slide… )


• We can write “did not get bonus” as B(x)
• Then “some worker did not get bonus” becomes xB(x)
• Negation of xB(x) is written as xP(x)
• So, xB(x) is xB(x) (this is the answer) P(x)
• “xB(x) = xB(x)” holds for all universal quantifiers
=
• This is the De-Morgan’s law for universal quantifier
P(x)
De-Morgan’s Law: xB(x) = xB(x)
• Exercise: Why way (1) in the previous slide is not correct?
• Exercise: By De-Morgan’s Law find the negation of “all
students in this class passed the final exam”

106
Negation of Quantifiers

• Example: Consider this statement “Some worker got


bonus”. What is the negation of this statement?
• Again, there can be two ways to think for negation
1. No worker got bonus
2. Some worker did not get bonus not some
• With predicate and quantifier, the statement
=
becomes: xB(x) with B(x): x got bonus
• Now, remember, xB(x) becomes false when for all all not
x, B(x) is false (only some value of x is not enough)
• So, the first way is correct, which can be written as
“for every worker x, bonus was not given to x”
(continued …)

107
Negation of Quantifiers

• (Continued from the previous slide…)


• This can be written as xB(x)
• So, we get xB(x) = B(x) (this is the answer)
• Again, the above negation holds for all existential quantifiers
• This is actually the second part of De-Morgan’s law P(x)
De-Morgan’s Law: xB(x) = xB(x) =

• Exercise: Why way (2) in the previous slide is not correct? P(x)
• Exercise: By De-Morgan’s Law find the negation of:
• Some student in this class failed in the final exam
• Each of them attended the ceremony
• None of them missed the prayer

108
Negation of Quantifiers

• Example: Find the negation of x(x  1)


x(x  1)
= x (x  1) // by De-Morgan law  = 
= x (x < 1)
• Example: Find the negation x((x  1)(x < 5))  = 
• Solution: x((x  1)(x < 5))
= x((x  1)(x < 5)) // De-Morgan law
= x((x  1)(x < 5)) // De-Morgan law of Lecture 4
= x((x < 1)(x  5))
• Exercise: Find the negation of the followings:
(a) x(p→q) (b) x((x>1)→(x0)) (c) x((x0)(x0))
(d) x(pq) (e) x((x0)→(x<1)) (f) x((x0)(x0))

109
Nested Quantifiers

• Quantifiers can appear in more than one


• Example:
• Suppose that you have a robot at your home that
can sort out items based on their colors
• One day you give the robot this instruction: Put the
balls into the baskets by their colors
• The robot will translate this instruction like this:
• For all ball x and for some basket y, if color of x is
same as color y, then put x in y
• Here, we have both  (all) and  (some)
• Suppose that P(x,y): Put ball x in basket y
• Then the instruction becomes: xyP(x,y)

110
Nested Quantifiers

• Each variable in nested quantifier has its own quantifier


• Quantifiers are applied from left to right 
• Propositions with nested quantifiers have truth values

• Example: Consider this proposition: xy(x-y=0)
• It reads as “for any x, there is a y so that x-y is 0” 
• The truth value of this proposition is true 
• Because, for any x (say, x=5), we can take y same as x

(so, y=5 too)
• This makes x-y as x-x = 0 (like 5-5=0)
• So, x-y = 0 is true Meaning of
multiple
• So, for any x, we can find a y so that x-y = 0 is true quantifiers
• Therefore, xy(x-y=0) is true are tricky

111
Nested Quantifiers

• Order of quantifiers is important when the quantifiers


are mixed of  and 
• Changing the order between  and  may change the
meaning of the proposition
• Example:
• Consider the two propositions xy(x-y=0) and
  
yx(x-y=0)
• Here, P(x,y) remains same, but x and y swapped
• This swapping changes the meaning as well as the
truth value of the proposition
• The first one is the previous example and was true
• The second one will be false (see next example …)

112
Nested Quantifiers

• Example: yx(x-y=0) is false


• The proposition reads as “there exists a y such that
any value of x will give x-y=0”
• Why this proposition is false?
• Let us try some y
• Let, y=5. Then, for x=5, x-y is 5-5=0, which is true
  
• But for other x, say x=4, x-y is 4-5 = 0 is false
• Actually, for any y, we can take x=y-1. That will make
x-y=0 as (y-1)-y=0, which is -1=0. This is false
• So, for every y, there is an x so that x-y=0 is false.
• So, there is no y, for which x(x-y=0) is true
• So, yx(x-y=0) is false

113
Nested Quantifiers

• Example: Consider this proposition: xyz(x-y=z)



• It reads as “for any value of x and y, we can find a
value of z so that x-y becomes same as z” 
• This proposition is true. Why? 
• Because, if we take z=x-y, then x-y=z becomes true

• For example, take any x and any y, say x=7, y=2.
Then take z = x-y=7-2=5. So, x-y=z becomes 7-2=5, 
which is true
• Example: Consider this proposition: zyz(xyz=0)
• It reads as “there is a z, so that for any x and y, xyz=0 Meaning of
multiple
• This proposition is true quantifiers
• Because, for z=0, xyz=xy*0=0, irrespective of x and y are tricky

114
Nested Quantifiers

• Exercise: State the following propositions in English, and


then write and prove their truth values
• xyz(x+y>z) xyz =
• xyz(x+y>z) yzx =
• xy(xy=x) …
• xy(xyx)
• xyz(xy=z)
• Exercise: Explain what happens if you do some changes xyz =
in the ordering of the quantifiers in the following two zxy =
propositions (hint: no effect! See right-side box) …
• xyz(x+y<z)
• xyz(x+y<z)

115
Negation in Nested Quantifiers

• For multiple/nested quantifiers, negation works from


left to right
• De-Morgan law is applied for each quantifier one by one
from left to right
• Finally, the proposition is negated  = 
• Example: Find the negation of yx(x-y0)
yx(x-y0)
= yx(x-y0) // by De-Morgan law  = 
= yx(x-y0) // by De-Morgan law
= yx(x-y=0)
• Exercise: Find the negation of the following
propositions: (a) xyz(yz=x), (b) xyz(x+z→y)

116

You might also like