Ann and Drew have purchased a mysterious slot machine; each time it is spun, it chooses a random positive integer such that k is chosen with probability 2^-k for every positive integer k, and then it outputs k tokens. Let N be a fixed integer. Ann and Drew alternate turns spinning the machine, with Ann going first. Ann wins if she receives at least N total tokens from the slot machine before Drew receives at least M = 2^2018 total tokens, and Drew wins if he receives M tokens before Ann receives N tokens. If each person has the same probability of winning, compute the remainder when N is divided by 2018.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
We claim that in general the game is fair if N = M + 1. This implies that the answer is 5 by Fermat. Indeed, consider the following game: Ann and Drew flip a coin repeatedly, and Ann wants to get to N heads, while Drew wants to get to M tails. By replacing "runs" (i.e. maximal strings of only H or T) with a spin of a slot machine, we see that the two games are the same, so long as the first flip is heads, since the first run is heads. So, we need N = M + 1.