Sie sind auf Seite 1von 4

CSE232: Discrete Mathematics

Midterm
Antoine Vigneron
April 28, 2016

1. Let p be the proposition I will do every exercise in this book and q be the proposition I
will get an A in this course. Express each of these as a combination of p and q using logical
operators.
(a) I will get an A in this course only if I do every exercise in this book.
(b) I will get an A in this course and I will do every exercise in this book.
(c) Either I will not get an A in this course or I will not do every exercise in this book.
(d) For me to get an A in this course it is necessary and sufficient that I do every exercise in
this book.
Answer.
(a) q p
(b) p q
(c) p q. Other possible answers: p q, p q
(d) p q
2. Are (p q) r and (p q) r logically equivalent? Prove your answer using a truth
table.
Answer.
p
T
T
T
T
F
F
F
F

q
T
T
F
F
T
T
F
F

r p q (p q) r p q (p q) r
T
T
T
T
T
F
T
F
T
F
T
F
T
F
T
F
F
T
F
T
T
T
T
F
T
F
T
F
F
T
T
T
T
F
T
F
T
F
F
T

As the 5th and the 7th column are not identical, these two compound propositions are not
logically equivalent.
1

3. Express the negations of each of these statements so that all negation symbols immediately
precede predicates.
(a) yxP (x, y)
(b) y(Q(y) xR(x, y))
(c) y(xzT (x, y, z) xzU (x, y, z))
Answer.
yxP (x, y) yxP (x, y)

(a)

yxP (x, y)
(b) y(Q(y) xR(x, y)) y(Q(y) xR(x, y))
y(Q(y) xR(x, y))
y(Q(y) xR(x, y))
(c) y(xzT (x, y, z) xzU (x, y, z)) y(xzT (x, y, z) xzU (x, y, z))
y(xzT (x, y, z) xzU (x, y, z))
y(xzT (x, y, z) xzU (x, y, z))

4.

Draw the Venn diagram for (A B) (B C) (C A).

Answer.
U

B
C

5.

Prove or disprove each of the following statements:

(a) (A B) (B A) = A.
(b) A (B C) = (A B) (A C).
(c) A (B C) = (A B) C.

Answer. (a) is false. Here is a counterexample: A = {0} and B = {1}. Then (A B) (B


A) = {1} = {1} =
6 A.
(b) is true. Here is a proof:
(A B) (A C) = {(x, y) | (x, y) (A B) (x, y)
/ (A C)}
= {(x, y) | x A y B ((x, y) (A C))}
= {(x, y) | x A y B (x A y C)}
= {(x, y) | x A y B (x
/ Ay
/ C)}
= {(x, y) | x A y B (x
/ Ay
/ C)}
= {(x, y) | (x A y B x
/ A) (x A y B y
/ C)}
= {(x, y) | F (x A y B y
/ C)}
= {(x, y) | x A y B y
/ C}
= {(x, y) | x A y (B C)}
= A (B C)
Another possible answer is to prove both inclusions A (B C) (A B) (A C)
and (A B) (A C) A (B C). Here is a proof of the first inclusion. Suppose that
(x, y) A (B C). Then x A, y B and y
/ C. So (x, y) A B and (x, y)
/ A C.
Therefore, (x, y) (A B) (A C).
The proof of the second inclusion is similar. Suppose that (x, y) (A B) (A C). Then
x A, y B, and (x, y)
/ A C. From x A and (x, y)
/ A C, we conclude that y
/ C. We
have just proved that x A, y B and y
/ C, which means that (x, y) A (B C).
(c) is false. Here is a counterexample. Take A = B = C = {0}. Then A (B C) = and
(A B) C = A 6= .
6. Let f be a from Z to Z. We denote by (2f ) the function from Z to Z defined by (2f )(n) =
2f (n) for every n Z. Prove or disprove the following statements:
(a) If f is one-to-one, then (2f ) is one-to-one.
(b) If f is onto, then (2f ) is onto.
Answer. (a) is true. Here is the proof. Suppose that (2f )(x) = (2f )(y) for x, y Z. Then by
definition, 2f (x) = 2f (y), and thus f (x) = f (y). As f is injective, it implies that x = y. (b) is
false. A counterexample is f = idZ , as the image of (2 idZ ) is the set of even integers.
7.

Prove that if x > 0 and x is irrational, then

x is irrational.

Answer. Assume that x is irrational and x > 0. For sake of contradiction, suppose that x

is rational. Then there exist integers p, q such that q 6= 0 and x = p/q. Therefore, x = p2 /q 2 .
Since p2 Z, q 2 Z, and q 2 6= 0, the number x is rational, contradicting our assumption that
it is irrational.
8.

Prove that bn/2c dn/2e = bn2 /4c for every integer n.

Answer.

We split into two cases: either n is even, or n is odd.

If n is even, then n = 2k for some integer k, so the left-hand side is bn/2c dn/2e =
bkc dke = k 2 and the right-hand side is bn2 /4c = b4k 2 /4c = k 2 .
If n is odd, then n = 2k + 1 for some integer k, so the left-hand side is bn/2c dn/2e =
bk + 21 c dk + 12 e = k(k + 1) and the right-hand side is
 

1
4k 2 + 4k + 1
= k(k + 1) +
= k(k + 1).
bn /4c =
4
4


9. Find a P
closed form of Un =
the symbol
does not appear.)
Answer.
Un =

n
X
k=1

10.

n
X
k=1

Pn

k=1 k

(k 1)2 . (That is, find an expression of Un where

(k 1) =

n
X

k=1

n1
X

k =

k=0

n
X
k=1

n1
X

k 2 = n2

k=1

Find gcd(1104, 816) using the Euclidean algorithm. Show the details of your calculations.

Answer. 1104 = 816 + 288 so gcd(1104, 816) = gcd(816, 288).


816 = 2 288 + 240 so gcd(816, 288) = gcd(288, 240)
288 = 240 + 48 so gcd(288, 240) = gcd(240, 48)
240 = 5 48 so gcd(240, 48) = gcd(48, 0) = 48
The result is: gcd(1104, 816) = 48.
11. Prove that there are no solutions in integers x and y to the equation x2 5y 2 = 2. [Hint:
Consider this equation modulo 5.]
Answer. Suppose there exist integers x and y such that x2 5y 2 = 2. Then we must have
x2 5y 2 2 (mod 5). As 5y 2 0 (mod 5), it implies that x2 2 (mod 5). Now we show that
this is impossible using a proof by case.
If x 0 (mod 5), then x2 0(mod 5), a contradiction.
If x 1 (mod 5), then x2 1(mod 5), a contradiction.
If x 2 (mod 5), then x2 4(mod 5), a contradiction.
If x 3 (mod 5), then x2 9(mod 5), so x2 4(mod 5), a contradiction.
If x 4 (mod 5), then x2 1(mod 5), a contradiction.

Das könnte Ihnen auch gefallen