Consider an eight-sided die numbered 1 to 8 which is loaded in such a way that the probability of each face turning up is proportional to the number of dots on that face. For example, a six is
three times as probable as a two.
The die is rolled until a run of 8 different faces appears. For example, one might roll the sequence 6565742726486467483472516 with only the last eight rolls all distinct.
(i) What is the expected number of rolls for the above event?
(ii) How will the answer change if the last 8 rolls was required to produce 12345432 (strictly in this order?
A simulation of the problem presented (part i) finds an average of about 2000 rolls to be necessary, using the non-uniform distribution:
Dim crlf$, denom(36)
Private Sub Command1_Click()
Private Sub Form_Load()
Form1.Visible = True
' Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
digs$ = "12345678"
For i = 1 To 8
For j = 1 To i
subs = subs + 1
denom(subs) = i
' Text1.Text = Text1.Text & subs & Str(denom(subs)) & crlf
tCt = 0: tTr = 0
For trial = 1 To 1000
had$ = "": good = 0
r = denom(Int(Rnd(1) * 36 + 1))
had = had + LTrim(Str(r))
If Len(had) >= 8 Then
good = 1
rt$ = Right(had, 8)
For i = 1 To 8
If InStr(rt$, Mid(digs, i, 1)) = 0 Then good = 0: Exit For
Loop Until good
tCt = tCt + Len(had): tTr = tTr + 1
Text1.Text = Text1.Text & crlf & tCt / tTr & " done"
Averages of 1000 trials each:
The average of these, representing 10,000 trials, is 2021.3762.
Posted by Charlie
on 2016-09-08 13:11:57