OFFSET
1,1
LINKS
Newsgroup article Probabilityquestion of sci.math, Mar 6 2006.
FORMULA
For m throws, the number of outcomes without n consecutive appearances of a fixed face equals the coefficient of x^(m+1) in (1-x)/(1-6x+5x^(n+1))/5. - Max Alekseyev, Mar 13 2009
EXAMPLE
Example a(n=1)=4: after first throw, probability of the fixed face k is 1/6, 5/6 against. After 2nd throw, probability of face k not shown before but at the 2nd throw is (5/6)*(1/6). After 3rd throw, probability of face k only at this throw is (5/6)^2*(1/6), but total probability 1/6+(5/6)*(1/6)+(5/6)^2*(1/6) still less than 0.5. After the 4th throw, total probability is 1/6+(5/6)*(1/6)+(5/6)^2*(1/6)+(5/6)^3*(1/6) > 0.5.
MAPLE
with(linalg) : # Markov state approach with probability transition matrix trans # and n+1 different states for n from 1 to 30 do trans := array(1..n+1, 1..n+1) : for co from 1 to n do trans[1, co] := 5/6 ; for ro from 2 to n +1 do trans[ro, co] := 0 ; od ; trans[co+1, co] := 1/6 : od: # initial state: a previous 4-series for ro from 1 to n do trans[ro, n+1] := 0 : od : trans[n+1, n+1] := 1 : istate := vector(n+1) : istate[1] := 1 : for ro from 2 to n+1 do istate[ro] := 0 : od : #throw die with initial state vector istate for thro from 1 do istate := multiply(trans, istate) : if ( istate[n+1] > 1/2 ) then print(n, thro) ; break ; fi ; od : od:
PROG
(PARI) { a(n) = local(M, v, L); M=matrix(n+1, n+1, i, j, if(i==1&&j<=n, 5/6., if(i==j+1, 1/6., if(i==j&&i==n+1, 1., 0))) ); v=vector(n+1, j, j==1)~; L=[1, 2]; while((M^L[2]*v)[n+1]<0.5, L*=2; ); while(L[2]-L[1]>1, m=(L[1]+L[2])\2; if((M^m*v)[n+1]<0.5, L[1]=m, L[2]=m); ); L[2] } /* Max Alekseyev, Mar 13 2009 */
CROSSREFS
KEYWORD
nonn
AUTHOR
R. J. Mathar, Mar 14 2006
EXTENSIONS
Extended by Max Alekseyev, Mar 13 2009
STATUS
approved