0% found this document useful (0 votes)
3 views

Data Structure Lect16

Uploaded by

Hasnain Nisar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Data Structure Lect16

Uploaded by

Hasnain Nisar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Discrete Structure

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!

C(10, 5) = 2x 9x 2x7 = 252


Example 4:
A group of 30 people have been trained as astronauts to go on the first mission to
Mars. How many ways are there to select a crew of six people to go on this mission
(assuming that all crew members have the same job)?

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

 How many bit strings of length n contain exactly r 1s?

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

 Order does matter Permutation

 Oder does not matter Combination


What is Pigeonhole Principle
Suppose that a flock of 20 pigeons flies into a set of 19 pigeonholes to roost.
Because there are 20 pigeons but only 19 pigeonholes, a least one of these 19
pigeonholes must have at least two pigeons in it. To see why this is true, note
that if each pigeonhole had at most one pigeon in it, at most 19 pigeons, one per
hole, could be accommodated.
This illustrates a general principle called the pigeonhole principle, which states
that if there are more pigeons than pigeonholes, then there must be at least one
pigeonhole with at least two pigeons in it.
Figure 1 Pigeonhole
Pigeonhole Principle

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

We have 50 cars means we have 50 pigeons and 7 colors means we have 7


pigeonhole and we have to accommodate 8 pigeon in any of the color
represented by c1,c2, c3…. C7.
50 = 7 remainder is 1 so 1 car must be any of the seven colors.
7
One color contains the 8 cars.

You might also like