Predicate logic problems solved

CS243-In-class exercises on predicate logic
September 21, 2012
Here is a collection of exercises from a Discrete Mathematics textbook. Variables and constants denote students in a class. M (x, y) means that x has sent
an e-mail message to y, and T (x, y) means that x has called y on the telephone.
These relations are not symmetric; for instance, if I sent you an e-mail, that does
not mean that you sent me an e-mail. However, you should assume for purposes
of this probem that if x sent an e-mail message to y, then y received an e-mail
message from x.
(a) Joe has never sent an e-mail message to Kim.
¬M (Joe, Kim).
(b) Arlene has never sent an e-mail message or telephoned Sarah.
¬(M (Arlene, Sarah) _ T (Arlene, Sarah)).
Equivalently, you could write
¬M (Arlene, Sarah ^ ¬T (Arlene, Sarah).
(c) Every student in the class has sent an e-mail message to Ken.
8xM (x, Ken).
(d) No one in the class has telephoned Nina.
Equivalently,
8x¬T (x, Nina).
¬9xT (x, Nina).
1
(e) Everyone in the class has either telephoned Avi or sent him an e-mail message.
8x(M (x, Avi) _ T (x, Avi)).
(f) There is a student in the class who has sent an e-mail to everyone else in the
class.
9x8y((x 6= y) ! M (x, y)).
(What is the di↵erence between this and the following simper formula? Are they
equivalent?)
9x8yM (x, y).
They’re not equivalent, since the second includes the student sending e-mail to
himself.
(g) There is a student in the class who has e-mailed or telephoned everyone else
in the class.
9x8y((x 6= y) ! (M (x, y) _ T (x, y))).
(h) There are two di↵erent students in your class who have sent each other e-mail
messages.
9x9y((x 6= y) ^ M (x, y) ^ M (y, x)).
(i) There is a student who has sent an e-mail to himself or herself.
9xM (x, x)
(k) Every student in the class has been called or e-mailed by every other student
in the class.
2
8x8yy((x 6= y) ^ (M (y, x) _ T (y, x))).
As was pointed out to me by an alert student, the original answer that appeared
for this was incorrect.
(l) Some student in the class has never been called or e-mailed by any other student
in the class.
9x8y((x 6= y) ! (¬M (y, x) ^ ¬T (y, x))).
(m) There are at least two students in the class such that the first one has sent
the second e-mail, and the second has telephoned the first.
9x9y((x 6= y) ^ M (x, y) ^ T (y, x)).
(n) There are two di↵erent students in the class who between them have sent
an e-mail to or telephoned every other student in the class. (This includes the
case where the two students in question have never received a telephone call or an
e-mail.
9x9y8z(((z 6= x) ^ (z 6= y)) ! (M (x, z) _ T (x, z) _ M (x, z) _ M (y, z))).
2. Each of the following sentences expresses something about numbers. Translate into English what is being stated. Then tell whether the property is true
if (i) we interpret the sentence in the set of positive integers {1, 2, 3, . . .}; (ii) we
interpret the statement in the set of all real numbers —these include negative and
p
positive numbers, fractional values like 2.35 and 59 , irrational numbers like 2
and ⇡.
(a) 9x8y(xy = y).
This says that there is a number x with the property that xy = y for any
number y. (It’s hard to say this in ‘natural’ English!) In other words, there is a
3
multiplicative identity element. x = 1 works (and is the only such number) whether
we interpret in the real numbers or the positive integers.
(b) 9y8x(xy = y).
Solution: There is a number y such that xy = y for any number x. In other words,
multiplying y by another number does not change its value. This is true in the
real numbers — y = 0 is the only number with this property. It is false in the
positive integers, since 2y 6= y for any y you choose.
(c)
8x8y(((x < 0) ^ (y < 0)) ! (xy > 0)).
Solution: The product of two negative numbers is positive. This is true in the
real numbers. It is not even a legal sentence about the positive integers, because
of the presence of the constant 0.
(d)
9x9y((x2 > y) ^ (x < y)).
There are two numbers x and y such that the square of x is bigger than y and
x is less than y.
There are numbers x and y such that x is less than y which in turn is less than
x2 . This is true in both the reals and the positive integers. (x = 1 and y = 2
works, but there are infinitely many other examples).
(e)
8x8y9z(x + y = z).
This just says that the sum of two numbers is a number, which is true in both
domains. (f)
8x8z9y(x + y = z).
This says that the di↵erence of two numbers is a number (in other words, given
x and z there is a number y satisfying x + y = z; in e↵ect y = z x. This is true
for real numbers but false in general for positive integers, since it does not hold
when x > z.
4