Edinburgh, and Counting

Published by Scott Jenkins on

With 4 years of analytical work experience under my belt, I am pleased to be taking the opportunity to return to uni. Starting in September, I’ll be taking on an MSc in Operational Research at the University of Edinburgh. I’m choosing to work on this Masters degree to build further expertise in mathematical modelling, statistics, mathematics and programming. In short, I want to sharpen my problem solving toolkit. And of course, I’m incredibly excited to be living in a beautiful new city, and experiencing Scotland.

So as to avoid shocking myself when I hit the books in September, I’ve been brushing up on some basics. And where better to start than counting. I’m not talking about 1,2,3,….. Let’s look at some example questions.

Question 1:

How many distinct 4 digit pin numbers are there?

Solution 1:

There are 4 digits, each of which can take any of 10 values from (0,1,2,3,4,5,6,7,8,9). So there are 10 x 10 x 10 x 10 = 10,000 possible pin numbers.

More generally, if we pick k elements from a population of size n, with replacement, where the order matters, there are n^k possible outcomes.

Question 2:

How many 4 digit pin numbers are there, if I insist on using no digit more than once?

Solution 2:

As before, the first digit can take any of 10 values from (0,1,2,3,4,5,6,7,8,9). But since the second digit must be different from the first, this digit can be any of the 9 remaining unused values. Similarly the 3rd, and the 4th digits can be any of 8, and any of 7 unused values respectively. Putting this together, we see that there are 10 x 9 x 8 x 7 = 5040 possible pin numbers which meet this criteria.

More generally, if we pick k elements from a population of size n, without replacement, where the order matters, there are n x (n-1) x (n-2) x … x (n+1-k) possible outcomes, that is:

Edinburgh, and Counting 1

Question 3:

How many different ways are there of choosing 5 optional modules from a list of 10 optional modules?

Solution 3:

This is simply the binomial coefficient 10C5 = 252. The argument follows question 2, except this time the order we choose the modules does not matter, so we need to divide by 5! (the number of orders in which a set of 5 modules may be chosen).

More generally, if we pick k elements from a population of size n, without replacement, where the order does not matter, nCk possible outcomes, that is:

Edinburgh, and Counting 2

Question 4:

In a shop selling Christmas decorations, there are 8 different types of baubles. I’d like to buy 20 baubles for my tree. How many different selections of baubles can I make?

Solution 4:

In essence here, we are partitioning 20 baubles into 8 labelled groups, or equivalently, with 7 dividing bars. The order, we choose the baubles doesn’t matter, and we are sampling with replacement (assuming that the shop has a large inventory of each type of bauble). In this situation, there are “27 choose 20” = 888,030 possible outcomes. That’s a lot of different looking Christmas trees!

More generally, the number of ways of choosing n objects from k labelled groups is “n+k-1 choose n”, that is:

Edinburgh, and Counting 3

The team at Numberphile offer an exploration of the ‘stars and bars’ approach in this video.

Combinatorics aside, I know I can count on a stimulating and exciting year ahead, and I hope to post some more interesting mathematics throughout my studies.

Until Next Time,

Scott