# Question Video: Applications of the Counting Principle with Replacement Mathematics

In how many ways can a 5-digit code be formed using the numbers 1 to 9? Note, the code can have repeated digits.

02:09

### Video Transcript

In how many ways can a five-digit code be formed using the numbers one to nine? Note, the code can have repeated digits.

Now, we’re not going to list all possible five-digit codes. Firstly, there’s likely to be quite a lot of them. And secondly, even if there wasn’t that many of them, we couldn’t be entirely sure that we wouldn’t miss out a one. And so, instead, we’re going to use something called the counting principle or the product rule for counting.

This says that to find the total number of outcomes for two or more combined events, we multiply the number of outcomes of each event together. So to answer this question, we need to ask ourselves, what are each of our events?

Well, the total number of outcomes we’re looking for are the total number of five-digit codes. So our individual events are the numbers we get for each digit. That’s the first digit all the way through to the fifth digit.

We’ll begin by looking at the total number of ways of choosing the first digit. We’re using the numbers one to nine. So there are nine ways of choosing the first digit. There are nine possible outcomes for our first event. So what next? Well, we’re told the code can have repeated digits. So when we move on to the second digit, we can still choose the numbers one through nine. This means there are still nine possible outcomes for our second event. We can choose nine different numbers for our second digit. In a similar way, there are nine different ways of choosing the third digit. Remember, the numbers can be repeated. So there are nine ways of choosing the fourth digit and nine ways of choosing the fifth digit.

The counting principle or the product rule for counting tells us that to find the total number of outcomes, we need to multiply these. That’s nine times nine times nine times nine times nine, or nine to the fifth power. Nine to the fifth power is 59,049.

And so we see that there are 59,049 ways of choosing a five-digit code using the numbers one to nine, assuming the code can have repeated digits.

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.