How Many Numbers?: Solution

The Ministry is migrating nzmaths content to Tāhurangi.           
Relevant and up-to-date teaching resources are being moved to Tāhūrangi (tahurangi.education.govt.nz). 
When all identified resources have been successfully moved, this website will close. We expect this to be in June 2024. 
e-ako maths, e-ako Pāngarau, and e-ako PLD 360 will continue to be available. 

For more information visit https://tahurangi.education.govt.nz/updates-to-nzmaths

  1. How many 2-digit numbers are there that contain at least one 2?
  2. How many 2-digit numbers are there that contain no 2 at all?
  3. How many 3-digit numbers are there that contain at least one 3?
  4. How many 5-digit numbers are there that contain at least one 5?

Solution

  1. The 2-digit numbers that contain 2 can be produced by listing them systematically. They are 12, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 42, 52, 62, 72, 82, 92. There are 18 of them.
    Is there another way to do this though? After all, if we were asked to find the number of 7-digit numbers that contained 2, we would have to produce a very long list.
     
  2. What about the 2-digit numbers that contain no 2 at all? Now you might think of using a list to get started here. So we would have 10, 11, 13, 14, 15, 16, 17, 18, 19, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, … Hang on! First this is getting to be a very long list and second there is a pattern from here on that will stop us having to write all these numbers down.
    Look, there are 9 numbers that start with a 1; there are 9 numbers that start with a 3; there are …; there are 9 numbers that start with a 9. So we have 9 times 8 numbers altogether. The 8 comes from the fact that there are 8 numbers in the sequence 1, 3, 4, 5, …, 9. That means that there are 72 numbers that don’t have a 2 in them.
    Now think!!
    What have we found so far? There are 18 2-digit numbers that have a 2 and there are 72 2-digit numbers that don’t. 18 + 72 = 90. Does that ring any bells? Surely there are 90 2-digit numbers altogether? So we were wasting our time when we started listing and then counting, the 2-digit numbers without a 2. We could have just taken 18 from 90 and made our life easier!
     
  3. With the 3-digit numbers we could make a list but it’s clearly going to be more difficult to be sure we haven’t missed anything. So we should start to think ‘sneaky’. Would it be easier, for instance to count all 3-digit numbers that didn’t contain a 3? (There’s a hint from (b).)
    OK then, we’ll first of all count all 3-digit numbers, then count all 3-digit numbers with no threes, then subtract the second number from the first.
    Right, first the 3-digit numbers. Well, first of all there are 9 possible digits for the first place (you can’t use 0), 10 for the second place (you can use anything from 0 to 9) and 10 for the third. That makes 9 x 10 x 10 = 900.
    Now for the 3-digit numbers with no threes. Their first (hundreds) digit can be chosen in just 8 ways (no 0 and no 3), their second digit in just 9 (no 3 remember), and their third digit in 9 ways. So there are 8 x 9 x 9 of these. That’s 648 altogether.
    So the number of 3-digit numbers with at least one three is 900 - 648 = 252. (That would have been a long list!)
     
  4. Obviously the same trick can be performed with the 5-digit numbers. So we get 9 x 10 x 10 x 10 x 10 – 8 x 9 x 9 x 9 x 9 = 90000 – 52488 = 37512. (This is a frighteningly long list. How long would it take to write this list down?)

Extension

How many r-digit even numbers are there?