login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A199594 Number of sequences of n coin flips that win on the last flip, if the sequence of flips ends with (0,0,1,1) or (1,1,1,1). 2
0, 0, 0, 2, 3, 5, 10, 18, 31, 56, 100, 177, 315, 561, 997, 1773, 3154, 5609, 9975, 17741, 31552, 56114, 99798, 177489, 315660, 561395, 998430, 1775687, 3158023, 5616480, 9988795, 17764868, 31594456, 56190096, 99932940, 177728697, 316086865, 562154046 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
If the sequence ends with (0,0,1,1) Abel wins.
If the sequence ends with (1,1,1,1) Kain wins.
Abel(n)=A199925(n); Kain(n)=A199926(n).
Win probability of Abel = sum(Abel(n)/2^n)=3/4.
Win probability of Kain = sum(Kain(n)/2^n)=1/4.
Mean length of the game = sum(n*a(n)/2^n)=12.
REFERENCES
A. Engel, Wahrscheinlichkeit und Statistik Band 2, Klett, 1978, pages 25-26.
LINKS
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.: 2*x^4 -x^5*(-3-2*x-2*x^2+2*x^4) / ( 1-x-x^2-x^3+x^5 ).
EXAMPLE
For n=5 the a(5)=3 solutions are (0,0,0,1,1),(1,0,0,1,1) for Abel, (0,1,1,1,1) for Kain.
MAPLE
a(1):=0: a(2):=0: a(3):=0: a(4):=2; a(5):=3:
a(6):=5: a(7):=10: pot:=2^3: ml:=0:
for n from 4 to 7 do
pot:=2*pot:
ml:=ml+n*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):
ml:=ml+n*a(n)/pot:
end do:
printf("10.5f", ml):
seq(a(n), n=0..100);
CROSSREFS
Sequence in context: A339293 A195507 A117222 * A081172 A318301 A030032
KEYWORD
nonn,easy
AUTHOR
Paul Weisenhorn, Nov 12 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 16:52 EDT 2024. Contains 371794 sequences. (Running on oeis4.)