Counting Subsets ICS 6 D Sandy Irani Two
Counting Subsets ICS 6 D Sandy Irani
Two Different Counting Problems • Student council has 15 members. Must select officers (Pres, VP, Treasurer, Secretary) Sample selection: (Sally, Frank, Margaret, George) A selection is a 4 -permutation • Student council has 15 members. Must select an executive committee with 4 members. Sample selection: {Sally, Frank, Margaret, George} = {Margaret, Sally, Frank, George} A selection is a 4 -subset
Counting Subsets vs. Permutations • S = {a, b, c} • The number of 2 -permutations from S is 6: (a, b), (a, c), (b, a), (b, c), (c, a), (c, b) • The number of 2 -subsets from S is 3: {a, b}, {a, c}, {b, c}
Counting Subsets • • S = {blue, green, orange, pink, red} How many ways to pick a subset of 3 colors? Know how to count 3 -permutations. f: 3 -permutations from S → 3 -subsets from S f( (blue, pink, green) ) = {blue, green, pink} f( (pink, blue, green) ) = {blue, green, pink}
Counting Subsets • f: 3 -permutations from S → 3 -subsets from S Function f is 3!-to-1
Counting Subsets • Set S with n elements • f: r-permutations from S → r-subsets from S Function f is r!-to-1
Counting Subsets •
Calculating n choose r •
• Fact: • Can check by arithmetic:
• Fact: • Can show by bijection. S = {1, 2, 3, …, n} f: r-subsets of S (n-r)-subsets of S f(A) = A Example: S = {1, 2, 3, 4, 5, 6, 7, 8} n = 8, r = 3 f is a bijection: f-1(B) = B
Subsets vs. Permutations • 100 pianists compete in a piano competition. • In the first round 25 of the 100 contestants are selected to go on to the next round. How many different possible outcomes are there? • In the second round, the judges select a first, second, third, fourth and fifth place winners of the competition from among the 25 pianists who advanced to the second round. How many outcomes are there for the second round of the competition?
Counting Strings • How many binary strings with 9 bits have exactly four 1’s? • By bijection: S = {1, 2, 3, 4, 5, 6, 7, 8, 9} • g: 4 -subsets of S 9 -bit strings with four 1’s • g(A) = y if j A, then jth bit of y is 1 if j A, then jth bit of y is 0 g( {1, 3, 4, 9} ) = g-1(010011010) =
Counting Strings • Strings over the alphabet {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} • How many strings of length 8? • How many strings of length 8 have exactly three 5’s?
Counting Strings • Strings over the alphabet {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} • How many strings of length 8 have exactly three 5’s and two 1’s?
Distribution Problems • How many ways are there to distribute 10 identical prizes to 275 people with at most one person? The students are all different (distinguishable) “indistinguishable” = “identical” • How many ways are there to distribute 10 different prizes to 275 people with at most one person?
Distribution Problems • How many ways are there to distribute 10 different prizes to 275 people with no limit on the number of prizes person?
Playing Cards • Standard deck of playing cards has 52 cards 13 ranks: A, 2, 3, 4, 5, 6, 7, 8, 9, J, Q, K 4 suits: • Each card has a rank and a suit: 8 Q • Every rank/suit combination possible: # cards = # ranks · # suits = 4 · 13 = 52
5 -card Hand • A 5 -card hand is a subset of 5 of the 52 cards: {A , 4 , 2 , 8 } (order doesn’t matter) • How many different 5 -card hands are there from a standard playing deck?
5 -card Hands • How many 5 -card hands have exactly 3 clubs?
5 -card Hands • How many 5 -card hands are a 3 -of-a-kind? (3 cards of the same rank, the two other cards have a different rank from the 3 -of-a-kind and from each other)
5 -card Hands • How many 5 -card hands have two pairs? (Each pair has the same rank. Two pairs have different rank from each other. The 5 th card has a different rank than the two pairs)
5 -card Hands • How many 5 -card hands have no face cards? (No A, J, Q, K)
More Counting • A club has 10 men and 9 women – How many ways are there to select a committee of 6 people from the club members? – Same number of men as women
- Slides: 23