If you roll a single die, what is the expected number of rolls necessary to roll every number once?

2 Answers
May 7, 2018

14.7 " rolls"

Explanation:

P["all numbers thrown"] = 1 - P["1,2,3,4,5, or 6 not thrown"]
P["A or B or C or D or E or F"] = P[A]+P[B]+...+P[F] -
P[A and B] - P[A and C] .... + P[A and B and C] + ...
"Here this is"
P_1 = 6*(5/6)^n - 15*(4/6)^n + 20*(3/6)^n - 15*(2/6)^n + 6*(1/6)^n
P = P_1(n) - P_1(n-1)
= 6*(5/6)^(n-1)(5/6 - 1) - 15*(4/6)^(n-1)(4/6-1) + ...
= -(5/6)^(n-1)+5*(4/6)^(n-1)-10*(3/6)^(n-1)+10*(2/6)^(n-1)-5*(1/6)^(n-1)
"The negative of this is our probability."

sum n*a^(n-1) = sum (d/{da})(a^n)
= (d/{da}) sum a^n = (d/{da}) (1/(1-a)) = 1 / (1-a)^2

=> E[n] = sum n * P["all numbers thrown after n throws"]
= sum n*((5/6)^(n-1) - 5*(4/6)^(n-1) + ...
= 1/(1-5/6)^2 - 5/(1-4/6)^2+10/(1-3/6)^2-10/(1-2/6)^2+5/(1-1/6)^2
= 36 - 45 + 40 - 22.5 + 7.2
= 15.7
"We have to subtract one because of the begin condition P_1(0)"
"gives a faulty value P=1 for n=1."
=> P = 15.7 - 1 = 14.7

May 8, 2018

6/6+6/5+6/4+6/3+6/2+6/1 = 14.7

Explanation:

Think of it like six mini-games. For each game, we roll the die until we roll a number that hasn't been rolled yet—what we'll call a "win". Then we start the next game.

Let X be the number of rolls needed to roll every number at least once (i.e. win all 6 mini-games), and let X_i be the number of rolls needed to "win" mini-game number i (for i from 1 to 6). Then each X_i is a Geometric random variable with distribution "Geo"(p_i).

The expected value of each Geometric random variable is 1/p_i.

For the first game, p_1 = 6/6 since all 6 outcomes are "new". Thus, "E"(X_1) = 6/6 = 1.

For the second game, 5 out of the 6 outcomes are new, so p_2=5/6. Thus, "E"(X_2)=6/5 = 1.2.

For the third game, 4 of the 6 possible rolls are new, so p_3=4/6, meaning "E"(X_3) = 6/4 = 1.5.

By this point, we can see a pattern. Since the number of "winning" rolls decreases by 1 for each new game, the probability of "winning" each game goes down from 6/6 to 5/6, then 4/6, etc., meaning the expected number of rolls per game goes from 6/6 to 6/5, to 6/4, and so on, until the last game, where we expect it to take 6 rolls to get the last number.

Thus:

"E"(X) = "E"(X_1+X_2+X_3+X_4+X_5+X_6)

color(white)("E"(X)) = "E"(X_1)+"E"(X_2)+...+"E"(X_5)+"E"(X_6)

color(white)("E"(X)) = 6/6+6/5+6/4+6/3+6/2+6/1

color(white)("E"(X)) = 1+1.2+1.5+2+3+6

color(white)("E"(X)) = 14.7