Discrete Mathematics (550.171) Exam I Solutions To Practice Problems
Discrete Mathematics (550.171) Exam I Solutions To Practice Problems
171) Exam I
Solutions to Practice Problems
B
F
T
F
T
If A then B
Possible
Possible
Impossible
Possible
If B then A
Possible
Impossible
Possible
Possible
B = A,
C = {y U : 2|y}.
What is
(a) 2B ?
(b) B M C?
ANSWERS: A = {3, 6, 9}, B = {2, 5, 8}, C = {2, 6, 8}.
(a) 2B = {, {2}, {5}, {8}, {2, 5}, {2, 8}, {5, 8}, {2, 5, 8}}
(b) B M C = (B C) (C B) = {5} {6} = {5, 6}
3. Consider the following fragment of code (italicized text are comments)
a = 0
b = 0
for j = 1 to 50
if 2|j
a = a + 1
if 3|j
b = b + 1
end if (3|j)
end if (2|j)
end for
end
Let A and B be sets such that after the for loop has finished all of its iterations,
|A| = a and |A B| = b.
(a) Use set builder notation to describe A and B.
ANSWER: Let U = {x N : 1 x 50}. Then A = {x U : 2|x}, and
B = {x U : 3|x}.
(b) Use the inclusion-exclusion principle to determine |A B|.
ANSWER: Since half of the numbers U are even, a = |A| = 25. By similar
reasoning, since 3(16) = 48, |B| = 16. Since |A B| = {x U : 6|x}, |A B| = 8.
|A B| = |A| + |B| |A B| = 25 + 16 8 = 33.
4. How many 3-digit numbers can be formed by using the six digits {1, 2, 3, 4, 5, 6} if
(a) repetitions of digits are allowed;
ANSWER: By the multiplication principle since there are 6 choices for each
digit, the answer is 63 .
(b) the number is to be odd and repetitions are NOT allowed;
ANSWER: Again we use the multiplication principle. Can pick the ones digit in
3 ways. Once that number is selected, there are 5 choices for the hundreds digit
and 4 choices for the tens digit (or vice versa). Total is 5 4 3 = 60.
(c) the number must contain the digit 2 and repetitions are allowed?
ANSWER: If 2 first appears (reading left to right) in the hundreds place then
there are 62 ways to complete the number. If 2 first appears (reading left to right)
in the tens place then there are 5 choices for the hundreds digit and 6 choices for
the ones digit. If 2 first appears (reading left to right) in the ones place then there
are 52 choices for the first two digits. Summing we have: 62 + 5(6) + 52 possible
numbers.
5. Let n N. Prove that n4 n2 is divisible by 3. Hint: There are 3 cases to consider;
n = 3k + 1 (where k Z) is one of them.
First observe that
n4 n2 = n2 (n2 1) = n2 (n 1)(n + 1).
A B = .
= . Let y A. Then y 6 B
so y B. Thus A B.
Now suppose A B
7. Let A, B, and C be sets. Prove
A (B C) = (A B) (A C).
ANSWER: Let y = (a, b) A (B C). Then a A and b (B C). Thus b B
and b C so (a, b) A B and (a, b) A C. Thus y (A B) (A C).
Now suppose y = (a, b) (AB)(AC). Then (a, b) (AB) and (a, b) (AC).
So a A and b B C. Thus y = (a, b) A (B C).
8. Let A be a set of nonzero integers and let be the relation on A A defined by
(a, b) (c, d) whenever a + d = b + c.
Prove that is an equivalence relation.
ANSWER: We need to show that is reflexive, symmetric, and transitive.
Reflexive. Let x = (a, b) be an element of A A. Since a + b = b + a, x x.
Let x A.
/ A so x
/ B. Thus x B
Then x
A.
Let x B.
/ B so x
/ A. Thus x A and B
We conclude A = B.
Now suppose A = B.
Thus x B and A B.
Let x A. Then x
/ A so x
/ B.
so x
Thus x A and B A.
Let x B. Then x
/B
/ A.
We conclude A = B.
11. Let A = {1, 2, 3} and let B = {4, 5}. Let R = (A A) (B B).
(a) Prove that R is an equivalence relation on A B.
ANSWER: Since A and B are small we can write out the elements of R:
R = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3), (4, 4), (4, 5), (5, 4)(5, 5)}
and the elements of A B:
A B = {1, 2, 3, 4, 5}
We need to show R is reflexive, symmetric, and transitive.
ANSWER: We create the partition as follows: first determine the four elements to
put in the first part; next, place all the remaining elements into the second part.
If n < 4, no partitions can be formed to meet the requirements.
If n 4 and n 6= 8, then there are n4 possible partitions.
If n = 8, then there are 21 84 possible partitions. (To see why this is the case,
observe that 84 counts all subsets of size 4. Thus {{1, 2, 3, 4}, {5, 6, 7, 8}} and
{{5, 6, 7, 8}, {1, 2, 3, 4}} would be considered as different partitions when in fact
they are not.)