Slecture3 Annotated
Slecture3 Annotated
Reading: EC 1.4
Peter J. Haas
INFO 150
Fall Semester 2019
Lecture 3 1/ 15
Predicates
Simple Predicates and Their Negations
Predicates and Sets
Quantified Predicates
Negating Quantified Predicates
Multiple Quantifiers and Their Negation
Lecture 3 2/ 15
Simple Predicates
Definition
A predicate P(x) is a statement having a variable x such that
whenever x is replaced by a value, the resulting proposition is
unambiguously true or false. For multiple variables, we write
P(x1 , x2 , . . .).
Lecture 3 3/ 15
Simple Predicates
Definition
A predicate P(x) is a statement having a variable x such that
whenever x is replaced by a value, the resulting proposition is
unambiguously true or false. For multiple variables, we write
P(x1 , x2 , . . .).
Lecture 3 3/ 15
Simple Predicates
Definition
A predicate P(x) is a statement having a variable x such that
whenever x is replaced by a value, the resulting proposition is
unambiguously true or false. For multiple variables, we write
P(x1 , x2 , . . .).
RCB
RG )=f
=
RC 5)
-
IF Ras )=T
Lecture 3 3/ 15
Negation of Simple Predicates
Example:
P(x) ¬P(x)
x >5 ¬(x > 5) ⌘ x 5 Equivalent for all values of x
(x > 0) ^ (x < 10) (x 0) _ (x 10) Demory 's Law an
Example 2: P(x, y ) = (x 0) _ (y 0)
I ) ) Demory
Law again ans
'
Lecture 3 4/ 15
Predicates and Sets
Informal Definition
A set is a collection of objects, which are called elements or
members.
fix 2,3 ,
4,447,819,10
(x + 1) is divisible by 3 2. 5,8 Htt ) notdiv.by 's
43,416,7 ,
9,10
x >0 all XSO none
P(x) True for these members of D True for at least one? True for all?
x <0 -
I Yes No
x2 < x None No NO
Quantifier notation
I 2: “in” or “belonging to” (set membership) ex : -
I C-
D
I 8: “for all” or “for every”
I 9: “there is (at least one)” or “there exists (at least one)”
Lecture 3 6/ 15
Quantified Predicates
Definitions
Quantified predicate: A predicate with one or more quantifiers
Counterexample: Example showing that a “for all” statement is false
D
-
,
,
I me
D m 33 C True
,
K =3
]
,
Lecture 3 7/ 16
Quantified Predicates
Definitions
Quantified predicate: A predicate with one or more quantifiers
Counterexample: Example showing that a “for all” statement is false
I 8n 2 D, n >
the
2:
set D [ false : n
-
- -2 is a counterexample ]
for
-2
all n in h >
,
I 9n 2 D, n > 2:
For at least one n in the set D
,
n >
-
L [ True ]
I 8n 2 D, (n >
]
3) ^ (n < 3):
23 lie -32 n c 3) [ True
the set D and
For all
n
3
.
,
n in no -
I 9m 2 D, m > 10:
that C false ]
at least ED such on > lo
exists one m
There
Lecture 3 8/ 16
Specify the Domain!
For each quantified statement, determine the domain D and rewrite formally. If the
domain is ambiguous, give examples of how di↵erent domains can change the truth
of the statement.
I R = the real numbers (R>0 = positive real numbers)
I Z = the integers, i.e., {0, ±1, ±2, ±3, . . .}
1. For all x, x 2 x
I If D = R: 8x 2 R, x 2 x [false since x = 0.5 is a counterexample]
I If D = Z: 8x 2 Z, x 2 x [true]
2. 8 even integer m, m ends in the digit 0, 2, 4, 6, or 8
I D = set of even integers: 8m 2 D, m ends in the digit 0, 2, 4, 6, or 8
Lecture 3 9/ 16
Negating Quantified Statements: Example
1. 8d 2 D, d < 2:
do D such that
d 3
-
L
There exists
I d. 6 D d 's -2
,
element of D
2. 9m 2 D, m > 10:
is g to
Every
Ume D m s
10
,
Lecture 3 10/ 16
Negating Quantified Statements in General
Proposition
1. The negation of 8x 2 D, P(x) is 9x 2 D, ¬P(x)
2. The negation of 9x 2 D, Q(x) is 8x 2 D, ¬Q(x)
Lecture 3 11/ 16
Negating Quantified Statements in General
Proposition
1. The negation of 8x 2 D, P(x) is 9x 2 D, ¬P(x)
2. The negation of 9x 2 D, Q(x) is 8x 2 D, ¬Q(x)
Example: For D = { 1, 0, 1, 2}, write the negation & determine which version is true
,
)
HA
YAH FIXED Cx Cx
o n
2): Ix ED, txt
>
1. 8x 2 D, (x 0) _ (x ,
thx )
④
↳
2. 9x 2 D, (x < 0) _ (x 2 > 0): ED
,
ex > o ) Nx o
the D
,
xn > x TO
Lecture 3 11/ 16
Multiple Quantifiers
Lecture 3 12/ 16
Multiple Quantifiers
Lecture 3 12/ 16
Mixed Quantifiers
Lecture 3 13/ 16
Mixed Quantifiers
problem
solution
For
problems there exists a
every ,
Lecture 3 13/ 16
Playing the Truth Game
1. 8x 2 Z, 9y 2 Z, x + 2y = 3 ⑦
take 4=2 :
I
implies 2yd
implies y¢
2 thy =3
15 x
⑤ choose y
-
-
2. 8x 2 Z, 9y 2 Z, x + y = 15
-
3. 9y 2 Z, 8x 2 Z, x + y = 15 ④
because
You can't possibly win
first
You go
Lecture 3 14/ 16
Negating Multiple Quantifiers
Apply our proposition from left to right:
I The negation of 8x 2 D, P(x) is 9x 2 D, ¬P(x)
I The negation of 9x 2 D, Q(x) is 8x 2 D, ¬Q(x)
Example 1
Lecture 3 15/ 16
Negating Multiple Quantifiers
Apply our proposition from left to right:
I The negation of 8x 2 D, P(x) is 9x 2 D, ¬P(x)
I The negation of 9x 2 D, Q(x) is 8x 2 D, ¬Q(x)
Example 1
Example 2
Lecture 3 15/ 16
Negating Multiple Quantifiers: Examples
+
-
Jxek.o.V-c.IR
text
)Vlxtytrx)§onisPal€
in
mythic
I 9x 2 Z, 8y 2 Z, x · y 0: ④ Take 1=0
yetU XEII x
if > o
.
, ,
I 8x, y , z 2 Z, x 2 + y 2 + z 2 0 TO
47942220
I xjyp.CI ,
Lecture 3 16/ 16