We roll a fair 6-sided die until the product of the rolls has at least three positive integer divisors (so we continue rolling the die iff the product is 1 or a prime number). What is the expected value of the number of rolls we have to do?
Remark: Just to clarify, in case of 1,1,6 the number of rolls is 3; in case of 3,1,1,5 the number of rolls if 4, etc.
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 can solve this problem with the idea of using recursion with states. We introduce three states:
S 1 = when the product is 1 (i.e. only one divisor - this is where we start at the beginning),
S p = when the product is a prime number (i.e. exactly two divisors),
and
S f = the end of rollig, so when the product has at least three divisors.
Furthermore, let:
E 1 = E ( X ∣ S 1 ) = the expected value of rolls if we start from state S 1
and
E p = E ( X ∣ S p ) = the expected value of rolls if we start from state S p .
We can write the following equations:
E 1 = 6 1 ⋅ ( 1 + E 1 ) + 2 1 ⋅ ( 1 + E p ) + 3 1 ⋅ 1 = 1 + 6 1 ⋅ E 1 + 2 1 ⋅ E p
and
E p = 6 1 ⋅ ( 1 + E p ) + 6 5 ⋅ 1 = 1 + 6 1 E p ,
which we can solve easily. The solution is E 1 = 2 5 4 8 = 1 . 9 2 .