Exercise 4, Combinatorics - Solutions
Exercise 4, Combinatorics - Solutions
Problems
1. a) An organisation has an executive board which includes seven members: A, B, C,
D, E, F and G. The organization will elect a chair, a secretary and a treasurer
among these members of the board – in such a way that each task is given for a
different member.
i) In how many different ways can you do select the members for the tasks if
either D or E has to be the chair?
ii) In how many ways can you do this if B has to be elected as the chair, the
secretary or the treasurer?
b) 2000 passengers from a cruise ship entering a port are transported by buses to a
city. There are 30 buses for them and each bus can seat at most 80 passengers.
i) Show that at least one bus has at least 67 passengers.
ii) Show that at least one bus has at least 14 free seats.
Solution:
a) i) First we choose either D or E as chair, so there are two options. Thereafter the
secretary will be elected within the remaining 6 members and then treasurer
will be elected within the remaining 5 members. Under the rule of product,
the number of options becomes 2 · 6 · 5 = 60.
ii) In this case, there are three options on which task the member B can be
elected. After that, two of the remaining 6 members must be elected for the
other two tasks, in which case the number of alternatives is 6 · 5 = 30. Thus,
the choices can be made in 3 · 30 = 90 different ways.
b) i) If all buses had no more than 66 passengers, then all the buses would have
only no more than 30 · 66 = 1980 passengers, which is too few, i.e. according
to the pigeonhole principle at least one bus must have at least 67 passengers.
ii) If all buses had at most 13 free seats, then each would have at least 67
passengers i.e. total at least 30 · 67 = 2010 passengers. This is too much,
so according to the pigeonhole principle at least one bus has at least 14 free
seats.
2. Assume that there are three tram routes A, B and C in Tampere. The tram A has 25
stops in its route, the tram B has 30 stops and the tram C has 40 stops. The trams A
and B have 6 common stops in their routes, the trams A and C have 5 common stops
and the trams B and C have 4 common stops. There are two stops that are common
for all trams A, B and C.
a) How many different stops there are on the tram routes A, B and C?
b) On how many stops the tram A stops but the trams B and C do not stop?
Solution:
Let’s model the routes as a set of stops. Then we know that |A| = 25, |B| = 30
and |C| = 40. We also know that |A ∩ B| = 6, |A ∩ C| = 5 and |B ∩ C| = 4 and
|A ∩ B ∩ C| = 2.
= 25 + 30 + 40 − 6 − 5 − 4 + 2 = 82
stops in total.
b) We are looking for the size of the set A \ (B ∪ C). This we get by calculating
|A| − |A ∩ (B ∪ C)|. Let’s first calculate |A ∩ (B ∪ C)| which is the same as
|(A ∩ B) ∪ (A ∩ C)| = |A ∩ B| + |A ∩ C| − |A ∩ B ∩ C| = 11 − 2 = 9. Let’s then
take that away from |A| and then we get 25 − 9 = 16 as the final answer.
3. Consider a usual deck of 52 playing cards (four suits each of which has 13 cards with
the number values 2–13 and an ace).
a) How many different five-card hands (i.e., unordered sets of cards) there are?
b) In poker, a five-card hand in which all cards are of the same suit is called a flush.
How many flushes there are?
c) A five-card hand in which the cards have consecutive number values is called a
straight. An ace can be used as a number 1 or 14; thus a straight may start with
an ace or end with it, but an ace cannot not be used in the middle of a straight.
How many straights there are?
d) How many such straights exist that are not flushes?
Solution:
a) Let’s
choose a subset of five cards from the set of 52 cards; then the answer is
52
5
= 2598960. On the other hand, the answer can also be given in the form
52(·51 · 50 · 49 · 48)/5!, as the first card can be selected 52 ways, the second with
51, etc, and those five cards can be in 5! different orders.
b) There are 4 different suits that can form a flush. Moreover, any five cards from a
13
total of 13 cards of the same suit form flush. Thus there are a total 4 · 5 = 5148
of different options for a flush.
c) The smallest value in a straight is 1–10, so one of these is chosen first, and
then each consecutive card for that straight is selected from four possible options
(because of 4 different suits). So the answer is 10 · 45 = 10240.
d) There are 4 · 10 = 40 different straight flushes (obtained by choosing a suit for the
flush and a starting value 1–10 of the straight) and, by the case c) above, there
are 10 · 45 different straights. So there are 10 · 45 − 10 · 4 = 10200 straights that
are not flushes.
4. A student usually takes a swim and goes for jogging every day. Now the student decides
to lighten the rest of the year, starting from the beginning of October. The student
selects a total of 50 days (from October–December) for swimming only. Similarly the
student selects 20 days for jogging only. On all the remaining days the student does
both swimming and jogging as usual. In how many different ways the dates can be
selected like this?
Solution:
a) Since October, November and December have a total of 92 days, the question is
how many ways this set of 92 days can divided into three disjointed subsets whit
50, 20 and 22 elements. We get this answer by using multinomial coefficient and
we get:
92 92!
= .
50, 20, 22 50! · 20! · 22!
b) First if we select 50 days, as such days when the student only goes swimming,
from the set of 92 days, there are 92
50
options. If from the remaining 92 − 50 = 42
days 20 are selected as dates when the student only goes jogging, there are 42 20
options. So then using the rule of product the number of all options becomes
92 42
· .
50 20
92 92! 42 42!
c) Because = and = then
50 50! · (92 − 50)! 20 20 · (42 − 20)!
92 42 92! 42! 92! · 42!
· = · =
50 20 50! · (92 − 50)! 20 · (42 − 20)! 50! · 42! · 20! · 22!
92! 92
= =
50! · 20! · 22! 50, 20, 22
5. How many rectangles there are on a m × n-size “chess board”? For example, there are
nine rectangles on a 2 × 2-size board: The whole board, 4 smaller squares and 4 ways
in which 2 squares make a rectangle. Check your answer by calculating the number of
rectangles on a 3 × 3-size chess board.
Solution:
There are at least two different ways to solve the problem.
1. method:
Let’s think that width of a m × n board is m squares and height is n squares. So let’s
mention the width always first. Let x, y ∈ N, where x ≤ m and y ≤ n. Then you can
set x × y size rectangle in m × n size board N (x, y) := (m − x + 1)(n − y + 1) different
ways (the left edge of a x-width and a y-height rectangle can be in (m − x + 1) different
vertical row and the bottom edge in (n − y + 1) different horizontal row). We get the
total number of rectangles by summing up different sizes together:
m X n m
! n !
X X X
N (x, y) = (m − x + 1) (n − y + 1)
x=1 y=1 x=1 y=1
m
! n
!
X X
= m2 − x+m n2 − y+n
x=1 y=1
2
n2 + n
2 m +m 2
= m − +m n − +n
2 2
2 2
m +m n +n
=
2 2
1 2
= (m + m)(n2 + n).
4
2. method:
Every rectangle has left edge and right edge, so we select two edge lines from the m + 1
edge lines which divides the width for m squares. Every rectangle has top and bottom
edge, so we choose also two edge lines from the n + 1 edge lines which divides the
height for n squares. Different options for rectangles and therefore the total number
of rectangles are then
m+1 n+1 (m + 1)! (n + 1)! m(m + 1)n(n + 1) 1
= = = (m2 + m)(n2 + n).
2 2 2!(m − 1)! 2!(n − 1)! 4 4
So we got the same result from both of the methods. Let’s check it works for sure on
the 3 × 3 board:
6. Group problem:
a) Suppose that k balls are picked out of a box in which there are different colored
balls. The total number of different colors is n and there is a large number of
balls in each color (more than k). Make three different examples so that you select
some numbers as n and k and calculate how many different color combinations it
is possible to pick from the box with the chosen numbers. We suppose here that
the only difference between the balls is their color and the chosen balls are not
arranged in any way.
b) Generally, the number of color combinations is k+n−1
n−1
(you can check the func-
tionality of the formula with your numbers in part a) if you like.). Explain why
this formula tells you the number of different possible color combinations.
c) Suppose that there are 7 blue, 6 yellow, 5 red and 2 green balls in the box. How
many different sets of 5 balls can be picked from the box.
Tip: Use the formula from the case b) but notice that now there are only few
green balls.
Solution:
a) Examples:
• n=1 and k = 3, when there are 1 color combination.
• n=2 and k = 1, when there are 2 color combinations.
• n=2 and k = 2, when there are 3 color combinations.
• n=2 and k = 3, when there are 4 color combinations.
b) Let’s consider the following example where there are seven different colors and we
pick 14 balls. One possible combination of colors can be described, for example,
this way:
ooooo||ooo|ooo|oo|o|
Here there are 5 balls of the first color, the second none at all, the third 3, the
fourth 3, the fifth 2, and the sixth 1, and the seventh none at all. We notice that
there are always n − 1 sticks. There are as many different color combinations as
there are opportunities to put color separating n − 1 stick into a k-ball queue.
Stick may also be at the beginning and end of the queue. In other words, you
must therefore put n − 1 sticks and k balls in a queue, and calculate the number
of different queues. There will be a total of k + n − 1 balls and sticks in the entire
queue and consider how many different places there are for the stick. In other
words: how many ways can n − 1 places be chosen from k + n − 1 long queues
to place a stick? So how many ways can a subset of a n − 1 elements be chosen
from a set of k + n − 1 elements? The answer to the question is k+n−1 n−1
and at
the same time this is the answer to the original question.
c) Because there are therefore not enough green balls we have to examine them
separately. Let’s examine three separated cases where the number of green balls
are 0, 1 or 2.
• If there are 0 green balls, then the result of b) can be used directly for the
5+3−1
other three colours i.e. 3−1 .
• If there is 1 piece of green,then there are 4 remaining balls, i.e. k = 4 and
n = 3. Thus, we get 4+3−13−1
.
• If there are 2 pieces of greens then respectively as above now there are 3
remaining balls, i.e. k = 3 and n = 3, so we get 3+3−1
3−1
.
Since the cases are separate, then the total situation is obtained by summarizing
all the previous, i.e., the total amount of the different color combinations is
5+3−1 4+3−1 3+3−1
+ +
3−1 3−1 3−1
7 6 5 42 30 20
= + + = + + = 46.
2 2 2 2 2 2