Beruflich Dokumente
Kultur Dokumente
Permutations
Don’t Panic A permutation of a set of distinct objects is an
I show a number of proofs in this lecture in order ordered arrangement of these objects. We also
to explain why certain formulae are used. You will are interested in ordered arrangements of some
not need to know these proofs in the exam – only
how to apply the formulae correctly. of the elements of a set. An ordered arrangement
of r elements of a set is called an r-permutation.
L EARN THIS DEFINITION
n Pr
Example Theorem 1 The number of r-permutations of set
Let S = {1, 2, 3}. The arrangement 3, 1, 2 is a with n distinct elements is
permutation of S. The arrangement 3, 2 is a
2-permutation of S. n Pr = n(n − 1)(n − 2) · · · (n − r + 1)
L EARN THIS THEOREM
Proof
• The first element of the permutation can be
chosen in n ways.
Using Factorials
• There are n − 1 ways to choose the second
n!
element ... and so on. n Pr =
(n − r)!
• There are n − (r − 1) = n − r + 1 ways to In particular, note that n Pn = n!.
choose the rth element.
• There are n(n − 1)(n − 2) · · · (n − r + 1)
(product rule) r-permutations of the set.
Example
How many ways are there to select a first-prize Example
winner, a second-prize winner, and a third prize
Suppose that a saleswoman has to visit eight
winner from 100 different people who have
different cities. She must begin her trip in a
entered a contest?
specified city, but she can visit the other seven
Solution: cities in any order she wishes. How many
• The order in which people are selected possible orders can the saleswoman use when
matters so we want a 3-permutation. visiting these cities?
Solution:
• The number of possible paths is the number of
Example
permutations of seven elements. How many permutations are there of the letters
• 7! = 7.6.5.4.3.2.1 = 5040. ABCDEFGH contain the string ABC?
Solution: Because the letters ABC must occur as
• If we wanted the route with the minimum a block, we can find the answer by finding the
distance (the travelling salesman problem) we number of permutations of six objects, namely
the block ABC and the individual letters D, E, F, G
must consider a total of 5040 paths. and H. Because these six objects can occur in
any order, there are 6! = 720 permutations of the
• The travelling salesman problem has many
letters, ABCDEFGH in which ABC occurs as a
applications such as designing printed circuit block.
boards and aeroplane route scheduling.
Example
Combinations
Let S be the set {1, 2, 3, 4}. Then {1, 3, 4} is a
An r-combination of elements of a set is an
unordered selection of r elements from the set. 3-combination from S. The 3-combination
Thus, an r-combination is simply a subset of the {1, 3, 4} is identical to the 3-combination {4, 1, 3}
set with r elements. even though the 3-permutations 134 and 413 are
different.
n Cr Proof
The number of r-combinations of a set with n The r-permutations of the set can be obtained by
distinct elements is denoted by n Cr . forming the n Cr r-combinations of the set, and
Theorem 2 The number of r-combinations of a then ordering their elements (n Pr ways).
set with n elements, where n is a nonnegative = n C r . r Pr
n Pr
integer and r is an integer with 0 ≤ r ≤ n, equals
So
n! n!
n Cr = n Pr (n−r)! n!
r!(n − r)! n Cr = = r!
=
r Pr (r−r)!
r!(n − r)!
L EARN THIS FORMULA
Example
How many ways are there to select five players
Corollary
from a 10-member tennis team to make a trip to Theorem 3 Let n and r be nonnegative integers
a match at another school? with r ≤ n. Then n Cr = n Cn−r .
Solution: The answer is given by the number of Proof:
5-combinations of a set with ten elements. n! n!
n Cn−r = = = n Cr
10! (n − r)!(n − (n − r))! r!(n − r)!
C
10 5 = = 252
5!5!
Calculating nCr
Example
• It is difficult to calculate large factorials
There are 30 people trained as astronauts to go
accurately (see how far you can get with your
on the first mission to Mars. How many ways are
calculator).
there to select a crew of six people to go on this
• In practice to calculate n Cr we perform mission?
canceling before multiplication.
Solution: 30 C6 because the order in which these
Example
people are chosen does not matter.
How many ways are there to select a committee
30!
30 C6 = to develop a discrete mathematics course if the
6!24!
30.29.28.27.26.25.24! committee is to consist of three lecturers from the
=
6!24! mathematics department (9 lecturers) and four
30.29.28.27.26.25 from the computer science department (11
=
6.5.4.3.2.1
= 593, 775 lecturers)?
Example
What is the expansion of (x + y)4 ?
Pascal’s Identity
Solution:
Theorem 5 Let n and k be positive integers with
X
4
(x + y)4 = 4 Cj x
4−j j
y n ≥ k. Then
j=0
4 4−1 2 2 3 4 n+1 Ck = n Ck−1 + n Ck .
= 4 C0 x + 3 C1 x y + 4 C2 x y + 4 C3 xy + 4 C4 y
= x4 + 4x3 y + 6x2 y 2 + 4xy 3 + y 4
Proof
• Let T be a set with n + 1 elements, a ∈ T and
S = T − {a}.
• There are n+1 Ck subsets of T with k elements.
So What?
Recall that we have problems calculating n! for
• A k-subset of T either contains a and k − 1 large n and so will have trouble calculating n Cr .
elements of S or k elements of S but not a. The identity allows us to define a recursive
function using only addition to calculate n Cr .
• S has n Ck−1 subsets with k − 1 elements and
n Ck subsets with k elements.
An Algorithm Summary