Call a positive integer if it is a one-digit number or its digits, when read from left to right, form either a strictly increasing or a strictly decreasing sequence. For example, , , and are monotonous, but , , and are not. How many monotonous positive integers are there?
- A)
- B)
- C)
- D)
- E)
Answer
B
Key insight
An increasing number is a nonempty subset of {1,...,9} and a decreasing one a subset of {0,...,9} other than {0}; subtract the 9 one-digit numbers counted twice.
Solution
A strictly increasing or strictly decreasing number is determined by its set of digits: sort the set one way or the other. So count digit sets.
Increasing numbers: the digits are distinct and cannot appear (it would have to come first). Any nonempty subset of works: numbers.
Decreasing numbers: any nonempty subset of , written largest to smallest, gives a valid positive integer, except the subset alone. That is numbers.
Overlap: the one-digit numbers through appear in both lists ( numbers). Nothing else does, since a number with two or more digits cannot be both increasing and decreasing.
Total: .
The answer is .
Why this works
The bijection "monotone number set of digits" converts an ordering problem into a subset count, where does all the work. The only care needed is at the edges: the digit is allowed in decreasing numbers but not increasing ones, and one-digit numbers belong to both families.
The trap
Forgetting that 0 may appear as the last digit of a decreasing number (e.g. 987620), or double counting the single-digit numbers.
Common mistakes
- Forgetting that 0 may appear as the last digit of a decreasing number (e.g. 987620), or double counting the single-digit numbers.
- Excluding one-digit numbers from both counts and then forgetting to add them back, or leaving in the decreasing count to get .
Techniques
Map the objects to something easier to count · Split into exhaustive cases and handle each