Data Structure Lect16
Data Structure Lect16
Lecture 16
Topics
Combination
Examples of Combination
Pigeonhole Principle
Combination
The number of r-combinations of a set with n elements, where n is a nonnegative
integer and r is an integer with
0 ≤ r ≤ n,
equals
C(n, r) = n! .
r!(n − r)!
Example 1:
How many poker hands of five cards can be dealt from a standard deck of 52
cards? Also, how many ways are there to select 47 cards from a standard deck of
52 cards?
Solution: Because the order in which the five cards are dealt from a deck of 52
cards does not matter, there are C(52, 5) = 52! 5!47! different hands of five cards
that can be dealt. To compute the value of C(52, 5), first divide the numerator
and denominator by 47! to obtain
C(52, 5) = 52 · 51 · 50 · 49 · 48 · 47!
5 . 4 . 3 . 2 . 1 . ( 47)!
C(52, 5) = 26 · 17 · 10 · 49 · 12 = 2,598,960
Example 1:
3 students will be selected out of 5 students for the international speech
competition.
Solution:
Because the order in which the three students from group of 5 students does
not matter,
C(5, 3) = 5! = 5 · 4 · 3!
3! (5-3)! 3! . 2!
C(5, 3) = 10
Example 2:
How many ways are there to select five players from a 10-member tennis team
to make a trip to a match at another school?
Solution:
The answer is given by the number of 5-combinations of a set with 10 elements.
The number of such combinations is
C(10, 5) = 10! = 10 x 9 x 8 x 7 x 6 x 5!
5! 5! 5 x 4 x 3 x 2 x 1 x 5!
Solution:
The number of ways to select a crew of six from the pool of 30 people is the
number of 6-combinations of a set with 30 elements, because the order in which
these people are chosen does not matter. By Theorem 2, the number of such
combinations is
C(30, 6) = 30! = 30 · 29 · 28 · 27 · 26 · 25 x 24! =
6! 24! 6·5·4·3·2·1· 24!
= 29 x 7 x 9 x 13 x 25 = 593,775.
Example 5
Solution:
The positions of r 1s in a bit string of length n form an r-combination of the set {1, 2,
3,...,n}. Hence, there are C(n, r) bit strings of length n that contain exactly r 1s.
Example 6
Suppose that there are 9 faculty members in the mathematics department and 11 in the
computer science department. How many ways are there to select a committee to
develop a discrete mathematics course at a school if the committee is to consist of
three faculty members from the mathematics department and four from the computer
science department?
Solution:
By the product rule, the answer is the product of the number of 3-combinations of a set
with nine elements and the number of 4-combinations of a set with 11 elements.
The number of ways to select the committee is
C(9, 3) · C(11, 4) = 9! . 11! = 84 x 330 = 27,720.
3! 6! 4! 7!
Permutation and Combination
If k is a positive integer and k + 1 or more objects are placed into k boxes, then
there is at least one box containing two or more of the objects.
Example of Pigeonhole Principle
There are 50 cars and 7 colors and you have to color each cars. Show that 8 of
them will be of same color.
C1 C2 C3 C4 C5 C6 C7