Difference between revisions of "2023 SSMO Accuracy Round Problems/Problem 2"

Line 1: Line 1:
 
==Problem==
 
==Problem==
 
Suppose that the average of all <math>n</math>-digit palindromes is denoted by <math>P_{n}</math> and the average of all <math>n</math>-digit numbers is denoted by <math>N_{n}.</math> Find <math>\left\lfloor\sum_{n=1}^{100}(P_{n}-N_{n})\right\rfloor.</math>
 
Suppose that the average of all <math>n</math>-digit palindromes is denoted by <math>P_{n}</math> and the average of all <math>n</math>-digit numbers is denoted by <math>N_{n}.</math> Find <math>\left\lfloor\sum_{n=1}^{100}(P_{n}-N_{n})\right\rfloor.</math>
 +
 +
==Solution (official)==
 +
We claim that <math>P_n - N_n = \frac{1}{2}</math>
 +
for all <math>n\neq 1</math>.
 +
 +
For <math>P_n</math> and <math>N_n</math>, the average value is the sum of the average values of each of the digits.
 +
 +
The first <math>n-1</math> digits of <math>P_n</math> and <math>N_n</math> have the same
 +
average value, but the last digit of <math>P_n</math> can only be <math>1</math> through <math>9</math> inclusive, while the last digit of <math>N_n</math> can only be <math>0</math> through <math>9</math> inclusive, which has a difference of
 +
\[
 +
    \frac{1+9}{2} - \frac{0+9}{2} = 0.5.
 +
\]
 +
For <math>n=1,</math> clearly <math>P_1 = N_1 = 5,</math> so <math>P_n-N_n = 0</math>
 +
Thus, <math>\left\lfloor\sum_{n=1}^{100} (P_n - N_n)\right\rfloor = \left\lfloor99 \cdot 0.5\right\rfloor = \boxed{49}</math>
 +
~SMO_Team
  
 
==Solution==
 
==Solution==

Revision as of 14:45, 9 September 2025

Problem

Suppose that the average of all $n$-digit palindromes is denoted by $P_{n}$ and the average of all $n$-digit numbers is denoted by $N_{n}.$ Find $\left\lfloor\sum_{n=1}^{100}(P_{n}-N_{n})\right\rfloor.$

Solution (official)

We claim that $P_n - N_n = \frac{1}{2}$ for all $n\neq 1$.

For $P_n$ and $N_n$, the average value is the sum of the average values of each of the digits.

The first $n-1$ digits of $P_n$ and $N_n$ have the same average value, but the last digit of $P_n$ can only be $1$ through $9$ inclusive, while the last digit of $N_n$ can only be $0$ through $9$ inclusive, which has a difference of \[

   \frac{1+9}{2} - \frac{0+9}{2} = 0.5.

\] For $n=1,$ clearly $P_1 = N_1 = 5,$ so $P_n-N_n = 0$ Thus, $\left\lfloor\sum_{n=1}^{100} (P_n - N_n)\right\rfloor = \left\lfloor99 \cdot 0.5\right\rfloor = \boxed{49}$ ~SMO_Team

Solution

The outermost digits of an $n$-digit palindrome can range from $1$ to $9$, each with equal probability (notice that they must be equal due to being a palindrome, so the ones digit cannot be $0$), so the average is $5$. The inner digits can range from $0$ to $9$, again with equal probability, so their average is $4.5$. Thus $P_n=5(10^{n-1}+1)+4.5(10+10^2+\ldots+10^{n-2})$.

However, the $n$-digit numbers range in the exact same way except that the ones digit can range from $0$ to $9$. Thus $N_n=5(10^{n-1})+4.5(1+10+10^2+\ldots+10^{n-2})$.

Then, \begin{align*} P_n-N_n&=5(10^{n-1}+1)+4.5(10+10^2+\ldots+10^{n-2})-5(10^{n-1})-4.5(1+10+10^2+\ldots+10^{n-2})\\ &=5(1)-4.5(1)\\ &=0.5 \end{align*}

However, we must consider one special case: $n=1$. Here, $0$ is an $n$-digit number, so the difference between $P_1$ and $N_1$ is $0$ (they are the same set). For all $n>1$ the difference is $0.5$; therefore, \[\left\lfloor\sum_{n=1}^{100}(P_{n}-N_{n})\right\rfloor=\lfloor0+99\cdot0.5\rfloor=\lfloor49.5\rfloor=\boxed{49}\]

~ eevee9406