AMC 10 Step by Step

2017 AMC 10B Problem 17

P16-20~5 minPrint

Call a positive integer monotonous\textbf{monotonous} 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, 33 , 2357823578 , and 987620987620 are monotonous, but 8888 , 74347434 , and 2355723557 are not. How many monotonous positive integers are there?

Log in to save your progress.
Show solution without answering

Key insight

Choosing a set of different digits gives exactly one increasing number and one decreasing number. Count digit sets: 511 increasing, 1022 decreasing, minus the 9 one-digit numbers counted twice.

Solution

Start with an example. The digit set {2,3,5,7,8}\{2, 3, 5, 7, 8\} gives exactly one increasing number, 2357823578, and exactly one decreasing number, 8753287532. The digits of a monotonous number are all different, and once you know which digits are used, the order is forced. So count sets of digits instead of numbers.

  1. Increasing numbers. The digit 00 cannot be used: in an increasing number it would have to come first. So the digits come from 11 to 99. Each of these 99 digits is either in or out, giving 29=5122^9 = 512 sets, and we throw away the empty set: 511511 numbers.
  2. Decreasing numbers. Now 00 is allowed, because it goes last (as in 987620987620). The digits come from 00 to 99: 210=10242^{10} = 1024 sets. Throw away the empty set, and also the set {0}\{0\} alone, which would give the number 00, not a positive integer. That leaves 10221022 numbers.
  3. Counted twice. The one-digit numbers 11 to 99 appear in both lists. A number with two or more digits cannot be both increasing and decreasing, so nothing else is repeated. That is 99 repeats.
  4. Total: 511+1022−9=1524511 + 1022 - 9 = 1524.

The answer is (B) 1524\boxed{\textbf{(B)}\ 1524}.

Why this works

When the order of the objects is forced (smallest to largest, or largest to smallest), counting arrangements is the same as counting which objects are chosen, and "in or out" for each digit gives powers of 22. The only care needed is at the edges: where the digit 00 may go, and which numbers belong to both lists.

Concise solution

A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.

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 00 cannot appear (it would have to come first). Any nonempty subset of {1,…,9}\{1, \dots, 9\} works: 29−1=5112^9 - 1 = 511 numbers.

Decreasing numbers: any nonempty subset of {0,1,…,9}\{0, 1, \dots, 9\}, written largest to smallest, gives a valid positive integer, except the subset {0}\{0\} alone. That is 210−1−1=10222^{10} - 1 - 1 = 1022 numbers.

Overlap: the one-digit numbers 11 through 99 appear in both lists (99 numbers). Nothing else does, since a number with two or more digits cannot be both increasing and decreasing.

Total: 511+1022−9=1524511 + 1022 - 9 = 1524.

The answer is (B) 1524\boxed{\textbf{(B)}\ 1524}.

Review in the AoPS books

Similar problems

Problem © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. Solution and commentary are original to this site.