Counting
Basic counting principle
Suppose a travelling salesman was travelling along a path between 4 cities. They start in city 1. There are 3 possible routes they could take to travel from city 1 to city 2. There are 4 possible routes they could take to travel from city 2 to city 3. There are 5 possible routes they could take to travel from city 3 to city 4. How many total possible routes could the salesman take?
The answer is given by:
We can formalise this with:
Consider experiments .
Suppose experiment has outcomes.
For each outcome of experiment , experiment has outcomes.
For each outcome of experiments … , experiment has outcomes for all .
Then there are possible outcomes for all experiments.
Repetition
Consider a 7 digit car registration plate. The first 3 characters are letters and the last 4 characters are numbers. Suppose first that repetition of characters is allowed.
There are 26 letters in the alphabet and 10 single digit numbers so the total number of possible plates in this case is given by:
Consider a 7 digit car registration plate. The first 3 characters are letters and the last 4 characters are numbers. Suppose now that repetition of characters is not allowed.
There are 26 letters in the alphabet and 10 single digit numbers but this time we need to decrease the number we have to pick from for each new character as one is used. So the total number of possible plates in this case is given by:
You can see by comparing these two examples the massive difference in the final answer that simply allowing repetition causes.
Permutations
In the example above it was specified that 3 letters must come first on the plate and the numbers second. Now consider an example where the ordering of distinct collections is also a factor.
Suppose you have 4 maths books, 3 chemistry books, 2 history books and 1 language book on a shelf. How many arrangements are there so that all books in a given subject are together?
There are two things to think about there:
- Ordering of subjects
- Ordering of books within each subject
Let:
number of subjects
number of arrangements for each subject
We can pick these number out of the question using techniques above.
Where:
(maths)
(chemistry)
(history)
(language)
Distinct objects
Distinction is also extremely important when considering situations where you have distinct groups of indistinct objects and you are looking for the total number of distinct orderings.
Suppose you have 9 flags; 4 are red, 3 are blue and 2 are green. How many flag signals can you construct?
In this question, there will be some orderings of the flags that are identical due to flags of the same colour being identical. We need to find a way to count them while discounting repeated orderings.
You know there are 9 flags in total and how many of each colour, so let’s define:
(total)
(red)
(blue)
(green)
The equation to use in this context when there will be duplicates is:
Where r is the number of distinct objects.
So in this example:
Combinations
When counting permutations, the different orderings have to be counted as well as the differents sets of objects. When counting combinations, all sets that contain the same objects are counted as one regardless of order.
Suppose we have a group of 5 women and 7 men and we want to select 3 women and 3 men for a committee. How many possible combinations of people on the committee could we have?
This is where ‘choose’ comes in, a situation where you have to pick objects from options:
For this example, we have two distinct categories to pick objects from so we multiply the choose functions together.