Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Discrete Mathematics

Lecture 7 - Permutations and Combinations

Nurlan Ismailov
nurlan.ismailov@astanait.edu.kz

Astana IT University

June 9, 2020

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 1 / 24
Permutations
Continuing to examine applications of the multiplication rule, we turn now to
counting linear arrangements of objects. These arrangements are often called
permutations when the objects are distinct.

In a class of 10 students, five are to be chosen and seated in a row for a


picture. How many such linear arrangements are possible?
The key word here is arrangement, which designates the importance of order.
If A, B, C, . . . , I, J denote the 10 students, then BCEF I, CEF IB, and
ABCF G are three such different arrangements, even though the first two
involve the same five students.

To answer this question, we consider the positions and possible numbers of


students we can choose from in order to fill each position. The filling of a
position is a stage of our procedure.

10 × 9 × 8 × 7 × 6
1st 2nd 3rd 4th 5th
position position position position position

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 2 / 24
Each of the 10 can occupy the 1st position in the row. Because repetitions are
not possible here, we can select only one of the nine remaining students to fill
the 2nd position. Continuing in this way, we find only six students to select
from in order to fill the 5th and final position. This yields a total of 30240
possible arrangements of five students selected from the class of 10.

Exactly the same answer is obtained if the positions are filled from right to
left - namely,
6 × 7 × 8 × 9 × 10.

If the 3rd position is filled first, the 1st position second, the 4th position third,
the 5th position fourth, and 2nd position fifth, then the answer is
9 × 6 × 10 × 8 × 7,
still the same value, 30240.

If we make use of the factorial notation, the answer can expressed in the
following more compact form:
5×4×3×2×1 10!
10 × 9 × 8 × 7 × 6 = 10 × 9 × 8 × 7 × 6 × = .
5×4×3×2×1 5!

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 3 / 24
Permute the letters a,b,c

Definition (Permutation)
Given a collection of n distinct objects, any (linear) arrangement of these
objects is called a permutation of the collection.

Example
Given three letters a, b, c. Permutations on a, b, c are
abc, acb, bac, bca, cab, cba.
So there are 6 permutations on three objects.

Proposition
The number of permutations of n distinct objects is n!.

Proof. It immediately follows from the definitions of permutation and


factorial 

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 4 / 24
k-permutation

Definition (k-permutation)
For natural numbers k and n, k ≤ n, an k−permutation of n objects is a
permutation of k of them, that is, an arrangement of k of the objects in a line
in some order. The number of k permutations of n objects is denoted by
P (n, k).

Examples
2-permutations of three letters a, b, c are
ab, ba, ac, ca, bc, cb
Hence P (3, 2) = 6.
Five students are to be chosen from 10 students and seated in a row for a
picture. Possible arrangements of five students selected from the class of
10 are just 5-permutations of 10 students. As we calculated above
P (10, 5) = 30240

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 5 / 24
|k-permutations of n objects|

Proposition
n!
Let k, n be integer numbers and 1 ≤ k ≤ n. Then P (n, k) = (n−k)!

Proof. If there are n distinct objects and k is an integer, 1 ≤ k ≤ n, then by


the multiplication rule, the number of k-permutations of n objects is

P (n, k) = n × (n − 1) × (n − 2) × · · · × (n − k + 1)

1st 2nd 3rd kth


position position position position
(n − k)(n − k − 1) · · · (3)(2)(1)
= n × (n − 1) × (n − 2) × · · · × (n − k + 1) ×
(n − k)(n − k − 1) · · · (3)(2)(1)
n!
= 
(n − k)!

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 6 / 24
Arrangements of the letters in BALL

The number of (linear) arrangements of the four letters in BALL is 12, not
4! = 24. The reason is that we do not have four distinct letters to arrange. To
get 12 arrangements, we can list them as in Table

A B L L A B L1 L2 A B L2 L1
A L B L A L1 B L2 A L2 B L1
A L L B A L1 L2 B A L2 L1 B
B A L L B A L1 L2 B A L2 L1
B L A L B L1 A L2 B L2 A L1
B L L A B L1 L2 A B L2 L1 A
L A B L L1 A B L2 L2 A B L1
L A L B L1 A L2 B L2 A L1 B
L B A L L1 B A L2 L2 B A L1
L B L A L1 B L2 A L2 B L1 A
L L A B L1 L2 A B L2 L1 A B
L L B A L1 L2 B A L2 L1 B A
(a) (b)

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 7 / 24
If two L0 s are distinguished as L1 and L2 , then we can use our previous ideas
on permutations of distinct objects; with the four symbols B, A, L1 , L2 we
have 4! = 24 permutations. These are listed in Table (b). The table reveals for
each arrangement in which the L0 s are indistinguishable there corresponds a
pair of permutations with distinct L0 s. Consequently,

2×(Number of arrangements of the letters B, A, L, L)

=(Number of arrangements of the symbols B, A, L1 , L2 )

and the answer to the original problem of finding all the arrangements of the
four letters in BALL is 4!
2 = 12.

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 8 / 24
Permutations with repetitions
Proposition
If there are n objects with n1 indistinguishable objects of a first type, n2
indistinguishable objects of a second type, . . ., and nk indistinguishable
objects of an kth type, where n1 + n2 + . . . + nk = n, then there are
n!
n1 !n2 !···nk !

(linear) arrangements of the given n objects.

We leave its proof to students


Example
How many arrangements are there of all the letters in MISSISSIPPI?
Solution. There are one M, four I,I,I,I, four S,S,S,S and two P, P in
MISSISSIPPI.
Then
11!
1!4!4!2!
arrangements of all letters in MISSISSIPPI.
Nurlan Ismailov nurlan.ismailov@astanait.edu.kz
Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 9 / 24
Combinations

Given three different colored balls and ten numbered boxes.

The number of ways to place these three balls into the boxes so that at most
one to a box, is P (10, 3) = 720. (Why?)

Explanation. We could place the first ball into any 10 boxes, so there are 10
ways of doing that. After we replace the first ball, we would have 9 ways of
putting the second ball. For the last ball there are 8 free boxes where we can
place it into. Therefore,

10 × 9 × 8 = P (10, 3) = 720.

Question
What if three balls are absolutely identical(the same size, the same color)?
Are there still 720 possibilities?

In fact, the number is much smaller.

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 10 / 24
Let’s try to understand

When there are red, blue and green balls, for each choice of boxes, there are
3! = 6 different ways of assigning the balls to boxes 3, 4 and 8, for instance.

Box 1 Box 2 Box 3 Box 4 ... Box 8 ...

1 red blue green


2 red green blue
3 blue red green
4 blue green red
5 green red blue
6 green blue red

When the ball are identical, these assignments are all the same. Thus, the
number of ways to put three identical balls into ten boxes is just the number
of ways to select three boxes out of ten.

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 11 / 24
Furthermore, for a given three boxes, there are 3! ways in which three balls of
different colors can be assigned to these boxes. By the multiplication rule, the
number of ways putting three balls of different colors into ten boxes (at most
one to a box) is the product of the numbers of selecting three boxes and the
number of ways then to assign the balls to these boxes.

P (10, 3) =(number of ways to select 3 boxes from 10)×3!.

To summarize,
Number of ways to select three boxes from ten
= number of ways to put three identical balls into ten boxes
= P (10,3)
3!
10!
= 7!3! = 120.

Definition
n

For integers k and n, and 0 ≤ k ≤ n, the binomial coefficient k (read “n
choose k”) is defined by
n n!

k = k!(n−k)! .

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 12 / 24
n n!

k = k!(n−k)!

Proposition
 with 0 ≤ k ≤ n. Then number of ways to choose k
Let n and k be integers
objects from n is nk .

Proof. If k = 0, the result is true


 because there is just one way to choose 0
objects (do nothing!), while n0 = 0!(n−0)!
n!
= 1 because 0! = 1. Thus, we may
assume that k ≥ 1 and hence n ≥ 1. Let N be the number we are seeking:
that is, there are N ways to choose k objects from the n given objects. Notice
that for each way of choosing k objects there are k! ways to order them. By
the multiplication rule, the number of k-permutations of n objects (which we
know is P (n, r)) is the number of ways to choose k objects multiplied by k!,
the number of ways to order the k objects
P (n, k) = N × k!.
Therefore,  
P (n, k) n! n
N= = =
k! k!(n − k)! k
which is what we wanted to show 
Nurlan Ismailov nurlan.ismailov@astanait.edu.kz
Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 13 / 24
Definition
A combination of a set of objects is a subset of them. A subset of k objects is
called an k-combination or a combination of the objects taken k at a time.

Corollary
n

The number of k-combination of n objects is k .

Example
2-combinations of the letters a, b, c, d, e is
 
5 5! 5×4
= = = 10.
2 2! × 3! 2×1

They are
{a, b}, {a, c}, {a, d}, {a, e}, {b, c}, {b, d}, {b, e}, {c, d}, {c, e}, {d, e}.

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 14 / 24
Some identities on binomial coefficients

n n
 
k = n−k where 0 ≤ k ≤ n

n n−1 n−1
  
k = k−1 + k where 0 ≤ k ≤ n − 1

n n n n n
    
0 + 1 + 2 + ... + n−1 + n = 2n where n > 0.

n n n n n
    
0 − 1 + 2 − . . . + (−1)n−1 n−1 + (−1)n n =0 where n > 0.
n

The first two can be proved using the definition of k or just applying
directly the preceding proposition to them.

The last two can be obtained from The Binomial Theorem which will be
stated below, substituting x = y = 1 and x = −1, y = 1, respectively.

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 15 / 24
Example

In how many ways can 4 balls be chosen from a box which contains balls
numbered from 1 to 10 if
(a) the ball numbered 1 not to be chosen?
(b) the ball numbered 1 should be chosen?
(c) the balls numbered 1 and 2 should be chosen?
(d) either the ball numbered 1 or 2 should be chosen?
(e) just one of the balls numbered 1 and 2 should be chosen?
(f ) the balls numbered 1 and 2 should not be chosen together?

Solution.
(a) The answer 94 = 126 since, in effect, it is necessary to select 4 balls from


9 excluding the ball numbered 1.


9

(b) The answer 3 = 84 since, 3 balls must be chosen from 9.

(c) The answer 82 = 28, it being necessary to choose the remaining 2 balls


from the box containing 8 balls.

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 16 / 24
Example

(d) 83 + 83 + 82 = 140. This would be to count separately the cases - the


  

ball numbered 1 (but not the ball numbered 2) is chosen, the ball numbered 2
(but not the ball numbered 1) is chosen, both balls numbered 1 and 2 are
chosen - and add the result.
An alternative method of obtaining this answer is to susbtract from the total
number of possible selections of 10 balls the number of selections containing
balls numbered neither 1 nor 2. This gives 10 8

4 − 4 = 140.

(e) 83 + 83 = 112. This would be to count separately the cases - the ball
 

numbered 1 (but not the ball numbered 2) is chosen, the ball numbered 2 (but
not the ball numbered 1) is chosen - and add the result.

(f ) 10 8
 
4 − 2 = 182. The number of selections containing balls numbered 1
and 2 is 82 by part (c), taking account that we have the answer.

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 17 / 24
Permutations and Combinations with Repetitions

In previous cases we counted the number of ways to put k balls into n boxes
with at most one ball to a box in two situations: The balls have different
colors and the balls are all the same color. Suppose we allow any number of
balls in a box. If the balls are all colored differently, then there are n choices
for the first ball, n for the second, and so forth. There are, altogether
n × n × · · · × n = nk possibilities. When the balls are all the same colour,
however, we expect for fewer possibilities.

Suppose we want to place three white balls into ten boxes and we are allowed
to put as many balls into a box as we like. There are three mutually exclusive
ways in which this can be accomplished. Each goes into a different box (in one
of 10
3 = 120); two balls go into the same box, but the third goes into its own
box (in one of 10 × 9 = 90 ways); or all the balls go into the same box (in one
of 10 ways). By the addition rule, the number of ways in all is
120 + 90 + 10 = 220. We note in passing that 220 = 10+3−1 3 .

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 18 / 24
Proposition
n+k−1

The number of ways to put k identical balls into n boxes is k .

We leave its proof to students. It is a very good exercise for


students.

Example
In how many ways can we distribute 7 bananas among four children so that
each child receives at least one banana?

Solution. After giving each one banana, consider the number of ways the
remaining 3 banana can be distributed among these four children. In fact, it is
equivalent question about replacing three identical balls into four boxes.
Consequently, there are 4+3−1

3 = 20 ways.

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 19 / 24
The number of ways to put k balls into n numbered boxes

same all different colors

n

at most one to a box (0 ≤ k ≤ n) k P (n, k)

n+k−1

any number in a box (n, k ≥ 0) k nk

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 20 / 24
The Binomial Theorem

Let n ∈ Z+ . Consider expansion of (x + y)n .

(x + y)0 = 1

(x + y)1 = x + y = 1 x + 1 y

(x + y)2 = x2 + 2xy + y 2 = 1 x + 2 xy + 1 y 2

(x + y)3 = x3 + 3x2 y + 3xy 2 + y 3 = 1 x3 + 3 x2 y + 3 xy 2 + 1 y 3

Theorem
For any x and y and any positive integer number n,
Pn
(x + y)n = k=0 nk xn−k y k


= n0 xn + n1 xn−1 y + n2 xn−2 y 2 + . . . + n−1


n
    n−1
xy + yn .

Proof. It is proved by PMI on n.

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 21 / 24
Example

Find the coefficient of x16 in the expansion of (2x2 − x2 )12 .

Solution. The general term in the expansion of this expression by the


Binomial Theorem is
   
12 2 12−k x k 12 12−k 1 k 24−k
(2x ) (− ) = 2 (− ) x .
k 2 k 2

We want 24 − k = 16; thus, k = 8. The coefficient is 12


 4 1 8 495
8 2 (− 2 ) = 16 .

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 22 / 24
Questions for Self-Study

Let n, k ∈ Z+ .
Let x1 + x2 + . . . + xn = k, with xi ≥ 0, for 1 ≤ i ≤ n.
What is the number of integer solutions of the equation?

Let x1 + x2 + . . . + xn < k, with xi ≥ 0, for 1 ≤ i ≤ n.


What is the number of integer solutions of the equation?

For positive n and k, what is the coefficient of xn1 1 x2n2 · · · xnk k in the
expansion
(x1 + x2 + . . . + xk )n ?

Note that when k = 2 we have The Binomial Theorem and the


coefficients are defined by binomial coefficients.

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 23 / 24
The End of Lecture 7

Nurlan Ismailov nurlan.ismailov@astanait.edu.kz


Discrete Mathematics
(Astana IT University)
Lecture 7 - Permutations and Combinations
June 9, 2020 24 / 24

You might also like