0% found this document useful (0 votes)
23 views14 pages

STA 111 Lecture One - Permutations and Combinations - 123129

The document provides an introduction to permutations and combinations in statistics, explaining how to calculate the number of arrangements of distinct objects and the significance of order in these arrangements. It details the factorial notation and presents formulas for calculating permutations (nPr) and combinations (nCr), including examples and illustrations. Additionally, it discusses cases where objects are not distinct and how to handle such scenarios in counting permutations.

Uploaded by

zgmhvyy6jz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views14 pages

STA 111 Lecture One - Permutations and Combinations - 123129

The document provides an introduction to permutations and combinations in statistics, explaining how to calculate the number of arrangements of distinct objects and the significance of order in these arrangements. It details the factorial notation and presents formulas for calculating permutations (nPr) and combinations (nCr), including examples and illustrations. Additionally, it discusses cases where objects are not distinct and how to handle such scenarios in counting permutations.

Uploaded by

zgmhvyy6jz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

UNIVERSITY OF ILESA, ILESA, OSUN STATE, NIGERIA

DEPARTMENT OF COMPUTER SCIENCE

STA 111: Descriptive Statistics (Computer Science) (3 Units C: LH 45)

1.1 PERMUTATIONS
1.1.1 Introduction
Suppose that you have the three letters A, B and C, one each of three separate cards, and
that you are going to arrange them in a line to form ‘words’. How many three-letter
words are there?
In this case the number of words is small enough for you to write them out in full.
ABC ACB BCA BAC CAB CBA
You could also show the possible choices by using a tree diagram, as in Fig. 1.1.
First Second Third Word
letter letter letter
B C ABC
A C B ACB
C A BCA
B A C BAC
A B CAB
C B A CBA
Fig. 1.1: Possible words made from the letters A, B and C
You have 3 choices for the letter:
either A, B and C.
Having chosen the first letter, you then just 2 choices for the second letter:
B or C if A has been used,
C or A if B has been used,
A or B if C has been used.
Having chosen the first two letters, you then have only 1 choice for the third letter:
only C is left if A and B have been used,
only B is left if C and A have been used,
only A is left if B and C have been used.
So altogether there are 3 x 2 x 1 =6 possible words you can make with three letters.

1
Using a similar argument you can find the number of words which you can make from
four letters A, B, C and D.
You have 4 possibilities for the first letter.
Having chosen the first letter, you then have 3 possibilities for the second letter.
Having chosen the first two letters, you then have 2 possibilities for the third
letter.
You then have only 1 possibility for the last letter.
Therefore there are 4 x 3 x 2 x 1 = 24 possible words.
Each of these 24 possibilities is listed on Fig. 1.2.
ABCD BACD CABD DABC
ABDC BADC CADB DACB
ACBD BCAD CBAD DBAC
ACDB BCDA CBDA DBCA
ADBC BDAC CDAB DCAB
ADCB BDCA CDBA DCBA
Fig. 1.2: All possible arrangements of the letters A, B, C and D
You can now generalize this result to the case where are n distinct letters.
When you arrange n distinct letters in a line, the number of different ‘words’ you
can make is n x (n – I) x (n – 2) x … x 2 x 1.
The argument and the result given above apply whenever n distinct objects are arranged
in a line. The objects need not be letters. The different arrangements of the objects are
called permutations.
It is useful to have a concise way of writing the expression
n x (n – I) x (n – 2) x … x 2 x 1.
The expression n x (n – I) x (n – 2) x … x 2 x 1 is called n factorial and written as n!.
The number of permutations of n distinct objects is n!, where
n! = n x (n – I) x (n – 2) x … x 2 x 1. (1.1)
Table 1.3 shows how the number of permutations increases as the number of objects
being arranged gets larger.

2
Table 1.3: Number of permutations as n increases
Number of object, n Number of permutations
1 1=1
2 2x1=2
3 3x2x1=6
4 4 x 3 x 2 x 1 = 24
5 5 x 4 x 3 x 2 x 1 = 12

As you can see, the number of permutations increases very rapidly as the number of
objects being arranged gets larger. For example,
8! = 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 = 40320.
Your calculator will probably give you values of n! but it can only approximate by using
standard index form as n gets larger.
Suppose now that you have more letters than you need to make a word. For example,
suppose that you have the seven letters A, B, C, D, E, F and G but that you want to make
a four-letter word.
You have 7 choices for the first letter.
Having chosen the first letter, you have 6 choices for the second letter.
Having chosen the first two letters, you have 5 choices for the third letter.
Having chosen the first three letters, you have 4 choices for the fourth (and last) letter.
The number of permutations of 4 letters chosen from 7 letters (that is, the number of
four-letter words) is therefore 7 x 6 x 5 x 4.
This result can be written concisely in terms of factorials.
7 x 6 x 5 x 4. = 7 x 6 x 5 x 4 x 3 x 2 x 1 = 7! = 7!
3x2x1 3! (7 – 4)!

This is an illustration of a general rule.


The number of different permutations of r objects which can be made from n distinct
objects is n! . This number is usually given the special symbol nPr
(n – r)!

3
The number nPr of different permutations of r objects which can be made from n
distinct objects is given by nPr = n! (1.2)
(n – r)!

On some calculators, this is written as nPr


A newer notation for the same thing is nr, read ‘n to the r falling’, which means
n(n – 1)…(n – r + 1). It is like a power, but instead of multiplying the number n by
itself r times, the number is decreased by one in each factor. In this course, we will use
the older nPr notation.

Illustration 1.1
Eight runners are hoping to take part in a race, but the track has only six lanes.
In how many ways can six of the eight runners be assigned to lanes?
Using Equation 1.2, the number of permutations is
8
P6 = 8! = 8! 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 = 20160.
(8 – 6)! 2! 2x1

Notice that, if you try to use the formula nPr = n! to find the number of
(n – r)!
permutations of the eight letters A, B, C,…..,H, you find that
8
P8 = 8! = 8!
(8 – 8) 0!
But 0! cannot be defined using the relationship n! = n x (n -1) x (n – 2) x … x 2 x 1, so
what does 0! mean? The answer is that it can be defined to be any convenient value.
Recall that 8P8 denotes the number of permutations of 8 objects when you have selected
them from 8 distinct objects. But this has already been shown to be 8!.
Therefore 8! should equal 8!
0!
This will only be true if 0! = 1. The value of 0! is defined to be 1 to make the formula
for nPr consistent when r = n.

Illustration 1.2
Eight people, A, B,….H, are arranged randomly in a line. What is the probability that
a. A and B are next to each other, b. A and B are not next to each other?
4
a There is a neat trick which helps to solve this problem. Imagine that A
and B are stuck together in the order AB. There are then 7! ways to arrange
the people in line. There are also another 7! ways to arrange them if A
and B are stuck together in the order BA. There are therefore 2 x 7! ways
of arranging the eight people in line with A and B next to each other.
However, there are 8! ways of arranging the eight people in line if there
are no restrictions.
The required probability is therefore 2 x 7! = 2 = 1
8! 8 4
b P(A and B are not together) = 1 – P (A and B are together),

so P(A and B are not together) = 1- 1 = 3


4 4
If you need to find the probability that two objects are not together, it is usually a good
idea to first find the probability that they are together.
In this section emphasis is placed on the fact that the objects being arranged have to be
distinct. That is, you have to be able to identify each object uniquely. The next section
shows how to tackle the permutation problem when the objects are not distinct.

1.1.2 Permutations when the objects are not distinct


Recall that there were 4! = 24 permutations of the letters A, B, C and D. These were
listed earlier in Fig. 1.2. Imagine that the A remains but that the letters B, C and D are
all replaced by the letter Z. How many permutations will there be now?
Suppose that B is temporarily replaced by Z1, C is replaced by Z2 and D is replaced by
Z3 so that you can tell the Zs apart. Figure 1.4 shows the permutations of A, Z1, Z2 and
Z3 using a different procedure from that used to write out Fig. 1.2.

Write the first permutation of A, Z1, Z2 and Z3 at the top of the first column. Any
permutation can be the first permutation. Leave A in the same position, but write the
other permutations of Z1, Z2 and Z3 underneath. Write a permutation not already used at
the top of the next column, and repeat writing the other permutations of Z1, Z2 and Z3
underneath while keeping A in the same position. Keep going until you have written
all the permutations of Z1, Z2 and Z3.

5
AZ1 Z2Z3 Z1 AZ2Z3 Z1 Z2AZ3 Z1 Z2Z3A
AZ1 Z3Z2 Z1 AZ3Z2 Z1 Z3AZ2 Z1 Z3Z2A
AZ2 Z1Z3 Z2 AZ1Z3 Z2 Z1AZ3 Z2 Z1Z3A
AZ2 Z3Z1 Z2 AZ3Z1 Z2 Z3AZ1 Z2 Z3Z1A
AZ3 Z1Z2 Z3 AZ1Z2 Z3 Z1AZ2 Z3 Z1Z2A
AZ3 Z2Z1 Z3 AZ2Z1 Z3 Z2AZ1 Z3 Z2Z1A
Fig. 1.4: All permutations of the letters A, Z1, Z2 and Z3
There are 4! arrangements in Fig. 1.4. Each column has all the permutations of
Z1, Z2 and Z3 3! in all, so there must be 4! = 4 columns altogether. Now replace Z1, Z2
3!
and Z3 by Z and you have the permutations of A, Z, Z and Z in the top row. These are
AZZZ, ZAZZ, ZZAZ, ZZZA.
You can generalize this argument. Suppose that you have n objects and r of them are
identical. Then the number of arrangements in the table equivalent to Fig. 1.4 to the
arrangement at the top of the column, you find that there are r! rows. The number of
columns (that is, the number of distinct permutations) is therefore n!
r!

This result also generalizes.

The number of distinct permutations of n objects, of which p are identical to each


other, and then q of the remainder are identical, and r of the remainder are
identical, and so on is

n!, , where p + q + r + … = n.
p! x q! x r! x …

Illustration 1.3
Find the number of distinct permutations of the letters of the word MISSISSIPPI.
The number of letters is 11, of which there are 4 Ss, 4 Is, 2 Ps and 1 M. The
number of distinct permutations of the letters is therefore
_____11!______ = 34650
4! x 4! x 2! x 1!

6
UNIVERSITY OF ILESA, ILESA, OSUN STATE, NIGERIA
DEPARTMENT OF COMPUTER SCIENCE

STA 111: Descriptive Statistics (Computer Science) (3 Units C: LH 45)

1.2 COMBINATIONS
1.2.1 Introduction
In the last section, you considered permutations (arrangements), for which the order of
the objects is significant when you count the number of different possibilities. In some
circumstances, however, the order of selection does not matter. For example, if you
were dealt a hand of 13 cards from a standard pack of 52 playing cards, you would not
be interested in the order in which you received the cards. When a selection is made
from a set of objects and the order of selection is unimportant it is called combination.
To see the difference between combinations and permutations, consider what happens
when you select three letters from the four letters A, B, C and D.
Here is a procedure for finding all the combinations. It starts by considering
permutations, and gives you a method of counting the combinations.
Start with any permutation of three letters from A, B, C and D, and write it at the top of
the first column. Write the other permutations of the same three letters underneath it.
Write a permutation not already used at the top of the next column, and write the other
permutations of the letters underneath. Keep on until you have used all the permutations
of three letters from A, B, C and D.
The results are shown in Fig. 2.1
ABC ABD ACD BCD
ACB ADB ADC BDC
BAC BAD CAD CBD
BCA BDA CDA CDB
CAB DAB DAC DBC
CBA DBA DCA DCB
Fig. 2.1: Procedure for finding the number of combinations

7
Each column then corresponds to a single combination because the elements in any one
column differ only in the order in which the letters are written. The permutations are
all different, but they all give rise to the same combination at the head of the column.
To count the combinations, it is sufficient to count the columns.
There are 4P3 permutations of 3 objects from 4 objects, so there are 4P3 elements in total
in Fig. 2.1
Each column has 3! elements, so by dividing, you find that there must be 4P3
3!
4 4
columns, which means P3 combinations. As P3 = 4! ,
(4 – 3)!
4
P3 = 4! = 4! = 4x3x2x1 = 4
3! (4-3)!x3! 1!x3! 1x(3x2x1)
So there are 4 combinations of three letters from the four letters A, B, C and D.
You can apply this reasoning and this calculation to finding the number of combinations
of r objects taken from n objects. In the table which corresponds to Fig. 2.1, there would
be nPr elements in total, and each column would have r! elements. There would
therefore be nPr columns, which corresponds to nPr combinations of r objects taken
r! r!
from n objects.
Writing nPr in factorials as n! leads to a simpler expression to remember: the number
(n-r)!
of combinations of r objects taken from n objects is n!___
(n-r)! x r!
The number of combinations of r objects chosen from n distinct objects is given the
𝑛
symbol ( ) which is often read as ‘n choose r’. The older symbols nCr and nCr are also
𝑟
used, and your calculator probably uses one of them.
A combination is a selection in which the order of the objects selected is
unimportant.
The number of different combinations of r objects selected from n distinct objects
𝒏 𝒏 𝒏!
is ( ) where ( ) =
𝒓 𝒓 (𝒏−𝒓)!𝒙 𝒓!

8
Illustration 1.4
The manager of a football team has a squad of 16 players. He needs to choose 11 to
play in a match. How many possible teams can be chosen?
This example is not entirely realistic because players will not be equally capable of
playing in every position, but it does show how many possible teams there are. It is
important to decide whether this question is about permutations. Clearly the important
issue here is the people in the team and not their order of selection. Therefore this
question is about combinations rather than permutations.
16 16! 16!
The number of teams is ( )= = = 4368
11 (16−11)!𝑥 11! 5!𝑥 11!

The number of teams is surprisingly large.


You may notice in Illustration 2.1 that if you had chosen the 5 players to drop out of the
squad of 16 players, you would in effect be selecting the 11 by another method. You
16 16 16! 16!
can select the 5 players in ( ) ways, and ( ) = (16−5)!𝑥 5! = 11!𝑥 5!
5 5
16
which is clearly equal to ( )
11
16 16
When you come to calculate a number like ( ) 𝑜𝑟 ( ) , you can take a short cut.
11 5
Since 16! = 16 x 15 x . . . x 11 x 10 x . . . x 4 x 3 x 2 x 1, you can cancel the 11 x 10 x
…x 4 x 3 x 2 x 1 in the numerator with the 11! in the denominator.
Therefore you can write down immediately that
16 16𝑥15𝑥14𝑥13𝑥12
( )=
5 5!
where you need to make sure that you multiply 5 numbers in the numerator if the
denominator is 5!
In general
𝑛 𝑛𝑥 (𝑛 − 1)𝑥. . . 𝑥(𝑛 − 𝑟 + 1)
( )=
𝑟 𝑟!
Illustration 1.5
A team of 5 people, which must contain 3 men and 2 women, is chosen from 8 men and
7 women. How many different team can be selected?
8
The number of different teams of 3 men which can be selected from 8 is ( )
3
9
7
The number of different teams of 2 women which can be selected from 7 is ( )
2
8 7
Any of the ( ) men’s teams can join up with any of the ( ) women’s teams to make
3 2
an acceptable team of 5. Therefore you need to multiply these two quantities together
to find the number of different teams possible.
8 7 8𝑥7𝑥6 7𝑥6
The number of possible teams is ( ) 𝑥 ( ) = 𝑥 = 56 𝑥 21 = 1176
3 2 3𝑥2𝑥1 2𝑥1

You can now apply some of these counting methods to probability examples.
Illustration 1.6
Five cards are dealt without replacement from a standard pack of 52 cards. Find the
probability that exactly 3 of the 5 cards are hearts.
The sample space is very large. It would consist of a list of all possible sets of 5
cards which you could choose from the 52 cards in the pack. You do not need such a
list, however. All that you need to know is how many different sets of cards the sample
space contains. You are choosing 5 objects from 52, so the number of unrestricted
52
choices is ( ) because the order of selection is irrelevant.
5
Let A be the event that exactly 3 cards of the 5 dealt out are hearts. The method used to
find number of outcomes in the event A is very similar to the technique used in
Illustration 1.5
13
There are ( ) ‘teams’ of 3 hearts.
3
39
There are ( ) ‘teams’ of 2 ‘non-hearts’.
2
13 39
Therefore the number of sets of 5 cards with exactly 3 heart is ( ) 𝑥 ( )
3 2

13 39
( )𝑥( )
3 2
The probability that event A happens is 52 = 0.0815, correct 3 significant
( )
5
figures.

10
UNIVERSITY OF ILESA, ILESA, OSUN STATE, NIGERIA
DEPARTMENT OF COMPUTER SCIENCE

STA 111: Descriptive Statistics (Computer Science) (3 Units C: LH 45)

1.3 APPLICATIONS OF PERMUTATIONS AND COMBINATIONS


In Illustration 1.2 you were asked to find the number of ways that eight people could
stand in a line when two people had to stand next to each other. This was an illustration
in which you were asked to find the number of permutations or combinations of a set
of objects with some extra condition included. This section will show you how to
answer such questions.

Illustration 1.7
Find the number of ways of arranging 6 women and 3 men to stand in a row so that all
3 men are standing together.
You can make this problem simpler by thinking of the 3 men as a single unit.
Imagine tying them together for example! You would then have 7 items (or
units), the 6 individual women and the block of 3 men.
So one possible arrangement would be
W1 W3 W5 W6 W2 W4 M1 M3 M2,
where W3, for example, represents the third woman.
The number of permutations of these 7 units is 7!. However, for each of these
permutations the men could be arranged (inside the rope) in 3! different ways.
Therefore the total number of permutations in which the 6 women and 3 men can
be arranged so that the 3 men are standing together is 7! x 3! = 30240.

Illustration 1.8
Find the number of ways of arranging 6 women and 3 men in a row so that no two men
are standing next to one another.
You can ensure that no two men stand next to one another in the following way.
Arrange the 6 women to stand in a line with a space between each pair of them
and two extra spaces, one at each end of the line. One such arrangement is

11
space 1 space 2 space 3 space 4 space 5 space 6 space 7
W1 W2 W5 W4 W6 W3
There are 6! arrangements of the 6 women. For any of these 6! arrangements, you can
now pick a space in which to place the first man M1. This can be done in 7 ways.
Here is the arrangement above with one of the men, M1 placed in Space 2.
space 1 space 3 space 4 space 5 space 6 space 7
W1 M1 W2 W5 W4 W6 W3
By using a similar argument you can see that there will be 6 choices for the position
of M2 and 5 choices for the position of M3. Once the 3 men have been placed the
remaining spaces can be ‘closed up’ or simply ignored. By using this method you can
guarantee that no two men can stand next to one another. Also, all possible
arrangements will be counted using this method.
Therefore, the number of permutations in which no two men stand next to one another
is 6! x 7 x 6 x 5 = 151200.
It should be clear that you multiply 6! by 7, 6 and 5 because for every one of the 6!
arrangements of the women there will be 7 spaces to choose for M1 and then 6 places
to choose for M3 and then 5 places to choose for M3.
It is also worth noticing that the answers to Illustration 3.1 and 3.2. when added
together do not give 9!, which is the total number of arrangements of 9 people without
any restriction at all. This is because there is a third possibility. If two men were
standing together and the third man was separated from these two by some women, then
it would not be the case that all the men were together but neither would it be the case
that the three men were all apart from one another.

Illustration 1.9
A group of 12 people consisting of 6 married couples is arranged at random in a line for
a photograph. Find the probability that each wife is standing next to her husband.
The number of unrestricted arrangements is 12!. Each of them is equally likely.
If each husband and wife ‘couple’ is to stand together, then you can consider
each couple as a unit. There are therefore 6 such units.
The number of permutations of these units is 6!

12
But the first couple H1 W1 can be arranged in 2! ways, either H1 W1 or W1 H1.
This applies equally to couples 2, 3, 4, 5 and 6. Therefore the number of
arrangements in which each couple stands together is 6! x (2!)6.
Hence P (each couple stands together) = 6! x (2!)6 = 9.62 x 10-5
12!
correct to 3 significant figures.

Illustration 1.10
Four letters are to be selected from the letters in the word RIGIDITY. How many
different combinations are there?
The problem here is that the letters are not all distinct since there are three Is.
8
Therefore the answer is not ( ). In order to deal with this problem a useful
4
strategy is to split it into different cases depending on the number of Is chosen.
Case 1: Combinations with no Is
In this case you are selecting 4 letters from the 5 letters R, G, D, T, Y, so the
5
number of combinations is ( ) = 5
4
These are the combinations with no I. Remember that since this is a problem
about combinations you are not interested in the order. All that matters here is
which ‘team’ of letters you choose. The possible teams are
RGDT RGDY RGTY RDTY GDTY
Case 2: Combinations with one I
In this case you are selecting 3 letters from the 5 letters R, G, D, T, Y, together
5
with one I, so the number of combinations is ( ) = 10. Here are the
3
combinations with one I:
RGDI RGTI RGYI RDTI RGYI
RTYI GDTI GDYI GTYI DTYI
Case 3: Combinations with two Is
In this case you are selecting 2 letters from the 5 letters R,G,D,T,Y, together with
5
two Is, so the number of combinations is ( ) = 10. Here they are:
2

13
RGII RDII RTII RYII GDII
GTII GYII DTII DYII TYII
Case 4: Combinations with three Is.
In this case you are selecting 1 letter from the 5 letters R, G, D, T, Y, together
5
with three Is, so the number of combinations is ( ) = 5. Here they are:
1
RIII GIII DIII TIII YIII
The total number of distinct combinations of four letters selected from the letters
of the word RIGIDITY is 5 + 10 + 10 + 5 = 30. All 30 combinations have been
listed above.

Illustration 1.11
A bag contains 4 red balls and 5 yellow balls. From the bag, 5 balls are taken at random.
Find the probability that 3 of these 5 balls are red.
There are five possibilities for the numbers of each colour taken from the bag:
they could be YYYYY, RYYYY, RRYYY, RRRYY or RRRRY. So you might think that the
1
probability of 3 balls being red is . However, these possibilities are not equally likely.
5

You should think of the balls as being labelled, so actually there are many more than
five possibilities. In fact, as there are 9 balls in total and 5 are being taken, there are
9 9!
( )= = 126
5 5! 𝑥 4!
combinations for choosing 5 balls
4
The number of combinations for choosing 3 red balls from the 4 is ( ) = 4
3
5
and the number of combinations for choosing 2 yellow balls from the 5 is ( ) = 10.
2
So the total number of combinations for choosing 5 balls, of which 3 are red, is 4 x 10
= 40. Therefore the probability of choosing 3 red balls when 5 are taken at random is
40 20
=
126 63

14

You might also like