CSE390D Notes for Monday, 9/30/24
nested quantifiers
Understanding some propositions with nested quantifiers:
(all x)(all y)(x + y = y + x) commutative law for addition
(all x)(exists y)(x + y = 0) additive inverse
more complicated:
(all x)(all y)((x > 0) ^ (y < 0) -> (xy < 0))
the product of a positive and negative is always negative
loop analogy
(all x)(all y)P(x, y)
for (d1 : domain) {
for (d2 : domain) {
if (!P(d1, d2)) {
return false;
}
}
}
return true;
(all x)(exists y)P(x, y)
for (d1 : domain) {
flag = false;
for (d2 : domain) {
if (P(d1, d2)) {
flag = true;
}
}
if (!flag) {
return false
}
}
return true;
(exists x)(all y)P(x, y)
for (d1 : domain) {
flag = true;
for (d2 : domain) {
if (!P(d1, d2)) {
flag = false
}
}
if (flag) {
return true
}
}
return false
(exists x)(exists y)P(x, y)
for (d1 : domain) {
for (d2 : domain) {
if (P(d1, d2)) {
return true
}
}
}
return false
Example:
let Q(x, y) denote "x + y = 0"
(exists y)(all x)Q(x, y) -- some y that always sums to 0, false
(all x)(exists y)Q(x, y) -- every x has y that sums to 0, true
Example:
let C(x) denote "x has a computer", F(x, y) denote "x and y are friends"
(all x)(C(x) V (exists y)(C(y) ^ F(x, y)))
everyone either has a cmputer or has a friend with a computer
Example:
let F(x, y) denote "x and y are friends"\
(exists x)(all y)(all z)(F(x, y) ^ F(x, z) ^ (y != z) -> ~F(y, z))
there is a student none of whose friends are friends with each other
Example:
If a person is female and is a parent, then this person is someone's mother
F(x) "x is female", P(x) "x is a parent", M(x, y) "x is y's mother"
(all x)(F(x) ^ P(x) -> (exists y)M(x, y))
Example:
Everyone has exactly one best friend
B(x, y) "x and y are best friends"
(all x)(exists y)(B(x, y) ^ (all z)((z != y) -> ~B(x, z)))
Example:
negation of (all x)(exists y)(xy = 1)
~(all x)(exists y)(xy = 1)
(exists x)~(exists y)(xy = 1)
(exists x)(all y)~(xy = 1)
(exists x)(all y)(xy != 1)
Example:
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.
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
f) There is somebody whom no one loves
g) There is exactly one person whom everybody loves
g) There are exactly two people whom Lynn loves
h) There are exactly two people who Lynn loves
i) Everyone loves himself or herself
j) There is someone who loves no one besides himself or herself
Stuart Reges
Last modified: Mon Sep 30 12:46:48 PDT 2024