2023 SSMO Accuracy Round Problems/Problem 2
Problem
Suppose that the average of all -digit palindromes is denoted by
and the average of all
-digit numbers is denoted by
Find
Solution (official)
We claim that for all
.
For
and
, the average value is the sum of the average values of each of the digits. The first
digits of
and
have the same average value, but the last digit of
can only be
through
inclusive, while the last digit of
can only be
through
inclusive, which has a difference of
For
clearly
so
Thus,
~SMO_Team
Solution
The outermost digits of an -digit palindrome can range from
to
, each with equal probability (notice that they must be equal due to being a palindrome, so the ones digit cannot be
), so the average is
. The inner digits can range from
to
, again with equal probability, so their average is
. Thus
.
However, the -digit numbers range in the exact same way except that the ones digit can range from
to
. Thus
.
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: . Here,
is an
-digit number, so the difference between
and
is
(they are the same set). For all
the difference is
; therefore,