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
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,