HW-09: Solution

advertisement
CmSc 180 Discrete Mathematics
HW 09: Counting and probability - Solution
1. Let A={a,b,c,d}
a. Compute the number of permutations of three elements of A.
P(n,k) = n! / (n – k)!
P(4,3) = 4! / (4 – 3)! = 4! = 1*2*3*4 = 24
b. Compute the number of combinations of three elements of A.
C(n,k) = P(n,k) / k!
C(4,3) = P(4,3) / 3! = 4! / 3! = 4
2. In how many was can we select a chairperson, vice-chairperson and a recorder from a group of
11 persons?
For any three person selected, the order matters, so we compute permutations P(11,3)
P(11,3) = 11! /(11 – 3)! = 11! / 8! = 11*10*9 = 990
3. In how many ways can we select a committee of three from a group of 11 persons?
Compared with the previous problem, here the order does not matter, so we compute combinations.
C(11,3) = P(11,3) / 3! = 990 / 6 = 165
In exercises 4-8 refer to a club consisting of 6 men and 7 women.
4. In how many ways can we select a committee of three men and four women?
The order does not matter, we compute combinations. There are two sets – men and women, so all
choices of men have to be multiplied by all choices of women.
We have to compute C(6,3) * C(7,4)
C(6,3) = 6! / ((6 – 3)! * 3!) = 6! / (3! * 3!) = 6! / 36 = 720/36 = 20
C(7,4) = 7! / (( 7 – 4)! * 4!) = 7! / (3! * 4! ) = 5040 / 144 = 35
C(6,3) * C(7,4) = 700
1
5. In how many ways can we select a committee of four persons that has at least one woman?
Solution A: Here we have to add four cases: one woman, 2 women, 3 women, and 4 women
We can put the cases in a table:
Men
Women
Case1 :
0
4
C(6,0) * C(7,4)
Case2:
1
3
C(6,1) * C(7,3)
Case3:
2
2
C(6,2) * C(7,2)
Case4:
3
1
C(6,3) * C(7,1)
In each case the solution is the product of the combinations over the set of men and the combinations
over the set of women:
The answer is obtained after computing the sum:
C(6,0) * C(7,4) + C(6,1) * C(7,3) + C(6,2) * C(7,2) + C(6,3) * C(7,1)
C(6,0 ) = 6! / (6!*0!) = 1
C(6,1) = 6! / (5!* 1!) = 6
C(6,2) = 6! / (4!* 2!) = 30/2 = 15
C(6,3) = 6! / (3! * 3!) = 120/6 = 20
C(7,1) = 7!/ (6!* 1!) = 7
C(7,2) = 7! / (5!* 2!) = 42/2 = 21
C(7,3) = 7! / (4! * 3!) = 210/6 = 35
C(7,4) = 7! / (3!*4!) = 35
Therefore the sum is:
1 * 35 + 6 * 35 + 15*21 + 20*7 = 35 + 210 + 315 + 140 = 700
Solution B.
We can find the solution as the difference between all possible selection and the selections with no
women.
All possible ways to choose a committee of 4 persons out of 13 is C(13,4)
Committees with only men are C(6,4)
C(13,4) – C(6,4) = 13! / (9! * 4!) – 6! / (2! * 4!) =
13*12*11*10 / 24 – 5*6/2 = 715 – 15 = 700
6. In how many ways can we select a committee of four persons that has at most one man?
Consider 2 cases:
Men
Case 1:
0
Case 2:
1
Women
4
3
C(6,0) * C(7,4)
C(6,1) * C(7,3)
The number of selections is: C(6,0) * C(7,4) + C(6,1) * C(7,3) = 1* 35 + 6 * 35 = 245
2
7. In how many ways can we select a committee of four persons that has persons of both sexes?
Case 1:
Case 2:
Case 3:
Men
1
2
3
Women
3
2
1
C(6,1) * C(7,3)
C(6,2) * C(7,2)
C(6,3) * C(7,1)
The number of selections is:
C(6,1) * C(7,3) + C(6,2) * C(7,2) + C(6,3) * C(7,1) =
6 * 35 + 15 * 21 + 20 * 7 = 665
Solution B:
All possible selections are C(13,4)
Selections with men only are C(6,4)
Selections with women only are C(7,4)
Selections with both genders are the difference C(13,4) – C(6,4) – C(7,4)
C(13,4) = 13*12*11*10 / 24 = 715
C(6,4) = 6! / (2! * 4!) = 15
C(7,4) = 35
C(13,4) – C(6,4) – C(7,4) = 715 – 15 – 35 = 665
8. In how many ways can we select a committee of four persons so that Mabel and Ralph do not
server together?
All possible selections are C(13,4) = 715
Selections where Mabel and Ralph serve together are C(11,2)
Mabel and Ralph are fixed, so we choose the remaining two members out of 11 persons
Selections where Mabel and Ralph do not serve together are: C(13,4) – C(11,2) =
715 – 11! / (9! * 2!) = 715 – 10 * 11 / 2 = 715 – 55 = 660
9. In how many ways can we select a committee of four Republicans, three Democrats and two
Independents from a group of 10 Republicans, 12 Democrats, and four Independents?
C(10,4) * C(12,3) * C(4,2)
C(10,4) = 10! / (6! * 4!) = 7*8*9*10 / 2*3*4 = 7*3*10 = 210
C(12,3) = 12! / (3! * 9!) = 10*11*12 / 2*3 = 10*11*2 = 220
C(4,2) = 4! / (2! * 2!) = 3*4 / 2 = 6
C(10,4) * C(12,3) * C(4,2) = 210 * 220 * 6 = 277,200
3
10. How many eight-bit strings of 0's and 1's contain exactly three 0's?
We need to count in how many ways we can choose the positions of the 0’s
C(8,3) = 8! / (5! * 3!) = 6*7*8/(2*3) = 56
11. How many eight-bit strings of 0's and 1's contain three 0's in a row and five ones?
We need to count in how many ways we can choose the position of the first 0: C(6,1) = 6
In exercises 12-20 find the number of 5 card hands from a standard deck of 52 cards that satisfy
the given conditions.
12. Containing all spades
C(13,5) = 13! / (8! * 5!) = 9*10*11*12*13 / (2*3*4*5) = 9*11*13 = 1287
13. All of the same suit
4*C(13,5) = 4 * 1287 = 5148
14. Containing cards of exactly two suits
We need to consider several cases
Suit 1
Suit 2
Case 1
1
4
Case 2
2
3
Case 3
3
2
Case 4
4
1
C(13,1) * C(13,4)
C(13,2) * C(13,3)
C(13,3) * C(13,2)
C(13,4) * C(13,1)
For any given 2 suits the number of selections will be the sum:
C(13,1) * C(13,4) + C(13,2) * C(13,3) + C(13,3) * C(13,2) + C(13,4) * C(13,1)
C(13,1) = 13
C(13,2) = 13! / (11! * 2!) = 12*13 / 2 = 78
C(13,3) = 13! / (10! * 3!) = 11*12*13 / 6 = 286
C(13,4) = 13! / (9! * 4!) = 10*11*12*13 / 24 = 5 * 11 * 13 = 715
C(13,1) * C(13,4) + C(13,2) * C(13,3) + C(13,3) * C(13,2) + C(13,4) * C(13,1) =
13 * 715 + 78 * 286 + 78 * 286 + 715 * 13 = 18590 + 44616 = 63206
We can select 2 suits out 4 in C(4,2) ways.
C(4,2) = 6
Thus, the answer is 4* 63206 = 252,824
4
15. Containing cards of all suits
Four cards of different suits can be selected in 13*13*13*13 ways, i.e. 28,561 ways.
The fifth card can be any of the remaining 48 cards, so we have: 48*28,561 = 1,370,928
16. Containing an Ace, 2, 3, 4 and 5 all of the same suit.
For a given suit there is only one selection. Since the suits are 4, we have 4 selections.
17. Consecutive and of the same suit. (assuming ace is the lowest card)
We can select the position of the lowest card of a given suit in 9 ways.
All selections are 4 * 9 = 36
18. Consecutive (assuming ace is the lowest)
For a given suit we have 9 selections. Each card can be chosen out of 4 suits.
Thus we have 9 * 4*4*4*4*4 = 9216
19. Containing three of one kind and two of another kind. (full house)
Three of one kind is C(4,3) Choosing among 13 kinds will give 13*C(4,3).
Two of the second kind is C(4,2). Choosing among the remaining 12 kinds is 12*C(4,2)
Thus we have 13 * C(4,3) * 12 * C(4,2) = 13*4 * 12 * 6 = 3744
The same result should be obtained if we first count the two cards of the same kind and then the three
out of the remaining kinds:
13*C(4,2) * 12 * C(4,3) = 13 * 6 * 12 * 4
20. Containing two of one kind, two of a second kind and one of a third kind.
Two of one kind is 13 * C(4,2)
Two of the second kind is 12*C(4,2)
One of the third kind is 11 * C(4,1)
13* C(4,2) * 12 * C(4,2) * 11 * C(4,1) = 13 * 6 *12 * 6 * 11 * 4 = 247,104
5
In exercises 21-24 a coin is flipped 10 times.
21. How many outcomes are possible?
210
22. How many outcomes have exactly three heads?
The problem is similar to how many binary strings are there with exactly 3 zeros:
C(10,3)
23. How many outcomes have at most three heads?
C(10,0) + C(10,1) + C(10,2) + C(10,3) =
1 + 10 + 45 + 10! / (7! * 3!) = 56 + 8*9*10 / 6 = 56 + 8*3*5 = 56 + 120 = 176
24. How many outcomes have a head on the fifth toss?
29
6
Download