07 Quiz 1 Solutions

Quiz 1, Fall 2007
Mon 8 Oct 07
Professor J. L. Gross
CS W3203 Discrete Math
DISCRETE MATH1 W3203 Quiz 1
open book
SOLUTIONS
_________________________________
Your Name (2 pts for LEGIBLY PRINTING your name on this line)
Problem Points Score
your name 2
1
10
2
12
3
18
4
10
5
22
6
26
_______________________
Total
100
SUGGESTION: Do the EASIEST problems first!
HINT: Some of the solution methods involve pre-college
math as well as new methods from this class.
1An example of the Reasonable Person Principle: A reasonable student expects to lose a lot of credit for
neglecting to EXPLAIN an answer. Omit explanations at your own risk.
W3203F07Q1sol.doc
0 of 7
9/12/10
Quiz 1, Fall 2007
Mon 8 Oct 07
Professor J. L. Gross
CS W3203 Discrete Math
1 (10 pts). Use a truth table to decide whether this argument is valid.
p ∨q
premise 1
q ∨r
premise 2
∴ p ∨ r conclusion
SOLUTION: NOT valid.
prem 1
prem 2
p q r
T T T
T T F
T F T
T F F
F T T

p ∨q
T
T
T
T
T
F T F
F F T
F F F
T
F
F
T
T
F
W3203F07Q1sol.doc

q ∨r
T
T
T
F
T
conclu

*
*
*
*
p ∨r
T
T
T
*
T
*
F
1 of 7
9/12/10
Quiz 1, Fall 2007
Mon 8 Oct 07
Professor J. L. Gross
CS W3203 Discrete Math
2 (12 pts). In which (perhaps none, perhaps one or more) of the
following domains
{0,1}, Z(integers), ∅, {∅,{∅}}
is the given statement true. No proofs required.
2a (4). (∃x ∈ D)(∃y ∈ D)(∀z ∈ D)[x ≠ y ∧ (z = x ∨ z = y)]
SOLUTION: This is true of 2-element domains.
{0,1}, {∅,{∅}}
2b (4). (∃x ∈ D)(∀y ∈ D)(∃z ∈ D)[x ≠ y ∧ (z = x ∨ z = y)]
SOLUTION: This is never true.
2c (4). (∀x ∈ D)(∃y ∈ D)(∃z ∈ D)[x ≠ y ∧ (z ≠ x ∧ z ≠ y)]
SOLUTION: This is true of ∅ and of domains with at least
three elements.
∅, Z(integers)
W3203F07Q1sol.doc
2 of 7
9/12/10
Quiz 1, Fall 2007
Mon 8 Oct 07
Professor J. L. Gross
CS W3203 Discrete Math
3 (18 pts). To prove that (2n + 2)2 ∈ O(n 2.5 ) , one must prove that
⎡
⎤
(∃c ∈ R)(∃k ∈ R)(∀n ≥ k) ⎢(2n + 2)2 ≤ c ⋅n 2.5 ⎥
⎣
⎦
3a (8). Can c = 10 and k = 5 be witnesses? (Give a proof!)
SOL: (2n + 2)2 = 4(n 2 + 2n + 1) < 4 ⋅ 4n 2 (for n ≥ 1)
< 10 5.n 2 ≤ 10n 2.5 (for n ≥ 5)
3b (10). Suppose that c = 1 is a required witness. What witness
might you use for k ? (Give a proof, of course!)
SOL: k = 162 = 256.
Pf : (2n + 2)2 < 4(n 2 + 2n + 1) < 4 ⋅ 4n 2 = 16n 2
≤ 1 ⋅ n 2.5 if
W3203F07Q1sol.doc
n ≥ 16, i.e. if n ≥ 162
3 of 7
9/12/10
Quiz 1, Fall 2007
Mon 8 Oct 07
Professor J. L. Gross
CS W3203 Discrete Math
4a (6). Prove that for every integer x
⎢x ⎥ ⎡x ⎤
⎢ ⎥+⎢ ⎥=x
⎣2⎦ ⎢2⎥
⎢x ⎥ ⎡x ⎤ x
Pf: If x is even, then ⎢ ⎥ = ⎢ ⎥ = .
⎣2⎦ ⎢2⎥ 2
⎢x ⎥
⎣2⎦
If x is odd, then ⎢ ⎥ =
x−1
2
⎡ x ⎤ x +1
and ⎢ ⎥ =
.
2
2
⎢ ⎥
4b (4). Prove that the equation above is always false if x is not an
integer.
⎢x ⎥ ⎡x ⎤
⎣2⎦ ⎢2⎥
cannot equal x unless x is an integer.
Pf: The sum ⎢ ⎥ + ⎢ ⎥ of two integers is an integer. Thus, it
W3203F07Q1sol.doc
4 of 7
9/12/10
Quiz 1, Fall 2007
Mon 8 Oct 07
Professor J. L. Gross
CS W3203 Discrete Math
5a (6). Calculate gcd(36685, 737) by prime power factorization.
Hint: do part (b) first.
SOL: 36685 = 11 ⋅ 5 ⋅ 667 = 29 ⋅ 23 ⋅11 ⋅ 5
737 = 11 ⋅ 67
gcd(36685,737) = 11
5b (8). Calculate gcd(36685, 737) by the Euclidean algorithm.
N
36685
737
572
165
77
D
Q
737
572
165
77
11
R
49
1
3
2
7
572
165
77
11
0
5c (8). Find integers M and N such that
36685M + 737N = gcd(36685, 737).
Hint: divide both sides by gcd(36685, 737) to simplify.
N
3335
67
52
15
7
D
Q
67
52
15
7
1
R
49
1
3
2
7
52
15
7
1
0
1 = 15 − 2 ⋅ 7 = 15 − 2(52 − 3 ⋅ 15) = −2 ⋅ 52 + 7 ⋅ 15
= −2 ⋅ 52 + 7(67 − 52) = 7 ⋅ 67 − 9 ⋅ 52
= 7 ⋅ 67 − 9 ⋅ (3335 − 49 ⋅ 67) = −9 ⋅ 3335 + 448 ⋅ 67
M = −9 N = 448
W3203F07Q1sol.doc
5 of 7
9/12/10
Quiz 1, Fall 2007
Mon 8 Oct 07
Professor J. L. Gross
CS W3203 Discrete Math
6a (10 pts). Calculate 7321453 mod19 .
SOL: 7321453 mod19 = 101453 mod19 (since 732 mod19 = 10)
13
= 10
mod19 (Fermat) ≡ 1006 ⋅ 10 ≡ 56 ⋅ 10 ≡ 253 ⋅ 10
3
≡ 6 ⋅ 10 ≡ 216 ⋅ 10 ≡ 7 ⋅ 10 ≡ 13
6b (3 pts). List all the numbers between 1 and 23 that have a
multiplicative inverse mod 24.
SOL: 1,5,7,11,13,17,19, 23
6c (5 pts). Find the multiplicative inverse of 11 mod 24.
SOL: 11 (test the candidates in 6b)
or use extended Euclidean algorithm.
6d (10 pts). Calculate 49121 mod18 . N.B. 18 is NOT prime.
SOL: 73 = 343 ≡ 1mod18; 49121 = 7240 ⋅ 49 = (73 )80 ⋅ 49
≡ 1 ⋅ 49 mod18 ≡ 13
WRONG: 49121 ≡ 492 mod18 (Fermat) ≡ 7 4 ≡ 7
W3203F07Q1sol.doc
6 of 7
9/12/10