Counting
Possible outcomes
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 .
Accounting for 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.
Ordering & distinction
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 you must consider the ordering of distinct collections.
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)
Distinction is also extremely important when considering situations where you have indistinct objects and you are looking for the total number of distinct orderings of that object.
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 the flags being indistinct. 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:
Permutations
Now that we have established all the different things to think about when calculating the total number of possibilities, we also need to look at another scenario that makes things more complicated.
What if we wanted to calculate the number of possible subsets under certain conditions from a larger set?
For example, what if 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.