Chapter 2 - CLSU Open University

Combinatorial
Analysis
2
2.1 Fundamental Principle of Counting
2.2 Permutations
2.3 Combinations
2.4 Tree Diagrams
25
Learning Objectives:
It is expected that you will be able to do the following:
1. Use the fundamental principle of counting, permutation and
combination to count the number of outcomes in both an event and the
sample space.
2. Count the number of ordered samples in sampling with and without
replacement.
3. Count the number of possible ordered or unordered partitions of
elements in a set as specified in a given problem.
4. Use a tree diagram to organize outcomes of a random experiment.
For finite probable spaces with equally likely outcomes, the
probability of occurrence of each outcome or sample point is 1/n, where n,
the size of the sample space , is the total number of possible outcomes of
the experiment. To such sample spaces the classical approach of assigning
probability is applied, in which the probability of an event A is evaluated as
P(A) = nA/n, where nA denotes the number of sample points with attribute A.
This approach calls for the counting of sample points in the sample space
and events. However, in most experiments, the number of outcomes in the
sample space is so large, that a complete listing of these outcomes is so
expensive and slow. In such a situation, it is convenient to have a technique
in determining the total number of outcomes in the sample space and in
various events in the sample space without having to make a list of all these
outcomes.
2.1
Fundamental Principle of Counting
We begin with the fundamental principle of counting:
26
Definition 2.1 The Fundamental Principle of Counting. If a procedure
can be done in n1 different ways, and if, following this procedure, a
second procedure can be done in n2 different ways, and if, following
this second procedure, a third procedure can be done in n 3 ways, and
so forth, then the number of ways the procedures can be done in the
order indicated is the product n1n2n3 . . .
Example 1 Suppose two dice are rolled. Since each die has 6 possible
ways of coming up, n1 = 6 and n2 = 6, then the number of
possible outcomes of the experiment is n1n2 = 36.
///
Example 2 There are 5 routes from city A to city B, 7 routes from city B to
city C and 4 routes from city C to city D. If a person will travel
from A to D by way of B and C, then he has n AB = 5 ways to
choose to travel from A to B, nBC= 7 ways to go from B to C,
and nCD = 4 ways from C to D. In other words, he can choose
to travel from A to D, passing through B and C, in nAB  nBC 
nCD = 140 ways.
///
Example 3 Suppose six coins are tossed, each outcome in the sample space
 will consist of a sequence of six heads and tails, such as
HTTTHH. Since there are two possible outcomes for each of
the six coins, the total number of outcomes in  will be
222222 = 26 = 64. If head and tail are considered equally
likely for each coin, then  is a finite probable space with
equally likely outcomes, and the probability of each outcome in
 is 1/64. Out of 64 possible outcomes, there are 15 outcomes
in  with two heads and four tails. Thus, the probability of
obtaining exactly two heads is 15/64.
///
Example 4 Using the digits in set A = {2,4,5,7,8}, how many possible
three-digit numbers can be formed (a) if repetition of the given
digits is allowed, (b) if repetition of the given digits is not
allowed, (c) how many the possible numbers are even if
repetition is allowed, or not allowed, and (d) how many are
greater than 400 if repetition is allowed, or not allowed?
27
Solution:
All these questions can be answered using the fundamental
principle of counting. Let us consider the problem as filling up
three positions: the hundreds, the tens, and the units place
values of a three-digit number.
Let
N=
total
number
of
possible
threedigit numbers that can be formed using the
digits in set A
n1 = number of ways of assigning a digit for the
first position to be filled up
n2 = number of ways of assigning a digit for the
second position to be filled up
n3 = number of ways of assigning a digit for the
third position to be filled up
The total number of three digit numbers that can be formed is
equal to N = n1n2n3 ways.
(a) N = n1n2n3 = 53 = 125
No particular order is required in filling up the
positions, that is, you can start choosing a number for the
tens position, then the units position then the hundreds
position, or in any order you prefer. Since repetition is
allowed, n1 = n2 = n3 = 5, which means that each time a
digit is to be assigned in a current position to be filled up,
there will always be 5 digits to choose from. Thus there are
N = n1n2n3 = 53 = 125 possible three-digit numbers that
can be formed if repetition is allowed, using the 5 distinct
digits given in set A.
(b) N = n1n2n3 = 543 = 60
Again, no particular order is required in filling up
the positions. Here, n1 = 5, n2 = 4 and n3 = 3. After
supposedly having assigned a digit (chosen out of 5) in the
28
first position, there will be 4 remaining digits to choose
from for the second position, and then 3 remaining digits
to choose from for the third position. Thus, there are N =
n1n2n3 = 543 = 60 possible three-digit numbers that can
be formed if repetition is not allowed, using the given 5
distinct digits in set A.
(c) N = n1n2n3 = 355 = 75 (with repetition)
N = n1n2n3 = 343 = 36 (without repetition)
Here, we have to consider a restriction that only the
three even digits 2,4, and 8 are the possible choices for the
units position, since a number formed is even or odd,
depending on the digit assigned to this position. For this
reason, the units position has to be filled up first, then any
of the other two positions can be filled up next. So we
have n1 = 3 ways of filling up first the units position. After
supposedly having assigned an even digit for the units
position, and since repetition is allowed, then there remains
n2 = n3 = 5 ways again of choosing a digit for the second
and third positions to be filled up. Thus N = n1n2n3 =
355 = 75 possible three-digit even numbers that can be
formed if repetition is allowed, out of the given 5 distinct
digits in set A.
If repetition is not allowed, then n2 = 4 and n3 = 3,
since each time a position is supposedly filled up, there
will be one less than the previous number of choices. Thus
if repetition is not allowed, N = n1n2n3 = 343 = 36
possible three-digit even numbers that can be formed if
repetition is not allowed, using the given 5 distinct digits in
set A.
(d) Solving the problem in the same manner as above, the
following can be obtained:
N = n1n2n3 = 455 = 100
three-digit numbers greater
than 400, repetition allowed
29
N = n1n2n3 = 443 = 48
Example 5
three-digit numbers greater
than 400, repetition not
allowed
Try answering the questions in example 4, using the digits
in set B = {0,2,4,5,3}. Take note that 0 cannot be assigned
to the hundreds position when forming three-digit
numbers.
2.2 Permutations
In example 4, the questions in (b), (c) and (d), forming three-digit
numbers if repetition is not allowed, is similar to the problem of arranging
objects in a set, taken all or part of the objects at a time. Consider the set of
integers C = {1,4,5,7,2}. Then without repetition of the digits,
(a) two digit numbers can be formed such as 15, 51, and 45
(b) three digit numbers can be formed such as 415, 714, and 471
(c) five -digit numbers can be formed such as 14572, 42571, and 52714
The numbers are formed by selecting a number from the set, one at a
time; each number selected is assigned a specific position (a place value), so
that a different order of the digits gives a different number. An arrangement
of objects in a set such as this is known as permutation.
To proceed, we will make use of the mathematical notation called
factorial notation:
Definition 2.2 Factorial Notation The product of the positive integers
from 1 to n is denoted by the special symbol n! (read “n factorial”):
n! = n(n-1) (n-2)    321
It is also convenient to define 0! = 1.
Definition 2.3 Permutation A permutation is an arrangement of all or part
of a set of objects.
30
Theorem 2.1 The number of permutations of n distinct objects taken r at a
time denoted by nPr is
n
Pr 
n!
(n  r)!
Corollary 2.2 There are n! permutations of n objects (taken all the objects
each time).
Example 6 Let us apply the formulas. The number of two-digit numbers
that can be formed without repetition using the five digits in set
C={1,4,5,7,2} is
5
P2 
5!
5! 5  4  3  2  1
 
 5  4  20 .
(5  2)! 3!
3  2 1
The number of three-digit numbers that can be formed without
repetition is
5
P3 
5!
5! 5  4  3  2  1
 
 4  3  60 .
(5  3)! 2!
2 1
And the number of five-digit numbers, that is, using all the
digits in the set to form the number, is
5
P5 
5!
5! 5  4  3  2  1
 
 5  4  3  2  120
(5  5)! 0!
1
Example 7 Suppose there are 7 contestants competing for the champion,
first runner up and second runner up titles in a singing contest.
The number of ways the contest can turn out, without ties, is
equal to
7
P3 
7!
7! 7  6  5  4  3  2  1
 
 7  6  5  210
(7  3)! 4!
4  3  2 1
31
Example 8 Five different colored light bulbs are to be hanged at the top of
the stage for a school program. The number of possible
arrangements of the bulbs is equal to
5
P5 
5!
5! 5!
   5!  5  4  3  2  1  120
(5  5)! 0! 1
In the last example, by Corollary 2.3, the number of permutations or
arrangements of 5 bulbs taken all the bulbs each time is equal to 5!.
Circular Permutations
Arrangement of objects in a circle is called circular permutation. Two
circular permutations are the same unless corresponding objects in the two
arrangements are preceded or followed by a different object as we proceed
in a clockwise direction. The circular permutation of n objects remains the
same when all the objects are moved one position in a clockwise direction.
By considering one object in a fixed position and arranging the other n-1
objects in (n-1)! ways, we obtain that there are (n-1)! distinct arrangements
in a circle for n objects.
Theorem 2.3 The number of permutations of n distinct objects arranged in
a circle is (n-1)!
Example 9
Five persons dancing in a circle can form 4! = 24 distinct
circular arrangements.
Permutations with Repetitions
There are instances that the objects to be arranged in a set are not all
distinct, so that several arrangements using the objects look the same since
the objects that are alike are indistinguishable. Suppose a child is given the
four magnetic letters: M, K, E and E. The child then was asked to arrange
the letters to form a four-letter word (not necessarily with meaning).
Suppose he formed MEKE (this is one permutation of the four letters). Then
he exchanged the two E’s, forming MEKE again. Since the two letters
32
interchanged are both E’s then the resulting permutation will look the same
as the previous one. In this example, since there are two letters which are
the same in the set, the number of distinct permutations will only be half of
the number of permutations if there are four distinct letters, since in all
permutations of the four letters, there are 2! =2 permutations of the two letter
Es.
The following theorem gives the formula for counting the number of
permutations of n objects with some objects not all distinct.
Theorem 2.4
The number of permutations of n objects of which n 1 are
alike, n2 are alike, …, nk are alike, such that n1+n2+…+nk = n,
is
nPn1,n2,…,nk
=
n!
n 1! n 2 !...n k !
Example 10 A delivery of new books arrived in the university library. The
box contains 4 copies of a Statistics book by Walpole, 3 copies
of a Calculus book by Leithold, and 6 copies of an Accounting
book by Meigs, The librarian decided to put all the books
together on a vacant shelf that is wide enough to accommodate
all of the 13 books on a single line. Since the 13 books are not
all distinct, especially that they are all new so that copies of a
book look the same, the number of possible distinct
arrangements or permutations of the books on the shelf is
determined using the formula in Theorem 2.3:
13P4,3,6
=
13!
= 60,060
4!3!6!
Ordered Samples
Many combinatorial analyses involve drawing or choosing an object
from a set of n objects. This is what is known as sampling. When one ball
is drawn after another from a box, r number of times, we call the result of
the procedure as an ordered sample of size r. There are two cases to
consider:
33
(a) Sampling without Replacement
Consider an experiment in which a book is selected and removed from
a box consisting of n different books, a second book is then selected and
removed from the remaining n -1 books, and finally a third book is selected
from the remaining n – 2 books. In this experiment, any one of the n books
could be selected first. After the first selected book has been removed, any
one of the other n – 1 books could be selected second. This means that there
are n(n-1) ordered selections or possible outcomes for the first two
selections. Then, for any given outcome of the first two selections, there are
n – 2 other books that could possibly be selected third. Therefore, the total
number of possible outcomes is n(n-1)(n-2) ordered selections. Thus each
outcome in the sample space  of this experiment will be some arrangement
or order of three books. Each different arrangement or order of the three
books selected is also a permutation. The number of ordered samples
resulting from sampling r objects from n objects without replacement is
similar to the number of permutations of n objects taken r at a time. Using
our example that three books are selected one at a time without replacement
from say 10 distinct books, then the number of possible ordered samples is
10(10  1)(10  2) = 10  9  8 = 720
Applying the permutation formula
10
P3 
10!
10! 10  9  8  7!


 10  9  8  720
(10  3)! 7!
7!
Thus, formally, if r objects is selected one at a time, without replacement
from n objects, then the number of possible ordered samples is
n( n  1)( n  2)    ( n  r  1) =
n( n  1)( n  2)    ( n  r  1)( n  r )!
= n Pr
( n  r )!
(b) Sampling with Replacement
Suppose in the previous experiment, the book is returned back into the
box each time, before performing the next selection. Since there are n books
in the box, then there will always be n different ways of choosing a book in
34
each draw. The resulting sample is called an ordered sample with
replacement, and the number of possible ordered sample is
n  n  n    n  nr
r times
2.3
Combinations
Another common problem is counting the number of ways a selection
of r objects without regard to order can be done, from a set consisting of n
objects. These selections are called combinations. The number of such
combinations is given in the next theorem:
Definition 2.4 Combination A combination is any selection of all or part
of set of objects without regard to order.
Theorem 2.5 The number of combinations of n distinct objects taken r at a
time is equal to
n
nCr
Cr 
n!
( n  r )! r!
n
is also written as   , a combination creates a partitioning of the n
r
 
objects in the set, such that one part consists of r objects, and the other part
consists of the n-r objects that are left.
Example 11 The Chairman of the Department of Statistics in the College of
Arts and Sciences is to choose from the senior class of 20
students, a delegation to consist of 5 students for the Annual
35
Student-Faculty Convention in October. The number of ways
he can select to form a group of 5 students is
20
 20 
20!
20!
C5    

 15,504
 5  (20  5)!5! 15!5!
Ordered Partitions
Suppose a set consists of n distinct objects. We are interested in the
number of ways we can draw n1 objects first, then n2 objects, …, then up to
nk objects from the set. In other words, we want to compute the number of
possible ordered partitions
(A1, A2, … Ak)
that can be made out of a set of n objects. A partition will consist of k cells:
cell A1 contains n1 objects selected first, A2 contains n2 objects selected
second, … and Ak contains nk objects last selected, where n1 + n2 + … + nk
= n. Ak actually contains the remaining nk objects left after the k-1
selections have been performed. Take note also that the order of objects in a
cell is not of importance, since each cell is considered a selection of objects.
Let us use a concrete illustration. Suppose we have 11 marbles in an
urn, numbered 1 to 11. Of interest is the number of ways we can draw, 4
marbles from the urn first, then 3 marbles, and lastly 4 marbles from the urn,
which is the same as partitioning the marbles into three cells: cell A1
consisting of 4 marbles first, then A2 consisting of 3 marbles, and lastly, A3
consisting of the remaining 4 marbles. Some of the possible outcomes are
(a)
(b)
(c)
{(1,3,5,6),(4,2,10),(11,7,9,8)}
{(11,7,9,8),(4,2,10), (1,3,5,6)}
{(11,9,6,4),(1,7,2),(10,5,8,3)}
Here, we use the term ordered partitions since (a) and (b) are considered two
different results of the process. However, if (a) and (b) are considered the
same, then that means we are interested in the unordered partitions of the 11
marbles.
Let us now compute the desired number in our example. Since we
begin with 11 marbles in the urn, there are 11C4 ways of drawing the first 4
36
marbles to form cell A1. Then there are 7 marbles left in the urn from which
to draw the next 3 marbles to form cell A2, giving us 7C3 ways of selecting
the 3 marbles. And lastly, there are 4C4 ways of forming the last cell A3.
Thus there are
11
11 7  4 
C4 7 C3 4 C4     
 4  3  4 
=
11!
7!
4!
.
.
(11  4)!4! (7  3)!3! (4  4)!4!

11! 7! 4!
.
.
7!4! 4!3! 0!4!

11!
= 11,550
4!3!4!
possible ordered partitions of the 11 marbles into cells A1 containing 4
marbles, A2 containing 3 marbles, and A3 containing 4 marbles.
But suppose the ordering of the partitions is not important, that is
results (a) and (b) in the illustration above are considered the same, then
since cells A1 and A3, are both to be assigned 4 marbles, and these two cells
can be arranged in 2! ways, therefore, there are
11
C 4 7 C 3  4 C 4 
1 11 7  4  1
      = 5775
2!  4  3  4  2
possible unordered partitions of the 11 marbles into three cells, a cell
containing 3, and the rest, 4 marbles.
The following theorem formally states the mathematical formula to
calculate the desired number of ordered partitions:
Theorem 2.6 Let A contain n elements and let n1, n2, … , nk be positive
integers with n1+n2+ … +nk = n. Then there exist
n


n!

 =
 n1 , n 2 ,..., n k  n1! n 2 !  n k !
37
different ordered partitions of A of the form (A1,A2, … , Ak) where A1
contains n1 elements, A2 contains n2 elements, … , and Ak contains nk
elements.
Examining the formula in theorem 2.5, the number in the numerator
represents the total number of elements and the numbers in the denominator
represent the number of elements going in each cell.
Example 12 There are 25 senior students to go out on the on-job-training
(OJT) course next semester. Two government and 3 private agencies
signified approval to accommodate the students. To G1 and G2
agencies will be sent 4 and 3 students respectively, and to P 1, P2 and
P3 agencies, 5, 7, and 6 students respectively. Therefore, the number
of ways of distributing the 25 students to these 5 destinations is
computed as
25


25!

 =
4! 3! 5! 7! 6!
 4, 3, 5, 7, 6 
= 247,365,374,256,000
Example 13 An organization consisting of 4 graduate and 12
undergraduate students is planning to launch a concert project. The
members agreed to fill up four committees of four members each.
What is the probability that each committee includes a graduate
student?
Solution:
Considering that committees will be assigned different tasks,
the division of the members will be an ordered partition. The total
number of possible ordered partitions, which is also the size of the
sample space is
n() =
16!
.
4! 4! 4! 4!
38
Let us now focus on the event that each group contains a graduate
student.
Generating an outcome with this property can be
accomplished in two stages:
(a) Take the four graduate students and distribute them to the four
groups. There is a total of n1 = 4! ways of assigning a graduate
student to the four groups.
(b) Take the remaining 12 undergraduate students and distribute them
to the four groups (3 students in each). This can be done in
n2 =
12!
3! 3! 3! 3!
different ways.
By the fundamental principle of counting, the event of interest can
materialize in
n1n2 = 4! 
12!
ways.
3! 3! 3! 3!
Thus, assuming that forming the committees is done at random, then
P(each group includes a graduate students)
= (4! 
2.4
12!
16!
)/ (
)
3! 3! 3! 3!
4! 4! 4! 4!
Tree Diagrams
A tree diagram is a tool for enumerating all the possible outcomes of
an overall random experiment characterized by a sequence of experiments
where each experiment can occur in a finite number of ways. It is
constructed using branches corresponding to the outcomes of the first
experiment, emanating from a single point. Then from each branch of the
first experiment branches are drawn to represent the outcomes of the second
experiment. The process is continued for further experiments in the sequence
39
if necessary. The total number of branch ends is the number of possible
outcomes or n() of the entire random experiment.
Example 14 The tree diagram for the experiment tossing a coin and rolling a
die:
Since there are two outcomes (heads and tails for the coin), draw two
branches from a single point and label one H for head and the other one T
for tail. From each one of these outcomes, draw and label six branches
representing the outcomes 1, 2, 3, 4, 5, and 6 for the die. Trace through each
branch to find the outcomes of the experiment. Hence there are twelve
outcomes. They are H1, H2, H3, H4, H5, H6, T1, T2, T3, T4, T5, and T6
which are the total number of branch ends of the diagram. Once the sample
space  and n() have been found, probabilities for events A can be
computed. The number of sample points of A, n(A) is the number of branch
ends with attribute A.
Example 15
Using the tree diagram in example 14, find the
probability of getting
a. A head on the coin and a 3 on the die.
b. A head on the coin.
c. A 4 on the die.
40
Solution:
To solve the problem, assume that we have equally likely
possible outcomes so that we can use the formula P(A) =
n(A)/n().
n() = 12,
n(head on the coin and 3 on the die) = 1
n(head on the coin) = 6
n(4 on the die) = 2
a. P(H3) = 1/12
b. P(head on the coin) = 6/12 = 1/2
c. P(4 on the die) = 2/12 = 1/6
Example 16
Gerald and Dennis are to play a chess tournament. The first to win
two games in a row or who wins a total of three games will be the champion.
The following tree diagram shows the possible outcomes of the event.
41
It can be observed that there are ten endpoints corresponding to the
number of possible outcomes of the tournament. These are: GG, GDGG,
GDGDG, GDGDD, GDD, DGG, DGDGG, DGDGD, DGDD, and DD. The
path from the beginning to the endpoint indicates the winner of each match
during the tournament until a player won two in a row or three games.
Activities:
1. A multiple choice examination has 10 questions, with each question
having four choices. Assuming that every question is answered, how
many different possible sets of 10 answers are there?
2. In an experiment, a die is rolled four times with the number of spots on
the uppermost face recorded after each toss. How many elements are
there in the sample space?
3. A mother told her son to go to the supermarket to buy a tube of
toothpaste and a bottle of shampoo. There are 5 brands of toothpaste,
with each brand in three different sizes, and 7 brands of shampoo, each in
two different sizes. How many different pairs of toothpaste and shampoo
can be purchased?
4. A physician wants to perform a research on the swine flu virus, and he
needs three subjects from the 35 patients infected with the virus that are
currently in the hospital. How many different selections are possible?
5. A hamburger stall sells 10 different sandwiches. Four sandwiches were
ordered one after another. How many different sequences of four
sandwiches are possible?
6. A man has 5 coins in his wallet. He decided to give a coin to each of his
three sons. How many ways can this be done?
7. A class of 20 students is going on a field trip on a school bus. How many
distinct sitting arrangements of these 20 students in the bus into five rows
of four students each are possible if (a) the arrangement within rows are
not relevant; (b) the arrangement within rows are relevant?
42
8. Eight girls are to sit in chairs arranged in a circle. If two of the girls are
best friends and want to always be next to each other, how many sitting
arrangements are possible?
9. In how many ways can 5 persons sit in a row? Suppose two of the
persons doesn’t want to be next to each other, in how many ways can
they be arranged?
10.(i) How many distinct permutations can be formed from all the letters of
the word ABUNDANCE? (ii) How many of them begin and end with A?
(iii) How many of them have the two A’s always together?
11.An old lady will be celebrating her 50th birthday. In how many ways can
she invite 6 of her 14 close friends to dinner? (ii) In how many ways if
two of the friends are sisters and will not attend separately? (iii) In how
many ways if two of them are not on speaking terms and will not attend
together?
12.For the Statistics Computing class, in how many ways can the teacher
assign 9 students evenly to 3 computers?
13.In how many ways can n objects be partitioned into groups containing at
least one object?
14.In how many ways can 14 students be divided into four teams, two
containing 4 students and others 3?
15.Construct a tree diagram for the number of permutations of {w,r,s,t}.
16.Teams X and Y are in a tournament. The first team to win two games in
a row or a total of four games wins the tournament. How many possible
ways can the tournament occur?
43