Art of Problem Solving

2025 AMC 12A Problems/Problem 23: Difference between revisions

Shadowleafy (talk | contribs)
No edit summary
Silverrush (talk | contribs)
m Solution 2: latex fix
Line 27: Line 27:
Let <imath>n</imath> be the maximum digit. For each number <imath>i<n</imath>, we may either place <imath>i</imath> before <imath>n</imath>, after <imath>n</imath>, or choose not to include it. Note this process will result in a unique number for every case, as the numbers before <imath>n</imath> must be in increasing order, and the numbers after <imath>n</imath> must be in decreasing order. Therefore, for each number <imath>n</imath>, we have <imath>3^{n-1}</imath> cases.
Let <imath>n</imath> be the maximum digit. For each number <imath>i<n</imath>, we may either place <imath>i</imath> before <imath>n</imath>, after <imath>n</imath>, or choose not to include it. Note this process will result in a unique number for every case, as the numbers before <imath>n</imath> must be in increasing order, and the numbers after <imath>n</imath> must be in decreasing order. Therefore, for each number <imath>n</imath>, we have <imath>3^{n-1}</imath> cases.


Since <imath>n \in \{1,2,...9\}</imath>, we have:
Since <imath>n \in \{1,2,\cdots9\}</imath>, we have:
<cmath>\sum_{n=1}^9 3^{n-1}=\frac{3^9-1}{3-1}=\boxed{9841}.</cmath>
<cmath>\sum_{n=1}^9 3^{n-1}=\frac{3^9-1}{3-1}=\boxed{9841}.</cmath>



Revision as of 17:42, 6 November 2025

Problem

Call a positive integer fair if no digit is used more than once, it has no $0$s, and no digit is adjacent to two greater digits. For example, $196, 23$ and $12463$ are fair, but $1546, 320,$ and $34321$ are not. How many fair positive integers are there?

$\textbf{(A) } 511 \qquad \textbf{(B) } 2584 \qquad \textbf{(C) } 9841 \qquad \textbf{(D) } 17711 \qquad \textbf{(E) } 19682$

Solution 1

To satisfy the conditions, a $\textit{fair}$ integer must have no digit be a local minimum. Let's say we have $n$ distinct digits, with each digit being a number from $1$ to $9$. To create a $\textit{fair}$ integer, we begin by placing the largest digit. For the second-largest digit, we can either place this digit to the right or to the left of the string already created. We have these $2$ options for the third-largest digit, and so on. Therefore, there are $2^{n-1}$ valid permutations to create a $\textit{fair}$ integer.

We must also choose which digits will be in the permutation. If you are creating an $n$-digit long $\textit{fair}$ integer, there are $9\choose{n}$ ways to pick which digits will be in the number.

Therefore, for each $n \in \{1,2,\dots, 9\}$, the number of fair integers of length $n$ is: \[\binom{9}{n} \cdot 2^{n-1}.\] Summing over all $n$: \[\sum_{n=1}^9{\binom{9}{n} \cdot 2^{n-1}}\] \[=\frac{1}{2}\left(\sum_{n=0}^9{\binom{9}{n}}2^n -1\right)\] \[=\frac{1}{2}\left((1+2)^9 -1 \right) = \frac{1}{2}(19682) = \boxed{9841}.\] Note that the Binomial Theorem was used to equate \[\sum_{n=0}^9{\binom{9}{n}}2^n = (1+2)^9.\]

~lprado

Solution 2

Note every "fair" number will have an increasing string of digit, a maximum digit, then a decreasing string of digits. This is because if it decreases then increases, then the digit in the middle will be less than its adjacent digits.

Let $n$ be the maximum digit. For each number $i<n$, we may either place $i$ before $n$, after $n$, or choose not to include it. Note this process will result in a unique number for every case, as the numbers before $n$ must be in increasing order, and the numbers after $n$ must be in decreasing order. Therefore, for each number $n$, we have $3^{n-1}$ cases.

Since $n \in \{1,2,\cdots9\}$, we have: \[\sum_{n=1}^9 3^{n-1}=\frac{3^9-1}{3-1}=\boxed{9841}.\]

~SilverRush

Solution 3 (Recursion)

Let $f(n)$ be the number of fair integers given an arbitrary set of $n$ digits. Let $a$ be the smallest of these digits. Notice that $a$ is either the first or last digit, as if it were any other digit, the two digits surroudning it would both be greater. Then, notice that if the remaining $n-1$ slots form a fair number, so does the number when $a$ is appended. Therefore, $f(n) = 2f(n-1)$. From here, we may proceed with the calculation in Solution $1$ to get the answer of $\boxed {\text {(C) } 9841}$

~ Shadowleafy