Let 5 digit numbers be constructed using the digits 0, 2, 3, 4, 7, 9 with repetition allowed, and are arranged in ascending order with serial numbers. Then the serial number of the number 42923 is _____ .
Solution
Core idea. A position in an ordered list is found by counting the numbers before it, digit by digit.
Concept refresher. With repetition allowed, free places can be filled from digits in
ways, and non-overlapping cases are added.
Picture the situation. In ascending order the smaller numbers come first, so the serial number of a number is one more than the count of numbers smaller than it. A number is smaller when, at the first place where it differs, it has a smaller digit. The digits available are 0, 2, 3, 4, 7 and 9 with repetition, and a five-digit number cannot start with 0.
Approach. Count the smaller numbers by the first place at which they differ, then add one.
Step 1: Smaller first digit
A five-digit number cannot start with 0. Numbers starting with 2 or 3 are smaller, and their other four digits are free, giving .
Step 2: Same start, smaller later digit
Starting with 4, a second digit 0 gives . Starting with 42, a third digit 0, 2, 3, 4 or 7 gives . Starting with 429, a fourth digit 0 gives 6. Starting with 4292, a last digit 0 or 2 gives 2.
Step 3: The serial number
So numbers come before it, and its serial number is 2997.
Answer. 2997
Sanity check. Counting the larger numbers the same way gives , and , the number of all such numbers.
Common wrong answers
- 2996: Counting the numbers before it and not adding 1 for the number itself gives 2996.
- 4293: Allowing a first digit 0 adds strings that are not five-digit numbers and gives 4293.
Key takeaway
The trap. A string starting with zero is not a five-digit number.
How toppers think. They check that the smaller and larger counts plus one make the total.
Remember. for free places