Discrete Structures: Sample Questions, Exam 1

Transcription

Discrete Structures: Sample Questions, Exam 1
Discrete Structures: Sample Questions, Exam 1
SOLUTIONS
(This is longer than the actual test.)
1. Prove by mathematical induction that n3 −n is a multiple of 3 for every
positive integer n.
Solution: The basis step is n = 1. That is, that 13 − 1 = 0 should be
a multiple of 3, which it is.
For the inductive step let P (n) be the statement that n3 −n is a multiple
of 3. In other words, there is an integer k so that n3 − n = 3k. To show
the inductive step P (n) → P (n + 1), consider the inductive conclusion
P (n + 1), which is that (n + 1)3 − (n + 1) is a multiple of 3.
So compute
(n + 1)3 − (n + 1) =
=
=
=
=
=
=
(n + 1)[(n + 1)2 − 1]
(n + 1)(n2 + 2n + 1 − 1)
(n + 1)(n2 + 2n)
n3 + 3n2 + 2n
(n3 − n) + (3n2 + 3n)
3k + 3(n2 + n) by the inductive hypothesis
3(k + n2 + n),
which is a multiple of 3. Thus we have shown the inductive step P (n) →
P (n + 1). So by induction, n3 − n is always a multiple of 3 for each
n ≥ 1.
2. Show that any postage of 8 cents or more can be achieved by using
only 3-cent and 5-cent stamps.
Solution: We proceed by induction. There are 3 basis steps. This
corresponds to the fact that the smaller stamp is for 3 cents.
Basis case n = 8: 8 = 5 + 3 one 5-cent stamp plus one 3-cent stamp.
Basis case n = 9: 9 = 3 + 3 + 3 three 3-cent stamps.
Basis case n = 10: 10 = 5 + 5 two 5-cent stamps.
Inductive case. We will add 3-cent stamps to prove the result. If
we can make n cents out of 3- and 5-cent stamps, then we can add
another 3-cent stamp to the total to make n + 3 cents. This shows
P (n) → P (n + 3).
It remains to note that we can reach any integer n ≥ 8 by starting at
one of the 3 base cases and adding nonnegative multiple of 3. Starting
at 8, we get 8, 11, 14, 17, 20, . . .; starting at 9, we get 9, 12, 15, 18, 21, . . .;
starting at 10, we get 10, 13, 16, 19, 22, . . .. This covers all the integers
≥ 8. (It’s possible to make a more rigorous argument by considering n
mod 3 for n ≥ 8.)
3. (a) For x a real number, write down the definition of the absolute
value |x| by cases.
Solution:

 x for x > 0
0 for x = 0
|x| =

−x for x < 0
(b) Prove by cases: If x, y ∈ R and y 6= 0, then
x |x|
=
y |y| .
Solution: We have 6 cases:
Case 1: x > 0 and y > 0. Then
x
y
x x
= ,
y y
|x|
x
= .
|y|
y
Case 2: x > 0 and y < 0. Then
x
= −x,
y
y
x
y
< 0 and
|x|
x
x
=
=− .
|y|
(−y)
y
Case 3: x = 0 and y > 0. Then
x
= 0,
y
> 0 and
x
y
= 0 and
|x|
0
= = 0.
|y|
y
Case 4: x = 0 and y < 0. Then
x
= 0,
y
x
y
< 0 and
|x|
(−x)
x
=
=− .
|y|
y
y
Case 6: x < 0 and y < 0. Then
x x
= ,
y y
= 0 and
0
|x|
=
= 0.
|y|
(−y)
Case 5: x < 0 and y > 0. Then
x
= −x,
y
y
x
y
x
y
> 0 and
|x|
(−x)
x
=
= .
|y|
(−y)
y
4. Write out the truth table for (p ∨ q) → (p ∧ q).
Solution:
p
T
T
F
F
q p ∨ q p ∧ g (p ∨ q) → (p ∧ q)
T
T
T
T
F
T
F
F
T
T
F
F
F
F
F
T
5. Consider the function f (x) = 5x3 + 4, where f : R → R. Find the
inverse function.
Solution: If y = 5x3 + 4, solve for x
y = 5x3 + 4,
y − 4 = 5x3 ,
1
(y − 4) = x3 ,
5
q
3
1
(y
5
− 4) = x.
6. Let an be the sequence recursively defined by a1 = 2, a2 = 3, an =
an−1 an−2 for n ≥ 3. Compute the first five terms a1 , . . . , a5 .
Solution: a1 = 2, a2 = 3, a3 = a1 a2 = 6, a4 = a3 a2 = 18, a5 = a4 a3 =
144.
7. Let P (x) be the statement x is a student, and Q(x) be the statement x
buys the meal plan. Consider the statement “Every student buys the
meal plan.”
(a) Write the statement symbolically.
Solution: ∀x(P (x) → Q(x)).
(b) Write the negation of the previous proposition symbolically, and
also in words.
Solution: The negation is
¬∀x(P (x) → Q(x)) ≡ ∃x¬(P (x) → Q(x)) ≡ ∃x(P (x) ∧ ¬Q(x)).
In words, this say that there is a student who does not buy the
meal plan.
8. True/False. Circle T or F. No explanation needed.
(a)
T
F
(b)
T
F
(c)
T
F
(d)
T
F
(e)
T
F
(f)
T
F
(g)
T
F
(h)
T
F
(i)
T
F
(j)
T
F
(k)
T
F
If p is true and q is false then determine p → q.
Solution: F.
If p is false, and the truth values of q, r are unknown,
then determine (p ∧ q) → r.
Solution: T, since if p is false, then p ∧ q is false no
matter what q is. Similarly, if p ∧ q is false, the implication (p ∧ q) → r is true no matter what the value of r
is.
(p → q) ∧ (q → p) ≡ (p ↔ q).
Solution: T.
(p → q) ∨ (q → p) ≡ (p ↔ q).
Solution: F. For example if p = T and q = F , then
p ↔ q is false, but (p → q) ∨ (q → p) = (T → F ) ∨ (F →
T ) = F ∨ T = T.
(The domain of discourse for (e)-(g) is Z.)
∀n∃m(n = m2 ).
Solution: F. For
√ n = 2, there is no integer m so that
2 = m2 (since ± 2 is not an integer).
∃n∀m(nm = n).
Solution: T. n = 0 works, since for all m, nm = 0·m =
0 = n.
∀n(n2 + 1 > 0).
Solution: T. Since n2 ≥ 0, we have n2 + 1 ≥ 1 > 0.
Let f : R → R be given by f (x) = 3x − 5. Then f is
one-to-one.
Solution: T. If y = 3x − 5, then x = 13 (y + 5). So for
each y, there is only one x so that y = 3x − 5.
f from (h) is onto.
Solution: T. See (h) above.
For f from (h), f −1 (x) = 3x + 5.
Solution: F. f −1 (x) = 13 (x + 5), as we compute in (h)
above.
Consider A = {0, 1, 2, 3}. The function g : A → A
defined by g(x) = 2x mod 4 is a bijection.
Solution: F. Compute g(0) = 0, g(1) = 2, g(2) = 0,
and g(3) = 2. This shows g is not onto (since 1 and 3
are not in the range), and also g is not one-to-one, since
g(0) = g(2).
(l)
T
F
(m)
T
F
(n)
T
F
(o)
T
F
(p)
T
F
(q)
T
F
(r)
T
F
(s)
T
F
(t)
T
F
(u)
T
F
(v)
T
F
(w)
T
F
(x)
T
F
(y)
T
F
(z)
T
F
For A as in (k), the function h : A → A defined by
h(x) = 3x mod 4 is a bijection.
Solution: T. Compute h(0) = 0, h(1) = 3, h(2) = 2,
h(3) = 1. This is clearly one-to-one and onto, and thus
is a bijection.
If X, Y are subsets of a universal set U , then X ∩ Y =
X ∪Y.
Solution: T. This is DeMorgan’s Law.
For X, Y as in (m), it is always true that |X ∪ Y | =
|X| + |Y |.
Solution: F. This is false (for finite sets) if X and Y
are not disjoint. So if X = {1, 2}, and Y = {2, 3}, then
X ∪ Y = {1, 2, 3}, and |X ∪ Y | = 3 6= 2 + 2 = |X| + |Y |.
If V = {1, 2, 3} and W = {a, b, c, d}, then there exists a
one-to-one function f : V → W .
Solution: T. For example, define f by f (1) = a, f (2) =
b, f (3) = c.
For V, W as in (o), there exists an onto function g : V →
W.
Solution: F. If f : V → W , then the range
{f (1), f (2), f (3)} can have at most 3 elements. This
cannot cover all of W , whose cardinality is 4.
If A, B are sets, then A ∩ B = B ∩ A.
Solution: T.
Again A, B are sets. Then (A ⊆ B) ∨ (B ⊆ A).
Solution: F. For example, A = {1} and B = {2} give
a counterexample.
If A, B are sets, then (A − B) ∪ B = A ∪ B.
Solution: T. Draw the Venn diagram.
If A, B are finite sets, then |A ∩ B| + |A ∪ B| = |A| + |B|.
Solution: T. Draw the Venn diagram.
For (u)-(w), the domain of discourse is R.
∀x∃y(x = 2y).
Solution: T. Take y = 21 x.
∃x∀y(xy = y).
Solution: T. x = 1 works.
∀x(x2 > 0).
Solution: x = 0 is a counterexample.
For all integers n ≥ 1, n! < 10n2 .
Solution: F. The first counterexample is n = 6: 6! =
720 but 10n2 = 360.
Any conditional proposition is logically equivalent to its
converse.
Solution: F.
Any conditional proposition is logically equivalent to its
contrapositive.
Solution: T.