You are on page 1of 30

Counting,

Permutations, &
Combinations
A counting problem asks “how many ways”
some event can occur.

Ex. 1: How many three-letter codes are


there using letters A, B, C, and D if no letter
can be repeated?

One way to solve is to list all possibilities.


•Another way to solve is a factor
tree where the number of end
branches is your answer.
b

a c
a
b c
a
c
b
Fundamental Counting
Principle
Suppose that a certain procedure P can be
broken into n successive ordered stages, S1
and S2, and. . . Sn, and suppose that
S1 can occur in r1 ways.
S2 can occur in r2 ways.
Sn can occur in rn ways.
Then the number of ways P can occur is
r1  r2    rn
Fundamental Counting
Principle
Suppose that a certain procedure P can be
broken into n successive stages, S1, or S2….
or, . . . Sn, and suppose that
S1 can occur in r1 ways.
S2 can occur in r2 ways.
Sn can occur in rn ways.
Then the number of ways P can occur is
r1  r2  rn
Ex. 2: How many committees of
three can be selected from four
people?
Use A, B, C, and D to represent the people
Note: Does the order matter?
Calculate the value k through the following procedur
k:=0.
For T1=1 to n1 do
k:=k+1.
end
For T2=1 to n2 do
k:=k+1.
end………………..
For Tm=1 to nm do
k:=k+1.
end
Calculate the value k through the following procedur
k:=0.
For T1=1 to n1 do
For T2=1 to n2 do
For T3=1 to n3 do
k:=k+1.
end
end
end
Let A=\{a,b,c,d,e\} and B=\{1,2,3\}.
How many ways to determine the pairs of
elements of A and elements of B or A x B?
Order must be
considered
Permutations
An r-permutation of a set of n
elements is an ordered selection of r
elements from the set of n elements
n!
n Pr 
n  r !
Ex. 1:How many three-letter
codes are there using letters A, B,
C, and D if no letter can be
repeated?

Note: The order does matter

4!
4 P3   24
1!
Order does
NOT matter!
Combinations
The number of combinations of n
elements taken r at a time is

n!
n Cr 
r!n  r !

Where n & r are nonnegative integers & r < n


Ex. 3: How many committees of
three can be selected from four
people?
Use A, B, C, and D to represent the people
Note: Does the order matter?

4!
4 C3  4
3!1!
Ex. 4: How many ways can the
4 call letters of a radio station
be arranged if the first letter
must be W or K and no letters
repeat?
2  25  24  23 
27,600
Ex. 5: In how many ways can
our class elect a president, vice-
president, and secretary if no
student can hold more than one
office?
Ex. 7: Given the digits 5, 3, 6, 7, 8,
and 9, how many 3-digit numbers
can be made if the first digit must
be a prime number? (can digits be
repeated?)

3  5  4  60
Ex. 9: Suppose there are 15 girls and
18 boys in a class. In how many ways
can 2 girls and 2 boys be selected for
a group project?

15C2 X 18C2 = 16,065


Generalization of permutation
Theorem. r-permutation of a set with $n$ elements, where
repetitions are allowed, equals $n^{r}$.

Example: How many ways to construct a code with length n which


consists of alphabet and repetitions are allowed?
Generalization of permutation
The number of permutations of $n$ objects, where there are
$n_1$ indistinguishable objects of type 1,
$n_2$ indistinguishable objects of type 2,
………………
$n_t$ indistinguishable objects of type 1

n!
n1 !.n2 ! nt !
Generalization of permutation
The number of permutations of $n$ objects, where there are
$n_1$ indistinguishable objects of type 1,
$n_2$ indistinguishable objects of type 2,
………………
$n_t$ indistinguishable objects of type 1

n!
n1 !.n2 ! nt !
Generalization of Combination
Let $X$ be a set with $t$ elements.
The number of ways to select $k$ elements ) in $X$ (k may be greater
than t ) is
C  k  t  1, t  1  C  k  t  1, k  .
Example
How many ways to construct a code which is made of alphabet of
MATHEMATICS?

How many solution of the equation


x1  x2  x3  20, xi  0
The pigeonhole principle
Suppose a flock of pigeons fly into a set of
pigeonholes to roost.
If there are more pigeons than pigeonholes, then
there must be at least 1 pigeonhole that has more
than one pigeon in it

If k+1 or more objects are placed into k boxes, then


there is at least one box containing two or more of
the objects (Theorem 1)

23
Pigeonhole principle examples
In a group of 13 people, there must be two people with the same
birthday
◦ As there are 12 possible birthdays

In a group of 27 English words, at least two words must start with the
same letter
◦ As there are only 26 letters

24
Generalized pigeonhole principle
If N objects are placed into k boxes, then there is at least one box
containing N/k objects (Theorem 2)

25
Generalized pigeonhole principle
examples
Among 50 people, there are at least 50/12 = 5 born on the same
month

How many students in a class must there be to ensure that 6 students


get the same grade (one of A, B, C, D, or F)?
◦ The “boxes” are the grades, i.e., k = 5
◦ Thus, we get N/5 = 6
◦ Thus, Lowest possible value for N is 26

26
Rosen, section 4.2, question 4
A bowl contains 10 red and 10 yellow balls
a) How many balls must be selected to ensure 3 balls of the
same color?
◦ Via generalized pigeonhole principle
◦ How many balls are required if there are 2 colors, and one color must
have 3 balls?
◦ How many pigeons are required if there are 2 pigeon holes, and one must
have 3 pigeons?
◦ number of boxes: k = 2
◦ We want N/k = 3
◦ What is the minimum N?
◦ N=5

27
Rosen, section 4.2, question
32
6 computers on a network are connected to at least 1 other
computer
Show there are at least two computers that are have the
same number of connections
The number of boxes, k, is the number of computer
connection: i.e., 1, 2, 3, 4, or 5
The number of pigeons, N, is the number of computers
◦ That is 6
By the generalized pigeonhole principle, at least one box
must have N/k objects
◦ 6/5 = 2
◦ Thus, at least two computers must have the same number of
connections

28
Exercises
Solve some problems on Rosen (7th edition) :
Number#6#:

Number #9,17#

Number 26
Exercises (Counting problems)
Page 396

Page 413

Page 415

You might also like