I want to make a multiple of four in a curious way: First I choose a random integer 1 to 4, each equally likely. If I get the '4', I stop immediately and that is my number. As long as I do not have a multiple of four, I continue to choose more random integers 1 to 4, keeping track of the running total. When the running total is a multiple of four, then I stop.
What is the expected number of random integers I need to get my multiple of four and what is the expected value of the running total?
Variation: The first random integer is the same, but the second and subsequent integers are equal to, one less, or one more than the previous integer. (If the previous random integer was 3, then I would choose one of 2, 3, or 4.)
In this case what is the expected number of integers needed and what is the expected total?
Well, I did some more math, and I see that I was wrong.
In part I, the expected total value when stopping is 10, just as tomarken said.
Maybe this should have been intuitive, but I didn't find it so.
Here's my calculation:
Let a = expected additional accumulation before stopping if current total 1 (mod 4)
Let b = expected additional accumulation before stopping if current total 2 (mod 4)
Let c = expected additional accumulation before stopping if current total 3 (mod 4)
If my current total is 1 mod 4, then there are 4 equal cases:
my next number is 1, in which case the new expected additional is b
my next number is 2, in which case the new expected additional is c
my next number is 3, in which case the new expected additional is zero
my next number is 4, in which case the new expected additional is a
so, a = (1+b)/4 + (2+c)/4 + (3)/4 + (4+a)/4 = 2.5 + (a+b+c)/4
similarly,
b = (1+c)/4 + (2)/4 + (3+a)/4 + (4+b)/4 = 2.5 + (a+b+c)/4
similarly,
c = 2.5 + (a+b+c)/4
a = b = c = 10
Then, at the start of the exercise
if my next number is 1, the total expected is 1 + 10 = 11
if my next number is 2, the total expected is 2 + 10 = 12
if my next number is 3, the total expected is 3 + 10 = 13
if my next number is 4, the total expected is 4
And the average = total expected at start of game = 10.