I've just played a game with my kids that basically boils down to: whoever rolls every number at least once on a 6-sided die wins.
I won, eventually, and the others finished 1-2 turns later. Now I'm wondering: what is the expectation of the length of the game?
I know that the expectation of the number of rolls till you hit a specific number is $\sum_{n=1}^\infty n\frac{1}{6}(\frac{5}{6})^{n-1}=6$.
However, I have two questions:
- How many times to you have to roll a six-sided die until you get every number at least once?
- Among four independent trials (i.e. with four players), what is the expectation of the maximum number of rolls needed? [note: it's maximum, not minimum, because at their age, it's more about finishing than about getting there first for my kids]
I can simulate the result, but I wonder how I would go about calculating it analytically.
Here's a Monte Carlo simulation in Matlab
mx=zeros(1000000,1);
for i=1:1000000,
%# assume it's never going to take us >100 rolls
r=randi(6,100,1);
%# since R2013a, unique returns the first occurrence
%# for earlier versions, take the minimum of x
%# and subtract it from the total array length
[~,x]=unique(r);
mx(i,1)=max(x);
end
%# make sure we haven't violated an assumption
assert(numel(x)==6)
%# find the expected value for the coupon collector problem
expectationForOneRun = mean(mx)
%# find the expected number of rolls as a maximum of four independent players
maxExpectationForFourRuns = mean( max( reshape( mx, 4, []), [], 1) )
expectationForOneRun =
14.7014 (SEM 0.006)
maxExpectationForFourRuns =
21.4815 (SEM 0.01)