November 6th, 2009, 2:29 am
for n coins, denote such probability p(n). the recurrence relation is p(n+4) = p(n+3) - p(n)/16, with p(0)=p(1)=p(2)=p(3)=1.the characteristic equation: x^4-x^3+1/16=0 has 2 real roots: x_1~0.92 and x_2=1/2; it also has two complex conjugate roots x_3 and x_4 (both with norm of ~0.37).p(n) can thus be written as a1*(x1^n)+a2*(x2^n)+a3*(x3^n)+a4*(x4^n), where a's are determined by the initial conditions. one can get a_i=1+(3/4)/(4*x_i^3-1) by inverting a Vandermonde matrix.when n is sufficiently large, one just needs the root with the largest norm, so the probability is ~1.4*(0.92)^n.the exact expression of x_1 and a_1 are:for n=10^2, via mathematica, the exact recursion gives 3.1e-4, which agrees with a1*(x1^100) extremely well;for n=10^9, one essentially needs to calculate 10^9*log10(x_1)+log10(a_1) to two digits after the decimal point to get two significant figures for the answer: ~ 9.0e-36380553----- ----- ----- ----- -----another approach is to use the generating function: (1 - x + x^4/16)^(-1). by using the negative multinomial coefficients, one gets----- ----- ----- ----- -----a slightly harder question is to calculate the prob for an "overlapping pattern" (in the sense that if the pattern appears more than once in the sequence, they could overlap), e.g., "H T H".the generating function is slightly more complicated: (1 + x^2/4)/(1 - x + x^2/4 - x^3/8), which results the recurrence relation: p(n+3) = p(n+2) - p(n+1)/4 + p(n)/8, with p(0)=p(1)=p(2)=1. then same technique as above applies.
Last edited by
wileysw on November 12th, 2009, 11:00 pm, edited 1 time in total.