Professional Documents
Culture Documents
Midterm Solution
Problem 1.(8pts)
(a) (6pts) Construct a truth table for the statement
P =
(NOT Q) R .
(b) (2pts) State the contrapositive of the statement if n is prime, then n = 2 or n is odd.
Solution.
(a) (6pts) The truth table is
P Q R (NOT Q) (NOT Q) R P = (NOT Q R)
T T T
F
F
F
T T F
F
T
T
T
T
T
T F T
T F F
T
F
F
F
F
T
F T T
F
T
T
F T F
F F T
T
T
T
F F F
T
F
T
(b) (2pts) If n 6= 2 and n is even, then n is not a prime.
Problem 2.(12pts) Consider the following statement for any two numbers x and y, if x > y,
then x2 > y.
(a) (4pts) Write down this statement using mathematical quantifiers.
(b) (4pts) Write down and simplify the NOT of this statement. Your answer should not have
the word NOT in it.
(c) (4pts) Is the statement in (a) true if the universe of discourse is the set of positive real
numbers? Justify your answer.
Solution.
(a) (4pts)
x, y, (x > y = x2 > y)
(b) (4pts) Note that NOT (P = Q) is equivalent to P
AND (NOT Q), and NOT
is NOT. Thus, NOT x, y, (x > y = x2 > y) is equivalent to
x, y(x > y AND x2 y).
(c) (4pts) Over the positive real numbers, the statement is FALSE. The following is a counterexample. Let x = 1/2 and y = 1/3. Then x2 = 1/4 < 1/3 = y.
Problem 3.(9pts) A sequence {yn } is defined recursively by y1 = 16, y2 = 44, and
yn = 2yn1 + 3yn2 ,
n 3.
Consider n = k + 1. We have
yk+1 = 2yk + 3yk1
k+1
= 2[(1)
+ 5 3k ] + 3[(1)(k1)+1 + 5 3k1 ]
Thus the statement is true for n = k + 1 when it is true for 1 r k. By Principle of Strong
Induction,
yn = (1)n+1 + 5 3n ,
n P.
Problem 4.(11pts)
(a) (3pts) Determine the coefficient of
x3
1 6
2
in the expansion of 2x
.
x
n1
n1
k
k1
Solution.
6r
6
1
2 r
(a) (3pts) The general term is
(2x )
r
x
We want 2r + r 6
= 3 r = 3.
6
So the coefficient is
(2)3 (1)63 = (20)(8)(1) = 160
3
n1
n1
(b) (8pts)
k
k1
(n 1)!
(n 1)!
=
n 2k n
.
=
n
k
x
y 46134x + 2244y
Euclidean Algorithm q
q
1
0 46134
0
1 2244
46134 = 20 2244 + 1254 20 20
(20) row 2 + row 1
1
-20 1254
2244 = 1 1254 + 990 1 1
Solution.
21 990
1254 = 1 990 + 264 1 1
(1) row 3 + row 2 1
(1) row 4 + row 3
2 41 264
990 = 3 264 + 198 3 3
(3) row 5 + row 4 7
144 198
264 = 1 198 + 66 1 1
(1) row 6 + row 5
9 185 66 gcd
198 = 3 66 + 0
Thus we have
66 = 9 46134 185 2244,
and x = 9, y = 185 is a solution.
Problem 6.(8pts) Let a, b Z, not both zero. Prove that gcd(a, b) = gcd(3a + 2b, a + b).
Solution. Let d = gcd(a, b) and e = gcd(3a + 2b, a + b). We want to prove that d = e.
Since d|a and d|b, by Proposition 2.11(ii), d|(3a + 2b) and d|(a + b). Since d|(3a + 2b), d|(a + b) and
e = gcd(3a + 2b, a + b), we have d e.
Since e|(3a + 2b) and e|(a + b), by Proposition 2.11(ii), e|3(a + b) (3a + 2b), i.e., e|b. Since e|(a + b)
and e|b, by Proposition 2.11, e|(a + b) b, i.e., e|a. Since e|a, e|b, and d = gcd(a, b), we have e d.
Since d e and e d, we have d = e, i.e., gcd(a, b) = gcd(3a + 2b, a + b).
Problem 7.(5pts) Let a, b, c Z with c|ab and gcd(a, c) = 1. Prove that c|b.
Solution. Since c|ab, there exists q Z such that ab = qc.
Since gcd(a, c) = 1, by the Euclidean algorithm, there exist x, y Z, such that
1 = ax + cy.
Multiplying by b, we get
b = abx + bcy = qcx + bcy = c(qx + by).
Since qx + by Z, we have c|b.