Random Integer Divisible by 3

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.


The answer is 3.0.

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.

1 solution

Mark Hennings
Apr 10, 2018

Let L L be the number of digits needed to get a multiple of 3 3 . Then P [ L n ] = ( 2 3 ) n 1 n 1 \mathbb{P}[L \ge n] \; = \; \big(\tfrac23\big)^{n-1} \hspace{2cm} n \ge 1 Proof : For L n L\ge n we must have not formed a multiple of 3 3 by the time we have made the first n 1 n-1 digit choices. This means that the digit sum of the first m m digits cannot be a multiple of 3 3 for any 1 m n 1 1 \le m \le n-1 . At any stage, no matter what the digit sum of the first m 1 m-1 digits is, there are 3 3 out of the 9 9 digits 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 1,2,3,4,5,6,7,8,9 that could be chosen which would make the sum of the first m m digits a multiple of 3 3 . Thus the probability that the sum of the first m m digits is not a multiple of 3 3 is 2 3 \tfrac23 , and this probability is independent of the first m 1 m-1 digit choices. Thus it is clear that the desired probability is ( 2 3 ) n 1 \big(\tfrac23\big)^{n-1} .

Thus the expected value of L L is E [ L ] = n 1 P [ L n ] = n 1 ( 2 3 ) n 1 = 3 \mathbb{E}[L] \; = \; \sum_{n \ge 1} \mathbb{P}[L \ge n] \; = \; \sum_{n \ge 1} \big(\tfrac23\big)^{n-1} \; = \; \boxed{3}

Right! This game is a "skin" on a geometric distribution with probability of success 1 3 . \frac{1}{3}.

Eli Ross Staff - 3 years, 2 months ago

1 pending report

Vote up reports you agree with

×

Problem Loading...

Note Loading...

Set Loading...