2025 SSMO Team Round Problems/Problem 8
Problem
Adam has a fair coin with a
written on one side and a
written on the other. What is the expected number of times Adam needs to flip the coin for the sum of all his coin flips to be a multiple of
?
Solution
We proceed via states. Suppose after some number of coin flips (possibly zero), the remainder when the sum of Adam's coin flips is divided by
is
. Then, let
denote the expected number of flips Adam needs for the sum of all his flips to be a multiple of
if he must flip his coin at least once, and let
denote the expected number of flips Adam needs for the sum of all his flips to be a multiple of
if he does not necessarily have to flip his coin at least once. We seek the value of
.
For every integer
, we have
,
where we consider subscrips modulo
. Consider the equation obtained by adding all
equations of this form together. The left hand side is simply
. Since
and
are both bijections modulo
, the right hand side is
. Therefore, we have
Now, it is obviously impossible for the sum of Adam's coin flips to be a multiple of
zero flips after his sum is not a multiple of
. Thus, for all valid
, we have
. Hence, our
-variable equation above simplifies neatly as
. Trivially,
, so
.
~Sedro