Prob 3160 CH 1
Prob 3160 CH 1
Combinatorics
Example 1.1. Suppose we have 4 shirts of 4 dierent colors and 3 pants of dierent colors.
How many dierent outts are there? For each shirt there are 3 dierent colors of pants, so
altogether there are 4 × 3 = 12 possibilities.
Example 1.2. How many dierent license plate numbers with 3 letters followed by 3
numbers are possible?
Solution : (26)3 (10)3 . Indeed, the English alphabet has 26 dierent letters, therefore there
are 26 possibilities for the rst place, 26 for the second, 26 for the third, 10 for the fourth,
10 for the fth, and 10 for the sixth. We multiply.
1.1.2. Permutations. How many ways can one arrange letters a, b, c? We can list all
possibilities, namely,
Example 1.3. What is the number of possible batting orders (in baseball) with 9 players?
© Copyright 2013 Richard F. Bass, 2020 Masha Gordina Typesetting date: March 31, 2020
3
4 1. COMBINATORICS
Solution : 9! = 362880.
Example 1.4. How many ways can one arrange 4 math books, 3 chemistry books, 2 physics
books, and 1 biology book on a bookshelf so that all the math books are together, all the
chemistry books are together, and all the physics books are together?
Solution : 4! · (4! · 3! · 2! · 1!) = 6912. We can arrange the math books in 4! ways, the chemistry
books in 3! ways, the physics books in 2! ways, and the biology book in 1! = 1 way. But we
also have to decide which set of books go on the left, which next, and so on. That is the
same as the number of ways of arranging of four objects (such as the letters M, C, P, B ), and
there are 4! ways of doing that.
9!
= 1260.
3!4!2!
What we just did is called nding the number of permutations. These are permutations
of a given set of objects (elements) unlike the example with the licence plate numbers where
we could choose the same letter as many times as we wished.
Permutations
The number of permutations of n objects is equal to
n! := 1 · ... · n,
with the usual convention 0! = 1.
Example 1.6. How many ways can we choose 3 letters out of 5? If the letters are a, b, c, d, e
and order matters, then there would be 5 choices for the rst position, 4 for the second, and
3 for the third, for a total of 5 × 4 × 3. Suppose now the letters selected were a, b, c. If order
does not matter, in our counting we will have the letters a, b, c six times, because there are
3! ways of arranging three letters. The same is true for any choice of three letters. So we
should have 5 × 4 × 3/3!. We can rewrite this as
5·4·3 5!
= = 10
3! 3!2!
1.1. BASIC COUNTING PRINCIPLE AND COMBINATORICS 5
5
choose 3.
This is often written as , read 5 Sometimes this is written C5,3 or 5 C3 .
3
Note that this is true when the order of selection is irrelevant, and if the order of selection
is relevant, then there are
n!
n · (n − 1) · ... · (n − k + 1) =
(n − k)!
ways of choosing k objects out of n.
Example 1.7. How many ways can one choose a committee of 3 out of 10 people?
Solution : 10
3
= 120.
Example 1.8. Suppose there are 8 men and 8 women. How many ways can we choose a
committee that has 2 men and 2 women?
Solution : 8 8
we can choose 2 men in ways and 2 women in ways. The number of possible
2 2
committees is then the product
8 8
2
· 2
= 28 · 28 = 784.
Example 1.9. Suppose one has 9 people and one wants to divide them into one committee
9
of 3, one committee of 4, and the last one of 2. There are ways of choosing the rst
3
6
committee. Once that is done, there are 6 people left and there are ways of choosing
4
the second committee. Once that is done, the remainder must go in the third committee.
So the answer is
9! 6! 9!
= .
3!6! 4!2! 3!4!2!
n n
k
= n−k
.
Indeed, the left-hand side gives the number of dierent groups of k objects chosen from a
total of n objects which is the same to choose n−k objects not to be in the group of k
objects which is the number on the right-hand side.
6 1. COMBINATORICS
n
n!
n1 ,...,nk
= .
n1 !n2 ! · · · nk !
(b) How many ways if all the Americans have to stand together?
(c) How many ways if not all the Americans are together?
(d) Suppose you want to choose a committee of 3, which will be all Americans or all Cana-
dians. How many ways can this be done?
(e) How many ways for a committee of 3 that is not all Americans or all Canadians?
Solution :
(a) This is just the number of arrangements of 10 elements, that is, 10!
(b) Consider the Americans as one group (element) and each Canadian as a distinct group
(6 elements); this gives 7 distinct groups (elements) to be arranged, which can be done in
7! ways. Once we have these seven groups arranged, we can arrange the Americans within
their group in 4! ways, so we get 4!7! by the basic counting principle.
(c) This is the answer to (a) minus the answer to (b): 10! − 4!7!
4
(d) We can choose a committee of 3 Americans in ways and a committee of 3 Canadians
3
6 4
+ 63 .
in ways, so the answer is
3 3
10 10 4 6
(e) We can choose a committee of 3 out of 10 in
3
ways, so the answer is
3
− 3
− 3
.
Example 1.12. First, suppose one has 8 copies of o and two copies of |. How many ways
can one arrange these symbols in order? There are 10 spots, and we want to select 8 of them
10
in which we place the os. So we have .
8
Example 1.13. Next, suppose one has 8 indistinguishable balls. How many ways can one
put them in 3 boxes? Let us use sequences of os and | s to represent an arrangement of balls
in these 3 boxes; any such sequence that has | at each side, 2 other | s, and 8 os represents a
way of arranging balls into boxes. For example, if one has
| o o | o o o | o o o |,
this would represent 2 balls in the rst box, 3 in the second, and 3 in the third. Altogether
there are 8+4 symbols, the rst is a | as is the last, so there are 10 symbols that can be
1.1. BASIC COUNTING PRINCIPLE AND COMBINATORICS 7
Example 1.14. Now, to nish, suppose we have $8,000 to invest in 3 mutual funds. Each
mutual fund required you to make investments in increments of $1,000. How many ways can
we do this? This is the same as putting 8 indistinguishable balls in 3 boxes, and we know
10
the answer is .
8
8 1. COMBINATORICS
m n = mn
Example 1.15. There are 20 teachers and 100 students in a school. How many ways can
we pick a teacher and student of the year?
Example 1.17 (Example 1.2 revisited). 6-place license plates, with the rst
Recall that for
three places occupied by letters and the last three by numbers, we have 26 · 26 · 26 · 10 · 10 · 10
choices. What if no repetition is allowed?
Example 1.18. How many functions dened on k points are possible if each function can
take values as either 0 or 1.
Solution : the counting principle or the box method on the 1, . . . , k points gives us 2k possible
functions. This is the generalized counting principle with n1 = n2 = ... = nk = 2.
1.2.2. Permutations. Now we give more examples on permutations, and we start with
a more general results on the number of possible permutations.
Permutations revisited
The number of dierent permutations of n objects of which n1 are alike, n2 are alike,
..., n2 are alike is equal to
n!
.
n1 ! · · · nr !
Example 1.19. How many ways can one arrange 5 math books, 6 chemistry books, 7
physics books, and 8 biology books on a bookshelf so that all the math books are together,
all the chemistry books are together, and all the physics books are together.
Solution : We can arrange the math books in 5! ways, the chemistry in 6! ways, the physics
in 7! ways, and biology books in 8! ways. We also have to decide which set of books go on
the left, which next, and so on. That is the same as the number of ways of arranging the
letters M,C,P, and B, and there are 4! ways of doing that. So the total is 4! · (5! · 6! · 7! · 8!)
ways.
Example 1.20. How many ways can one arrange the letters a, a, b, b, c, c?
6!
= 90.
(2!)3
Example 1.21. How many dierent letter arrangements can be formed from the word
PEPPER?
Solution : There are three copies of P and two copies of E, and one of R. So the answer is
6!
= 60.
3!2!1!
Example 1.22. Suppose there are 4 Czech tennis players, 4 U.S. players, and 3 Russian
players, in how many ways could they be arranged, if we do not distinguish players from the
same country?
Solution : 11!
4!4!3!
.
Example 1.23. Suppose there are 9 men and 8 women. How many ways can we choose a
committee that has 2 men and 3 women?
Solution : 9 8
We can choose 2 men in ways and 3 women in ways. The number of
2 3
committees is then the product
9 8
· .
2 3
Example 1.24. Suppose somebody has n friends, of whom k are to be invited to a meeting.
(1) How many choices do exist for such a meeting if two of the friends will not attend
together?
(2) How many choices do exist if 2 of the friends will only attend together?
Solution :
(1) We can divide all possible groups into two (disjoint) parts: one is for groups of
friends none of which are these two, and another which includes exactly one of these
n−2 n−2
two friends. There are groups in the rst part, and in the second. For
k k−1
the latter we also need to account for a choice of one out of these two incompatible
friends. So altogether we have
n−2 2 n−2
+ ·
k 1 k−1
(2) Again, we split all possible groups into two parts: one for groups which have none
of the two inseparable friends, and the other for groups which include both of these
two friends. Then
n−2 n−2
+1·1· .
k k−2
First proof: let us expand the left-hand side (x + y) · ... · (x + y). This is the sum of 2n terms,
and each term has n factors. For now we keep each product in the order we expanded the
left-hand side, therefore we have all possible (nite) sequences of variables x and y , with the
total power being n. We would like to collect all the terms having the same number of xs
and y s.
Counting all the terms having k copies of x and n−k copies of n is the same as asking in a
sequence of n positions, how many ways can one choose k of them in which to put x. The
1.2. FURTHER EXAMPLES AND EXPLANATIONS 11
n
answer is
k
which gives the coecient for xk y n−k . To illustrate it we take k = 2 and n = 3,
then all possible terms are
Second proof: we will use (mathematical) induction on n. For n = 1 we have that the
left-hand side is x + y, and the right-hand side
1
X 1 k 1−k 1 0 1−0 1 1 1−1
x y = xy + xy
k=0
k 0 1
= y + x = x + y,
so the statement holds for n = 1. Suppose now that the statement holds for n = N, we
would like to show it for n = N + 1.
N
N +1 N
X N k N −k
(x + y) = (x + y) (x + y) = (x + y) x y
k=0
k
N N
X N k N −k X N k N −k
=x x y +y x y
k=0
k k=0
k
N
X N N
X N
k+1 N −k
= x y + xk y N −k+1
k=0
k k=0
k
N +1 N
X N k N −k+1
X N k N −k+1
= x y + x y ,
k=1
k − 1 k=0
k
where we replaced k by k−1 in the rst sum. Then we see that
N
N +1 N N +1 0 X N N k N −k+1 N 0 N +1
(x + y) = x y + + x y + xy
N k=1
k − 1 k 0
N N +1
N +1
X N N k N −k+1 N +1
X N +1
=x + + x y +y = .
k=1
k−1 k k=0
k
Here we used Example 1.26.
Solution : the left-hand side represents the number of committees consisting of 4 people out
of the group of 10 people. Now we would like to represent the right-hand side. Let's say
Tom Brady is one these ten people, and he might be in one of these committees and he is
12 1. COMBINATORICS
0
0
1 1
0 1
2 2 2
0 1 2
3 3 3 3
0 1 2 3
4 4 4 4 4
0 1 2 3 4
5 5 5 5 5 5
0 1 2 3 4 5
6 6 6 6 6 6 6
0 1 2 3 4 5 6
7 7 7 7 7 7 7 7
0 1 2 3 4 5 6 7
Pascal's triangle
special, so we want to know when he will be there or not. When he is in the committee of 4,
9
then there are 1 · number of ways of having a committee with Tom Brady as a member,
3
9
while is the number of committees that do not have Tom Brady as a member. Adding it
4
up gives us the number of committees of 4 people chosen out of the 10.
n n−1 n−1
k
= k−1
+ k
which can be proven either using the same argument or a formula for binomial coecients.
Example 1.29. We have 10 ags: 5 of them are blue, 3 are red, and 2 are yellow. These
ags are indistinguishable, except for their color. How many dierent ways can we order
them on a ag pole?
Solution : 10!
5!3!2!
.
1.2. FURTHER EXAMPLES AND EXPLANATIONS 13
Example 1.30 (Exercise 1.13 revisited) . Suppose one has n indistinguishable balls. How
many ways can one put them in k boxes, assuming n > k?
Suppose now we want to distribute n balls in k boxes so that none of the boxes are empty.
Then we can line up n balls represented by os, instead of putting them in boxes we can place
| s in spaces between them. Note that we should have a | on each side, as all balls have to
be put to a box. So we are left with k − 1 copies of | s to be placed among n balls. This
means that we have n − 1 places, and we need to pick k − 1 out of these to place | s. So we
n−1
can reformulate the problem as choose k − 1 places out of n − 1, and so the answer is .
k−1
We can check that for n=3 and k=2 we indeed have 4 ways of distributing three balls in
two boxes, and only two ways if every box has to have at least one ball.
14 1. COMBINATORICS
1.3. Exercises
Exercise 1.1. Suppose a license plate must consist of 7 numbers or letters. How many
license plates are there if
Exercise 1.2. A school of 50 students has awards for the top math, English, history and
science student in the school
(A) How many ways can these awards be given if each student can only win one award?
(B) How many ways can these awards be given if students can win multiple awards?
Exercise 1.4. There is a school class of 25 people made up of 11 guys and 14 girls.
Exercise 1.5. If a student council contains 10 people, how many ways are there to elect a
president, a vice president, and a 3 person prom committee from the group of 10 students?
Exercise 1.6. Suppose you are organizing your textbooks on a book shelf. You have three
chemistry books, 5 math books, 2 history books and 3 English books.
(A) How many ways can you order the textbooks if you must have math books rst, English
books second, chemistry third, and history fourth?
(B) How many ways can you order the books if each subject must be ordered together?
Exercise 1.7. If you buy a Powerball lottery ticket, you can choose 5 numbers between
1 and 59 (picked on white balls) and one number between 1 and 35 (picked on a red ball).
How many ways can you
Exercise 1.8. A couple wants to invite their friends to be in their wedding party. The
groom has 8 possible groomsmen and the bride has 11 possible bridesmaids. The wedding
party will consist of 5 groomsmen and 5 bridesmaids.
Exercise 1.9. There are 52 cards in a standard deck of playing cards. The poker hand
consists of ve cards. How many poker hands are there?
Exercise 1.10. There are 30 people in a communications class. Each student must inter-
view one another for a class project. How many total interviews will there be?
Exercise 1.11. Suppose a college basketball tournament consists of 64 teams playing head
to head in a knockout style tournament. There are 6 rounds, the round of 64, round of 32,
round of 16, round of 8, the nal four teams, and the nals. Suppose you are lling out a
bracket, such as this, which species which teams will win each game in each round.
Exercise 1.12. We need to choose a group of 3 women and 3 men out of 5 women and 6
men. In how many ways can we do it if 2 of the men refuse to be chosen together?
Exercise 1.13. Find the coecient in front of x4 in the expansion of (2x2 + 3y)4 .
Exercise 1.14. In how many ways can you choose 2 or less (maybe none!) toppings for
your ice-cream sundae if 6 dierent toppings are available? (You can use combinations here,
but you do not have to. Next, try to nd a general formula to compute in how many ways
you can choose k or less toppings if n dierent toppings are available
16 1. COMBINATORICS
X
(x1 + ... + xk )n = n
xn1 1 · ... · xnk k .
n1 ,...,nk
(n1 ,··· ,nk )
n1 +···+nk =n
Exercise∗ 1.5. Consider a smooth function of n variables. How many dierent partial
derivatives of order k does f possess?
1.4. SELECTED SOLUTIONS 17
Solution to Exercise 1.1(B): in each of the rst three places we can place any of the 10
digits, and in each of the last four places we can put any of the 26 letters giving a total of
103 · 264 .
Solution to Exercise 1.1(C): if we can not repeat a letter or a number on a license plate,
then the number of license plates becomes
Solution to Exercise 1.11: First notice that the 64 teams play 63 total games: 32 games
in the rst round, 16 in the second round, 8 in the 3rd round, 4 in the regional nals, 2
in the nal four, and then the national championship game. That is, 32+16+8+4+2+1=
63. Since there are 63 games to be played, and you have two choices at each stage in your
63
bracket, there are 2 dierent ways to ll out the bracket. That is,
n
X
n n
xk y n−k
(x + y) = k
k=0
with x=y=1 to see
n
X n
X
n n n
k n−k n
2 = (1 + 1) = k
·1 ·1 = k
,
k=0 k=0
1.4. SELECTED SOLUTIONS 19
n
X n
X
n k n−k
n n
(−1)k .
0 = (−1 + 1) = k
· (−1) · (1) = k
k=0 k=0
Solution to Exercise∗ 1.2: we can prove the statement using mathematical induction on
k. For k=1 we have
X
(x1 )n = n
x1 = xn1 ,
n1
n1 =n
X n
X
(x1 + x2 )n = n n
n1 n2 n1 n−n1
n1 ,n2
x1 · x2 = n1
x1 · x2 ,
(n1 ,n2 ) n1 =0
n1 +n2 =n
which is the binomial formula itself. Now suppose the multinomial formula holds for k=K
induction hypothesis ), that is,
(
X
(x1 + ... + xK )n = n
· xn1 1 · ... · xnKK ,
n1 ,...,nK
(n1 ,··· ,nK )
n1 +···+nK =n
X n
(x1 + ... + xK+1 )n = n
· xn1 1 · ... · xK+1
K+1
n1 ,...,nK+1
.
(n1 ,··· ,nK+1 )
n1 +···+nK+1 =n
Denote
nK
X nK −m
(xK + xK+1 )nK = nK
· xm
m K · xK+1 ,
m=1
therefore
20 1. COMBINATORICS
X nK
X
n nK −m
(x1 + ... + xK+1 )n = n
· xn1 1 · ... · xK−1 nK
· xm
K−1
n1 ,...,nK
· m K · xK+1 .
(n1 ,··· ,nK ) m=1
n1 +···+nK =n
n nK n
n1 ,...,nK m
= n1 ,...,nK ,m
, n1 + ... + nK + m = n.
Indeed,
n
nK
n! nK !
n1 ,...,nK m
=
n1 !n2 ! · ... · nK−1 ! · nK ! m! (nK − m)!
n! n
= = n1 ,...,n K ,m
.
n1 !n2 ! · ... · nK−1 ! · m! (nK − m)!
Thus
X nK
X
n n n nK −m
· xn1 1 · ... · xK−1 · ·xm
K−1
(x1 + ... + xK+1 ) = n1 ,...,nK ,m K · xK+1 .
(n1 ,··· ,nK ) m=1
n1 +···+nK =n
X m m
(x1 + ... + xK+1 )n = n
· xm mK
K−1 K+1
1 · ... · xK−1 · xK · xK+1
1
m1 ,...,mK ,mK+1
(m1 ,··· ,mK ,mK+1 )
m1 +···+mK+1 =n
Solution to Exercise∗ 1.3: this is the same problem as dividing n indistinguishable balls
into boxes in such a way that each box has at least one ball. To do so, you can select k − 1
k
n−1
of the n − 1 spaces between the objects. There are possible selections that is equal to
k−1
the number of possible positive integer solutions to the equation.