ECE 307 – Techniques for
Engineering Decisions
Combinatorial Analysis
George Gross
Department of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
COMBINATORIAL ANALYSIS
Many problems in probability theory can be
solved by simply counting the number of ways a
certain event may occur
We review some basic aspects of combinatorial
analysis
combinations
permutations
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
1
BASIC PRINCIPLE OF COUNTING
Suppose that two experiments are to be
performed:
experiment 1 may result in any one of the m
possible outcomes
for each outcome of experiment 1, there exist
n possible outcomes of experiment 2
Therefore, there are mn possible outcomes of the
two experiments
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
BASIC PRINCIPLE OF COUNTING
The basic principle is easy to prove by
exhaustive enumeration
(1, 1), (1, 2), (1, 3), ... (1, n)
(2, 1), (2, 2), (2, 3), ... (2, n)
.
.
.
(m, 1), (m, 2), (m, 3), . . . (m, n)
where, (i , j) is the notation we use to refer to
outcome i in experiment 1 and outcome j in
experiment 2
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
2
EXAMPLE 1 : PAIR FORMATION
Pairs need to be formed consisting of 1 boy and
1 girl by choosing from a group of 7 boys and 9
girls
There exist (7)(9)= 63 possible pairs since there
are 7 ways to pick a boy and 9 ways to pick a girl
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
GENERALIZED VERSION OF THE
BASIC PRINCIPLE
For r experiments with the first experiment
having n1 possible outcomes; for every outcome
of the first experiment, there are n2 possible
outcomes for the second experiment, and so on
.......
1
2
2
. .......
n1 . 2
1 .
.......
2
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
3
GENERALIZED VERSION OF THE
BASIC PRINCIPLE
There are
r
Π ni = n1 ⋅ n2 ⋅ n3 ...... ⋅ nr
i =1
possible outcomes for the r experiments, i.e.,
r
there are Π ni possible branches in the
i =1
illustration
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 2 : SUBCOMMITTEE
CHOICES
The executive committee of an Engineering
Open House function consists of:
3 first year students
4 sophomores
5 juniors
2 seniors
We need to form a subcommittee of 4 with each
year represented:
There are 3 ⋅ 4 ⋅ 5 ⋅ 2 = 120 different subcommittees
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
4
EXAMPLE 3 : LICENSE PLATE
We consider possible combinations for a six-
place license plate with the first three places
consisting of letters and the last three places of
numbers
Number of combinations with repeats allowed is
(26) (26) (26) (10) (10) (10) = 17,576,000
Combination number if no repetition allowed is
(26) (25) (24) (10) (9) (8) = 11,232,000
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 4 : n POINTS
Consider n points at which we evaluate the
function
f ( i ) ∈ {0 ,1} i = 1,2,...., n
Therefore, there are 2n possible function values
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
5
PERMUTATIONS
A set of 3 objects{ A, B, C } may be arranged in 6
different ways:
BCA ABC CBA
BAC ACB CAB
Each arrangement is called a permutation
The total number of permutations is derived from
the Basic Principle:
there are 3 ways to pick the first element
there are 2 ways to pick the second element
there is 1 way to pick the third element
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
PERMUTATIONS
Therefore, there are 3 ⋅ 2 ⋅ 1 = 6 ways to arrange
the 3 elements
In general, a set of n objects can be arranged
into
n! = n ( n – 1 ) ( n – 2 ) . . . 1
different permutations
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
6
EXAMPLE 5 : BASEBALL
Number of possible batting orders for a baseball
team with nine members is
9! = 362,880
Suppose that the team, however, has altogether
12 members; the number of possible batting
orders is the product of the number of team
formations and the number of permutations is
12! 12!
i 9! = = 2(11!) = 79,833,600
3! 9! 3!
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 6 : CLASSROOM
A class with 6 boy and 4 girl students is ranked
in terms of weight ; assume that no two students
have the same weight
There are
10! = 3,628,800
possible rankings
If the boys (girls) are ranked among themselves,
the number of different possible rankings is
6!4! = 17,280
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
7
EXAMPLE 7 : BOOKS
A student has 10 books to put on the shelf:
4 EE, 3 Math, 2 Econ, and 1 Decision
Student arranges books so that all books in
each category are together
There are 4!3!2!1! arrangements so that all EE
books are first in line, then the Math books, Econ
books, and Decision book
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 8 : BOOKS
But, there are 4! possible orderings of the
subjects
Therefore, there are
4!4!3!2!1! = 6912
permutations of arranging the 10 books
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
8
EXAMPLE 9 : PEPPER
We wish to determine the number of different
letter arrangements in the word PEPPER
Consider first the letters P1 E1 P2 P3 E2 R where we
distinguish the repeated letters among
themselves: there are 6! permutations of the 6
distinct letters
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 9 : PEPPER
However, if we consider any single permutation
of the 6 letters – for example, P1 P2 E1 P3 E2 R –
provides the same word PPEPER as 11 other
permutations if we fail to distinguish between
the same letters
Therefore, there are 6! permutations for distinct
letters but only
6!
= 60
3!2!
permutations when repeated letters are not
distinct
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
9
GENERAL STATEMENT
Consider a set of n objects in which
n1 are alike ( category 1 )
n2 are alike ( category 2 )
.
.
.
nr are alike ( category r )
There are
n!
n1 ! n2 !.....nr !
different permutations
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 9 : COLORED BALLS
We have 3 white, 4 red, and 4 black balls which
we arrange in a row; similarly colored balls are
indistinguishable from each other
There are
11!
= 11,550
3!4!4!
possible arrangements
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
10
COMBINATIONS
Given n objects, we form groups of r objects
and establish the number of different groups
we can form
For example, consider 5 objects denoted as
A,B,C,D and E and form groups of 3 objects;
we can pick the first item in exactly 5 ways
we can pick the second item in exactly 4 ways
we can pick the third item in exactly 3 ways
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
COMBINATIONS
and, therefore, we can select
5 ⋅ 4 ⋅ 3 = 60
possible groups in which the order of the groups
is taken into account
But, if the order of the objects is not of interest,
i.e., we ignore that each group of three objects
can be arranged in 6 different permutations, the
total number of distinct groups is
5! 60
= = 10
2!3! 6
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
11
GENERAL STATEMENT ON
COMBINATIONS
The objective is to arrange n elements into
groups of r elements
We can select groups of r
n!
( n − r )!
different ways
But, each group of r has r ! permutations
The number of different combinations is
n!
( n − r )! r !
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
BINOMIAL COEFFICIENTS
We define the term
⎛ n⎞ n!
⎜r ⎟ ( n − r )! r !
⎝ ⎠
as the binomial coefficient of n and r
A binomial coefficient gives the number of
possible combinations of n elements taken r at
a time
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
12
EXAMPLE 10 : COMMITTEE
SELECTION
We wish to select three persons to represent a
class of forty
There are
40! 40 ⋅ 39 ⋅ 38
= = 20 ⋅ 13 ⋅ 38 = 9880
37!3! 3⋅ 2⋅1
possible committee selections
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 11 : GROUP FORMATION
Given a group of 5 boys and 7 girls, form sets
consisting of 2 boys and 3 girls
There are
⎛ 5⎞⎛ 7⎞ 5! 7 ! 5⋅4 7⋅6⋅5
⎜ 2 ⎟ ⎜ 3 ⎟ = 3!2! 4!3! = 2 ⋅
= 350
⎝ ⎠⎝ ⎠ 3 2
possible ways to form such groups
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
13
GENERAL COMBINATORIAL IDENTITY
⎛ n⎞ ⎛ n − 1⎞ ⎛ n − 1⎞
⎜ ⎟ = ⎜ ⎟ + ⎜ ⎟
⎝r ⎠ ⎝r −1⎠ ⎝ r ⎠
number of number of number of
ways of ways of ways of
selecting selecting selecting
groups of r groups of r – 1 groups of r
from n from n from n – 1
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
MULTINOMIAL COEFFICIENTS
Given a set of n distinct items, form r distinct
groups of respective sizes n1, n2, . . . , and nr with
r
∑n
i =1
i = n
There are
⎛n ⎞
⎜n ⎟
⎝ 1⎠
possible choices for the first group
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
14
MULTINOMIAL COEFFICIENTS
For each choice of the first group, there are
⎛ n − n1 ⎞
⎜ ⎟
⎝ n2 ⎠
possible choices for the second group
We continue with this reasoning and we
conclude that there are
n!
n1 ! n2 ! ... nr !
possible groups
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
MULTINOMIAL COEFFICIENTS
The previous conclusion was gained by realizing
that
⎛ n ⎞ ⎛ n − n1 ⎞ ⎛ n − n1 − n2 ⎞ ⎛ n − n1 − n2 − . . . nr −1 ⎞
⎜ n ⎟⎜ n ⎟⎜ n ⎟ . . .⎜ ⎟=
⎝ 1 ⎠⎝ 2 ⎠ ⎝ 3 ⎠ ⎝ n r ⎠
n! (n − n1 )! n − n1 − n2 − ...nr −1
... =
(n − n1 )!n1! (n − n1 − n2 )!n2 ! 0 !nr !
n!
n1 !n2 ! ...nr !
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
15
MULTINOMIAL COEFFICIENTS
Let
n = n1 + n2 + n3 + . . . + nr
we define the multinomial coefficient
⎛ n ⎞ n!
⎜ n ,n , . . . ,n ⎟
⎝ 1 2 r ⎠ n1 ! n2 ! n3 ! . . . nr !
A multinomial coefficient represents the number
of possible divisions of n distinct objects into r
distinct groups of respective sizes n, n2, . . . , nr
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 12 : POLICE
A police department of a small town has 10
officers
The department policy is to have 5 members on
street patrol, 2 members at the station and 3 on
reserve
The number of possible divisions is
10!
= 2,520
5!3!2!
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
16
EXAMPLE 13 : TEAM FORMATION
We need to form two teams, the A team and the
B team, with each team having 5 boys from a
group of 10 boys
There are
10!
= 252
5!5!
possible divisions
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
EXAMPLE 13 : TEAM FORMATION
Suppose that these two teams are to play
against one another
In this case, the order of the two teams is
irrelevant since there is no team A and team B
per se but simply a division of 10 boys into 2
groups of 5 each
The number of ways to form the two teams is
1 ⎛ 10! ⎞
⎜ ⎟ = 126
2! ⎝ 5!5! ⎠
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
17
EXAMPLE 14 : TEA PARTY
A woman has 8 friends of whom she will invite 5
to a tea party
How many choices does she have if 2 of the
friends are feuding and refuse to attend
together?
How many choices does she have if 2 of her
friends will only attend together?
ECE 307 © 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
18