Test03 solutions

advertisement
CmSc 180 Discrete Mathematics
Unit Exam 3 - Solutions
Sets, Counting
1. Write the identities below
a. A  ~A = E
Complementation Law
b A  ~A = Ø
Exclusion Law
c. A  E = A
Identity Laws
d. A  Ø = A
e. A  E = E
f. A  Ø =
Domination Laws
Ø
g. A  A = A
Idempotent Laws
h. A  A = A
i. ~(A  B) = ~A
 ~B
j. ~(A  B) = ~A
 ~B
De Morgan's Laws
2. Represent by Venn diagrams (shadow the appropriate area):
a. (A  C) - (B  C)
1
b. (A  C)  C)
c. (A - B)  (A - C)
3. Write the set expression corresponding to the shadowed areas:
a. Several correct answers: A – (B  C)  ((B  C ) – A)
((B  C) – (A B  C))  (( A – B)  (A – C))
((B  C) – (A B))  (( A – B)  (A – C))
((B  C) – A)
 (( A – B)  (A – C))
((B – A)  C)
 (( A – B)  (A – C))
( ~A  (B  C))
 (( A – B)  (A – C))
2
A
B
C
b. Several correct answers: (B – C)  ( (A  C) – B)
(B – C)  ( (A  C) – (A  B  C))
(B – C)  ( (A – B)  C)
(B – (B C))  ( (A  C) – (A  B  C))
A
B
C
c. Several correct answers: (A  B  C )– ((A  B)  (A  C )  (B  C))
((A– B)  (A– C))  ((B – A )  (B– C))  ((C – A )  (C– B))
((A– (B  C)  (B– (A  C))  ((C – (B A ) )
A
B
C
3
4. Write the power set of the set A = {, 1}
P(A) = { , {}, {1}, {, 1}}
5. Write the power set of the set B = {1, 2, 3}
P(A) = {, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1, 2, 3}}
6. How many elements will be there in the power set of a set with 10 elements?
210
7. Show a partition of the set A = {1,2,3,4,5} consisting of 3 subsets of A.
One possible solution:
{{1}, {2,3}, {4,5}}
8. Show a partition of all natural numbers consisting of three sets
One possible solution (there are infinitely many solutions)
{{1, 4, 7, 10, …..}
{2, 5, 8, 11, ….}
{3, 6, 9, 12, ….}}
In the next problems you don’t need to compute C(n,k) and P(n,k), products or
powers
9. How many eight-bit strings of 0's and 1's contain exactly two 0's?
Here we have to find two positions out of the 8 positions for the two zeros. The
zeros are not distinct, so the positions are not ordered.
C(8,2) = 8.7 /2!= 56/2 = 28
4
10. How many eight-bit strings of 0’s and 1’s start and end with 1?
The last two bits are fixed, thus the choices are determined by the first 6 bits.
Each may have 2 values, thus the number is
26
11. How many eight-bit strings of 0’s and 1’s have same last two digits ?
The last two digits may be either 0 or 1, this gives two choices. For each choice
the remaining 6 bits may have any binary values, thus the total number is
2. 26
12. A restaurant offers 2 appetizers, 3 main courses, and 4 beverages. Determine the
number of dinners that consist of one appetizer and one beverage.
Here we have Cartesian product of the appetizers and beverages:
2 x4
13. A restaurant offers 2 appetizers, 3 main courses, and 4 beverages. Determine the
number of dinners that consist of one appetizer, one main course, and an optional
beverage.
Here we have Cartesian product of the 2 appetizers, 3 main courses, and 4
beverages plus the case with no beverage (you can think of 5 beverages cases):
2x3x5
14. A six-person committee composed of A, B, C, D, E, and F is to select a
chairperson, a secretary, and a treasurer. How many selections exclude C?
Excluding C, there remain 5 persons. The choice is an ordered triple:
P(5,3)
15. A six-person committee composed of A, B, C, D, E, and F is to select a
chairperson, a secretary, and a treasurer. How many selections are there in which
B is either chairperson or treasurer?
P(5,2) + P(5,2) = 2*P(5,2) = 2 x 5 x 4
5
B chairman leaves the selection of a secretary and a treasurer out of 5 persons.
The number is P(5,2) because the positions are ordered.
B treasurer leaves the selection of a secretary and a chairman out of 5 persons P(5,2).
Hence the number of choices is 2 x P(5,2) = 2 x 5 x 4 = 40
16. How many 3-letter strings formed using letters from A, B, C, D, or E, are there
that begin with A, allowing repetition of letters?
Each letter in any position is chosen among a set of 5 elements – Cartesian
product. The first letter is fixed, so the total number is
5x5
17. How many 3-letter strings formed using letters from A, B, C, D, or E, are there
that begin with A, if repetition of letters is not allowed?
Since there are no repetitions and the first letter is fixed, the choices are
P(4,2)
18. In how many ways can 5 distinct German books, 3 distinct Russian books, and 2
distinct Spanish books be arranged on a shelf?
All books are distinct and the order matters, hence we have permutations 10!
19. Write the formula of C(n,k) : combinations of k elements out of n elements
C(n,k) = n!/ (n-k)! k! = P(n,k) / k!
20. Write the formula for P(n,k): permutations of k elements out of n elements
P(n,k) = n. (n-1) (n-2) … (n-k +1) = n!/(n-k)!
6
Download