You're playing a game in which you repeatedly randomly pick an integer from 1-9 (inclusive), append it to any previous digits, and win when the number formed is divisible by 3.
What is the expected value of the number of digits when you first win?
As an example, it would take 2 digits if you selected 1 and then 5, forming 15.
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.
Let L be the number of digits needed to get a multiple of 3 . Then P [ L ≥ n ] = ( 3 2 ) n − 1 n ≥ 1 Proof : For L ≥ n we must have not formed a multiple of 3 by the time we have made the first n − 1 digit choices. This means that the digit sum of the first m digits cannot be a multiple of 3 for any 1 ≤ m ≤ n − 1 . At any stage, no matter what the digit sum of the first m − 1 digits is, there are 3 out of the 9 digits 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 that could be chosen which would make the sum of the first m digits a multiple of 3 . Thus the probability that the sum of the first m digits is not a multiple of 3 is 3 2 , and this probability is independent of the first m − 1 digit choices. Thus it is clear that the desired probability is ( 3 2 ) n − 1 .
Thus the expected value of L is E [ L ] = n ≥ 1 ∑ P [ L ≥ n ] = n ≥ 1 ∑ ( 3 2 ) n − 1 = 3