Problem 31.17 Easy Free

Units Digit of a Power

A value mm is chosen uniformly at random from {111,133,155,177,199}\{111, 133, 155, 177, 199\}, and independently an exponent nn is chosen uniformly at random from {2004,2005,…,2023}\{2004, 2005, \ldots, 2023\}. Find the probability that mnm^n ends in the digit 11.

Work it out, then compare with the answer.

SolutionShow the worked solution

Only the units digit of mm matters, so we may replace the set with {1,3,5,7,9}\{1,3,5,7,9\}. Each of the five values is equally likely.

The set {2004,…,2023}\{2004,\dots,2023\} contains 2020 consecutive integers. Since 20042004 is divisible by 44, each residue of nn modulo 44 occurs exactly 55 times. So n mod 4n \bmod 4 is uniform on {0,1,2,3}\{0,1,2,3\} and independent of mm.

Now look at the units digits of successive powers of each digit:

  • 11: always 11. Then mnm^n ends in 11 for every nn, with probability 11.
  • 33: the cycle is 3,9,7,13,9,7,1. The units digit is 11 exactly when 4∣n4\mid n, with probability 14\tfrac14.
  • 55: always 55, with probability 00.
  • 77: the cycle is 7,9,3,17,9,3,1. The units digit is 11 exactly when 4∣n4\mid n, with probability 14\tfrac14.
  • 99: the cycle is 9,19,1. The units digit is 11 exactly when nn is even, with probability 12\tfrac12.

Averaging over the five equally likely values of mm gives

P(mn ends in 1)=15(1+14+0+14+12)=15⋅2=25.\mathbb{P}(m^n \text{ ends in } 1)=\frac15\left(1+\frac14+0+\frac14+\frac12\right)=\frac15\cdot 2=\frac25 .
25\boxed{\dfrac{2}{5}}

Key idea. Units digits of powers repeat with period dividing 44. Because the range of nn covers whole periods, only the residue n mod 4n \bmod 4 matters, and it is uniform.