login
A199925
Number of sequences of n coin flips that win on the last flip, if the sequence of flips ends with (0,0,1,1).
2
0, 0, 0, 1, 2, 4, 8, 14, 25, 45, 80, 142, 253, 450, 800, 1423, 2531, 4501, 8005, 14237, 25320, 45031, 80087, 142433, 253314, 450514, 801230, 1424971, 2534282, 4507169, 8015908, 14256129, 25354235, 45091990, 80195185, 142625502, 253656548
OFFSET
1,5
COMMENTS
If the sequence ends with (1,1,1,1) Kain wins.
Kain(n)=A199926(n). Winsum(n)=A199594(n).
Win probability of Abel = sum(a(n)/2^n) = 3/4.
Win probability of Kain = sum(Kain(n)/2^n)=1/4.
Mean length of the game = sum(n*Winsum(n)/2^n)=12.
REFERENCES
A. Engel, Wahrscheinlichkeit und Statistik, Band 2, Klett, 1978, pages 25-26.
FORMULA
a(n) = a(n-1)+a(n-2)+a(n-3)-a(n-5) for n>7.
a(n) = 2*a(n-1)-a(n-4)-a(n-5)+a(n-6) for n>8.
G.f.: x^4*(1+x)*(1+x^2)/(1-x-x^2-x^3+x^5).
a(n) = A164388(n-4) for n > 3. - Georg Fischer, Oct 14 2018
EXAMPLE
For n=6 the a(6)=4 solutions are (0,0,0,0,1,1),(1,0,0,0,1,1),(0,1,0,0,1,1),(1,1,0,0,1,1).
MAPLE
a(1):=0: a(2):=0: a(3):=0: a(4):=1: a(5):=2:
a(6):=4: a(7):=8: pot:=2^3: pa:=0:
for n from 4 to 7 do
pot:=2*pot:
pa:=pa+a(n)/pot:
end do:
for n from 8 to 100 do
pot:=2*pot:
a(n):=a(n-1)+a(n-2)+a(n-3)-a(n-5):
pa:=pa+a(n)/pot:
end do:
printf("%10.5f", pa):
seq(a(n), n=1..100);
MATHEMATICA
LinearRecurrence[{1, 1, 1, 0, -1}, {0, 0, 0, 1, 2, 4, 8}, 40] (* Harvey P. Dale, Jul 11 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul Weisenhorn, Nov 12 2011
STATUS
approved