Alex flips a fair coin 20 times. Bert spins a fair coin 20 + n times, with n ≥ 1. Bert wins if he gets more heads than Alex, else Alex wins. Note that Alex wins if there is a tie. What is the probability (in terms of n) that Bert wins?
The tables below represent the following formula:
Sigma{a=0 to 20}Sigma{b=a+1 to 20+n}C(20,a)*C(20+n,b)/2^(40+n)
I haven't tried simplifying it into other than Sigma notation.
10 for N=0 to 15
15 Pawin=0:Pbwin=0
20 for A=0 to 20
25 Pa=combi(20,A)//2^20
30 for B=0 to 20+N
35 Pb=combi(20+N,B)//2^(20+N)
40 if B>A then Pbwin=Pbwin+Pa*Pb:else Pawin=Pawin+Pa*Pb
45 next B
50 next A
55 print N,Pbwin,Pbwin+Pawin
60 next N
finds
n prob(bert wins) sum of probs (Alex+Bert)
0 240416274739/549755813888 1
1 1/2 1
2 617038048193/1099511627776 1
3 1362523998241/2199023255552 1
4 2965189726037/4398046511104 1
5 12741278579183/17592186044416 1
6 27067492573429/35184372088832 1
7 56939101650431/70368744177664 1
8 118759443140415/140737488355328 1
9 122943363002889/140737488355328 1
10 63239026960593/70368744177664 1
11 258847259372867/281474976710656 1
12 527386413199129/562949953421312 1
13 8564177239080199/9007199254740992 1
14 17330709486596433/18014398509481984 1
15 34982806339532451/36028797018963968 1
The last column was just a check that both added to 1.
In decimal notation:
0 0.4373146561902103712 1
1 0.5 1
2 0.5611928356238422566 1
3 0.619604178719328047 1
4 0.6742060863955430249 1
5 0.7242578350987400881 1
6 0.7693044089316174449 1
7 0.8091533011683935683 1
8 0.8438365962633653794 1
9 0.8735651349161983603 1
10 0.8986806244677296717 1
11 0.9196101990940057646 1
12 0.9368264620930393249 1
13 0.9508146757797540926 1
14 0.9620476352554492849 1
15 0.970967926603795467 1
The following simulation verifies this for n=5:
10 for Trial=1 to 1000000
20 A=0
30 for I=1 to 20:A=A+int(rnd*2):next I
40 B=0
50 for I=1 to 25:B=B+int(rnd*2):next
60 if B>A then inc Bwin
70 next
80 print Bwin/1000000
finding
0.725066
for its million trials.
Modified for n=10 it finds 0.898571.
|
Posted by Charlie
on 2012-10-09 13:55:39 |