HMMT-Feb 2014 guts, Problem 11

Two fair octahedral dice, each with the numbers 1 through 8 on their faces, are rolled. Let $N$ be the remainder when the product of the numbers showing on the two dice is divided by 8 . Find the expected value of $N$.

Solution: If the first die is odd, which has $\frac{1}{2}$ probability, then $N$ can be any of $0,1,2,3$, $4,5,6,7$ with equal probability, because multiplying each element of $\{0, \ldots, 7\}$ with an odd number and taking modulo 8 results in the same numbers, as all odd numbers are relatively prime to 8 . The expected value in this case is 3.5 . If the first die is even but not a multiple of 4 , which has $\frac{1}{4}$ probability, then using similar reasoning, $N$ can be any of $0,2,4,6$ with equal probability, so the expected value is 3 . If the first die is 4 , which has $\frac{1}{8}$ probability, then $N$ can by any of 0,4 with equal probability, so the expected value is 2 . Finally, if the first die is 8 , which has $\frac{1}{8}$ probability, then $N=0$. The total expected value is $\frac{1}{2}(3.5)+$ $\frac{1}{4}(3)+\frac{1}{8}(2)+\frac{1}{8}(0)=\frac{11}{4}$. $\fbox{\frac{11}{4}}$.

Answer: \frac{11}{4}