Five digit numbers are formed using the digits 1, 2, 3, 5, 7 with repetitions and are written in descending order with serial numbers. For example, the number 77777 has serial number 1. Then the serial number of 35337 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 descending order the larger numbers come first, so the serial number of a number is one more than the count of numbers larger than it. A number is larger when, at the first place where it differs, it has a larger digit. The digits available are 1, 2, 3, 5 and 7, and any digit may be repeated.
Approach. Count the larger numbers by the first place at which they differ, then add one.
Step 1: Larger first digit
Numbers starting with 5 or 7 are larger, and their other four digits are free, giving .
Step 2: Same start, larger later digit
Starting with 3, a second digit 7 gives . Starting with 35, a third digit 5 or 7 gives . Starting with 353, a fourth digit 5 or 7 gives . Starting with 3533, no digit exceeds 7.
Step 3: The serial number
So numbers come before it, and its serial number is 1436.
Answer. 1436
Sanity check. Counting the smaller numbers the same way gives , and , the number of all such numbers.
Common wrong answers
- 1435: Counting the numbers before it and not adding 1 for the number itself gives 1435.
- 1690: Counting the smaller numbers, as for ascending order, gives 1689 and a serial number 1690.
Key takeaway
The trap. The serial number is one more than the count of numbers before it.
How toppers think. They check that the larger and smaller counts plus one make the total.
Remember. for free places