AMC 10 Step by Step

2023 AMC 10B Problem 16

P16-20~4 minPrint

Define an upnoupno to be a positive integer of 22 or more digits where the digits are strictly increasing moving left to right. Similarly, define a downnodownno to be a positive integer of 22 or more digits where the digits are strictly decreasing moving left to right. For instance, the number 258258 is an upno and 86208620 is a downno. Let UU equal the total number of upnosupnos and let DD equal the total number of downnosdownnos . What is ∣U−D∣|U-D| ?

Log in to save your progress.
Show solution without answering

Key insight

Picking the digits decides the number, so count sets of digits. The digit 0 can end a downno but can never start an upno.

Solution

Choosing the digits decides the number. For example, the digits {2,5,8}\{2, 5, 8\} give exactly one upno, 258258, and exactly one downno, 852852. So instead of counting numbers, count sets of digits.

1. How many sets can you pick from some digits? For each digit you either take it or leave it, two choices. From 99 digits there are 29=5122^9 = 512 possible sets; from 1010 digits there are 210=10242^{10} = 1024. (These include the empty set and the one-digit sets.)
2. Upnos. The digit 00 can never be used: in increasing order it would come first, and a number cannot start with 00. So the digits come from 1,2,…,91, 2, \ldots, 9. Out of the 512512 sets, remove the empty set and the 99 single-digit sets, since an upno needs at least 22 digits:
U=512−1−9=502.U = 512 - 1 - 9 = 502.
3. Downnos. Now 00 is fine, because in decreasing order it comes last (like 86208620). So the digits come from 0,1,…,90, 1, \ldots, 9. Out of the 10241024 sets, remove the empty set and the 1010 single-digit sets:
D=1024−1−10=1013.D = 1024 - 1 - 10 = 1013.
4. Subtract.
∣U−D∣=1013−502=511.|U - D| = 1013 - 502 = 511.

The answer is (E) 511\boxed{\textbf{(E)}\ 511}.

Why this works

When the order of the digits is forced (increasing or decreasing), each number matches exactly one set of digits, and sets are easy to count with powers of 22. The whole difference between UU and DD comes from the digit 00, which can sit at the end of a number but never at the start.

Alternative approach

Match upnos with downnos directly.

  1. Reverse any upno and you get a downno without a 00. For example, 258258 becomes 852852. Every downno without a 00 comes from exactly one upno this way. So those cancel out in U−DU - D.
  2. The downnos left over are the ones that end in 00. Such a number is some digits from 11 to 99 written in decreasing order, followed by 00.
  3. The digits before the 00 can be any set from 11 to 99 except the empty set (the number needs at least 22 digits, and one of them is the 00). That is 29−1=5112^9 - 1 = 511 choices.

So DD is 511511 more than UU.

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 decreasing) number is determined by its set of digits: once the digits are chosen, there is exactly one way to arrange them in increasing order and one way in decreasing order. So counting upnos and downnos is counting sets of digits.

Upnos: the digit 00 cannot appear, because in increasing order it would be the leading digit. So an upno is a subset of {1,2,…,9}\{1, 2, \dots, 9\} with at least 22 elements:
U=29−1−9=502.U = 2^9 - 1 - 9 = 502.

Downnos: 00 may appear, since in decreasing order it lands at the end (like 86208620). A downno is a subset of {0,1,…,9}\{0, 1, \dots, 9\} with at least 22 elements:
D=210−1−10=1013.D = 2^{10} - 1 - 10 = 1013.

Therefore ∣U−D∣=1013−502=511|U - D| = 1013 - 502 = 511.

The answer is (E) 511\boxed{\textbf{(E)}\ 511}.

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.