Combinatorics - World of Mathematics - Mathigon
Combinatorics - World of Mathematics - Mathigon
This article is from an old version of Mathigon and will be updated soon.
Introduction
Combinatorics is a branch of mathematics which is
about counting – and we will discover many
exciting examples of “things” you can count.
Combinatorics has many applications in other areas of mathematics, including graph theory
(/course/graph-theory), coding and cryptography, and probability (/course/probability).
Factorials
Mathigon usescan
Combinatorics cookies tocount
help us personalise and improve
the number of orders this website.
in which something can happen. Consider the
following
Acceptexample:
Privacy Policy
In a classroom there are 3 pupils and 3 chairs standing in a row. In how many different
Polypad Courses Activities Lessons
orders can the pupils sit on these chairs?
Let us list the possibilities – in this example the 3 different pupils are represented by 3 different
colours of the chairs.
There are 6 different possible orders. Notice that the number of possible orders increases very quickly
as the number of pupils increases. With 6 pupils there are 720 different possibilities and it becomes
impractical to list all of them. Instead we want a simple formula that tells us how many orders there
are for n people to sit on n chairs. Then we can simply substitute 3, 4 or any other number for n to get
the right answer.
Suppose we have 4 chairs and we want to place four pupils on them. There are 4 pupils who could
sit on the first chair. Then there are 3 pupils who could sit on the second chair. There are 2 choices for
the third chair, and only one choice for the final chair. In total, there are
possibilities. To simplify notation, mathematicians use a “!” called factorial. For example, 5! (“five
factorial”) is the same as 5 × 4 × 3 × 2 × 1. Above we have just shown that there are n! possibilities to
order n objects.
EXERCISE SOLUTION
Privacy Policy
Permutations Polypad Courses Activities Lessons
The method above required us to have the same number of pupils as chairs to sit on. But what
happens if there are not enough chairs?
How many different possibilities are there for any 2 of 3 pupils to sit on 2 chairs? Note
that 1 will be left standing, which we don’t have to include when listing the possibilities.
To find a simple formula like the one above, we can think about it in a very similar way. undefined In
total there are
possibilities. Again we should think about generalising this. We start like we would with factorials, but
we stop before we reach 1. In fact we stop as soon as we reach the number students without chair.
When placing 7 students on 3 chairs their are
7×6×5×4×3×2×1 7! 7!
7×6×5 = = =
4×3×2×1 4! (7 – 3)!
possibilities, since the 4 × 3 × 2 × 1 will cancel each other. Again there is a simpler notation for this:
7P3. If we want to place n objects in m positions there are
n!
nPm =
(n – m)!
possibilities. The P stands for “permutations”, since we are counting the number of permutations
(orders) of objects. If m and n are the same, as they were in the problem at the beginning of this
article, we have
n! n!
nPn = = .
(n – n)! 0!
To make sense of this we define 0! = 1. Now nPn = n! as we would expect from our solution to the first
Mathigon uses cookies to personalise and improve this website.
problem.
Privacy Policy
EXERCISE SOLUTION
Polypad
Unfortunately you can’t remember the codeCourses
for Activities Lessons
Combinations
Permutations are used when you select objects and care about their order – like the order of children
on chairs. However in some problems you don’t care about the order and just want to know how
many ways there are to select a certain number of objects from a bigger set.
In a shop there are five different T-shirts you like, coloured red, blue, green, yellow and
black. Unfortunately you only have enough money to buy three of them. How many ways are
there to select three T-shirts from the five you like?
Here we don’t care about the order (it doesn’t matter if we buy black first and then red or red first and
then black), only about the number of combinations of T-shirts. The possibilities are
so there are 10 in total. If we had calculated 5P3 = 60, we would have double-counted some
possibilities, as the following table shows:
Privacy Policy
Polypad Courses Activities Lessons
With permutations, we count every combination of three T-shirts 6 times, because there are 3! = 6
ways to order the three T-shirts. To get the number of combinations from the number of permutations
we simply need to divide by 6. We write
5P3 60
5C3 = = = 10.
3! 6
Here the C stands for “combinations”. In general, if we want to choose r objects from a total of n there
are
nPr n!
nCr = =
r! r! (n – r)!
(n)
different combinations. Instead of nCr mathematicians often write nCr = r , like a fraction in
brackets but without the line in between. (To simplify typesetting we will continue using the first
notation inline.)
EXERCISES SOLUTIONS
Privacy Policy
Combinatorics and Pascal’s Triangle Polypad Courses Activities Lessons
Let’s calculate some values of nCr. We start with 0C0. Then we find 1C0 and 1C1. Next, 2C0, 2C1 and
2C2. Then 3C0, 3C1, 3C2 and 3C3. We can write down all these results in a table:
0C0 = 1
1C0 = 1 1C1 = 1
2C0 = 1 2C1 = 2 2C2 = 1
3C0 = 1 3C1 = 3 3C2 = 3 3C3 = 1
4C0 = 1 4C1 = 4 4C2 = 6 4C3 = 4 4C4 = 1
5C0 = 1 5C1 = 5 5C2 = 10 5C3 = 10 5C4 = 5 5C5 = 1
This is exactly Pascal’s triangle which we explored in the article on sequences (/world/Sequences). It
can be created more easily by observing that any cell is the sum of the two cells above. Hidden in
Pascal’s triangle there are countless patterns and number sequences.
Now we also know that the rth number in the nth row is also given by nCr
(but we always have to start counting at 0, so the first row or column is
actually the zeroth row). If we apply what we know about creating Pascal’s
triangle to our combinations, we get
( nr ) + ( r +n 1 ) = ( nr ++ 11 ) .
This is known as Pascal’s Identity. You can derive it using the definition of nCr in terms of factorials,
or you can think about it the following way:
We want to choose r + 1 objects from a set of n + 1 objects. This is exactly the same as
marking one object of the n + 1, to be called X, and either choosing X plus r others (from the
remaining n), or not choosing X and r + 1 others (from the remaining n).
Many problems in combinatorics have a simple solution if you think about it the correct way, and a
very complicated solution if you just try to use algebra…
A greengrocer on a market stocks a large number of n different kinds of fruit. In how many ways
can we make up a bag of r fruits? Note that r can be smaller, equal or bigger than n.
Privacy Policy
Combinatorics and Probability Polypad Courses Activities Lessons
Combinatorics has many applications in probability theory (/course/probability). You often want to
find the probability of one particular event and you can use the equation
You can use combinatorics to calculate the “total number of possible outcomes”. Here is an example:
Four children, called A, B, C and D, sit randomly on four chairs. What is the probability that A
sits on the first chair?
We have already shown that in total there are 24 ways to sit on four chairs. If you look back at our
solution, you will also find that A sits on the first chair in six of the cases. Therefore
This answer was expected, since each of the four children is equally likely to sit on the first chair. But
other cases are not quite as straightforward…
EXERCISES SOLUTIONS
© 2023
Mathigon uses cookies to personalise and Mathigon
improve this website.
Privacy Policy