Problem:
Random sequences and are chosen so that every element in each sequence is chosen independently and uniformly from the set . Compute the expected value of the smallest nonnegative integer such that there exist positive integers and with
Problem:
Random sequences and are chosen so that every element in each sequence is chosen independently and uniformly from the set . Compute the expected value of the smallest nonnegative integer such that there exist positive integers and with
Solution:
Let's first solve the problem, ignoring the possibility that the and can be zero. Call a positive integer an -sum if for some nonnegative integer (in particular, 0 is always an -sum). Define the term -sum similarly. Let be the expected value of the smallest positive integer that is both an -sum and a -sum.
The first key observation to make is that if is both an -sum and a -sum, then the distance to the next number that is both an -sum and a -sum is . To see this, note that if
the distance to the next number that is both an -sum and a -sum is the minimal positive integer so that there exist and so that
This is the same question of which we defined to be the answer, but with renamed variables, so the expected value of is . As a result, we conclude that the expected density of numbers that are both -sums and -sums is .
We now compute this density. Note that since the expected value of is , the density of -sums is . Also, the density of -sums is . Moreover, as goes to infinity, the probability that is an -sum approaches and the probability that is a -sum approaches . Thus, the density of numbers that are simultaneously -sums and -sums is , so .
We now add back the possibility that some of the and can be 0. The only way this changes our answer is that the we seek can be 0, which happens if and only if . Thus our final answer is