A fast way to compute the Bi-Variate Probability Generating Function for the\ Number of Heads and Tails Coin Tosses until you reach H heads AND T ta\ ils (and also the case where you reach H heads OR T tails) By Shalosh B. Ekhad Theorem: You toss a coin whose probabilty of Heads is p and probability of T\ ails is 1-p and stop as soon as you have reached your goal of having at least h Heads AND t tails. Let L1(h,t)=L1(h,t,p,x1,x2) be the gene\ rating function whoere coefficient of x1^h1*x2^t1 is the exact probabili\ ty that when you have reached your goal of at least h Heads AND t Tails (of cou\ rse either h1=h or t1=t) Analogously, let L2(h,t)=L2(h,t,p,x1,x2) be the bi-variate prob. generating\ function where you stop as soon as you have reached h Heads OR t Tails Then BOTH of these discrete functions of h and t satisfy the SAME third-orde\ r recurrences 2 2 p x1 (h + t + 1) L(h, t) - -------------------------- + p x1 (h p x1 + h p x2 - h x2 + (t + 1) p x1 (p x2 - x2 + 1) (h + 2) + (t + 1) p x2 + 2 h - (t + 1) x2 + t + 3) L(h + 1, t)/((p x2 - x2 + 1) 2 2 (h + 2)) - (h p x1 x2 - h p x1 x2 + (t + 1) p x1 x2 + 2 h p x1 + h p x2 - (t + 1) p x1 x2 - h x2 + (t + 3) p x1 + 2 p x2 + h - 2 x2 + 2) L(h + 2, t)/((p x2 - x2 + 1) (h + 2)) + L(h + 3, t) = 0 2 2 x2 (p - 1) (h + t + 1) L(h, t) -------------------------------- - x2 (p - 1) (t p x1 + t p x2 - x2 t (p x1 - 1) (t + 2) + (h + 1) p x1 + (h + 1) p x2 - 2 t - (h + 1) x2 - h - 3) L(h, t + 1)/( 2 2 (p x1 - 1) (t + 2)) + (t p x1 x2 - t p x1 x2 + (h + 1) p x1 x2 - t p x1 - 2 t p x2 - (h + 1) p x1 x2 + 2 x2 t - 2 p x1 - (h + 3) p x2 + t + (h + 3) x2 + 2) L(h, t + 2)/((p x1 - 1) (t + 2)) + L(h, t + 3) = 0 subject to the initial conditions, respectively (p - 1) x2 p x1 (p x1 - p x2 + x2 - 2) 2 2 L1(1, 1) = - --------------------------------------, L1(1, 2) = (p - 1) x2 p (p x2 - x2 + 1) (p x1 - 1) 2 2 2 / x1 (p x1 - p x1 x2 + p x1 x2 - 3 p x1 + 2 p x2 - 2 x2 + 3) / ( / 2 3 3 3 3 (p x2 - x2 + 1) (p x1 - 1) ), L1(1, 3) = - (p - 1) x2 p x1 (p x1 3 2 2 2 2 2 2 - p x1 x2 + p x1 x2 - 4 p x1 + 3 p x1 x2 - 3 p x1 x2 + 6 p x1 / 3 2 - 3 p x2 + 3 x2 - 4) / ((p x2 - x2 + 1) (p x1 - 1) ), L1(2, 1) = - p / 2 x1 (p - 1) x2 2 2 2 2 2 (p x1 x2 - p x2 - p x1 x2 + 2 p x2 + 2 p x1 - 3 p x2 - x2 + 3 x2 - 3) / 2 2 2 2 2 / ((p x2 - x2 + 1) (p x1 - 1)), L1(2, 2) = (p - 1) x2 p x1 ( / 3 2 3 2 2 2 2 2 2 2 2 p x1 x2 - 2 p x1 x2 - 2 p x1 x2 + 4 p x1 x2 + 3 p x1 2 2 2 2 2 - 8 p x1 x2 + 3 p x2 - 2 p x1 x2 + 8 p x1 x2 - 6 p x2 - 8 p x1 2 / 2 2 + 8 p x2 + 3 x2 - 8 x2 + 6) / ((p x2 - x2 + 1) (p x1 - 1) ), L1(2, 3) / 3 3 2 2 4 3 4 2 2 3 3 = - (p - 1) x2 p x1 (3 p x1 x2 - 3 p x1 x2 - 3 p x1 x2 3 2 2 3 3 3 2 3 2 2 2 2 + 6 p x1 x2 + 4 p x1 - 15 p x1 x2 + 8 p x1 x2 - 3 p x1 x2 2 2 2 2 2 2 2 2 2 + 15 p x1 x2 - 16 p x1 x2 - 15 p x1 + 25 p x1 x2 - 6 p x2 2 2 2 + 8 p x1 x2 - 25 p x1 x2 + 12 p x2 + 20 p x1 - 15 p x2 - 6 x2 + 15 x2 / 2 3 3 3 - 10) / ((p x2 - x2 + 1) (p x1 - 1) ), L1(3, 1) = - p x1 (p - 1) x2 ( / 3 2 3 3 2 2 2 3 2 2 2 p x1 x2 - p x2 - 2 p x1 x2 + 3 p x2 + 3 p x1 x2 - 4 p x2 2 3 2 3 2 + p x1 x2 - 3 p x2 - 3 p x1 x2 + 8 p x2 + x2 + 3 p x1 - 6 p x2 - 4 x2 / 3 2 2 3 + 6 x2 - 4) / ((p x2 - x2 + 1) (p x1 - 1)), L1(3, 2) = (p - 1) x2 p / 3 4 2 2 4 3 3 2 2 3 3 3 2 x1 (3 p x1 x2 - 3 p x1 x2 - 6 p x1 x2 + 9 p x1 x2 + 8 p x1 x2 3 2 3 3 2 2 2 2 3 2 2 - 15 p x1 x2 + 4 p x2 + 3 p x1 x2 - 9 p x1 x2 - 8 p x1 x2 2 2 2 3 3 2 2 2 + 30 p x1 x2 - 12 p x2 + 3 p x1 x2 + 6 p x1 - 25 p x1 x2 2 2 2 3 2 3 + 15 p x2 - 15 p x1 x2 + 12 p x2 + 25 p x1 x2 - 30 p x2 - 4 x2 2 / 3 - 15 p x1 + 20 p x2 + 15 x2 - 20 x2 + 10) / ((p x2 - x2 + 1) / 2 3 3 3 3 5 3 2 5 2 3 (p x1 - 1) ), L1(3, 3) = - (p - 1) x2 p x1 (6 p x1 x2 - 6 p x1 x2 4 3 2 4 2 3 4 3 4 2 2 - 12 p x1 x2 + 18 p x1 x2 + 15 p x1 x2 - 36 p x1 x2 4 3 3 3 2 3 2 3 3 3 + 15 p x1 x2 + 6 p x1 x2 - 18 p x1 x2 - 15 p x1 x2 3 2 2 3 3 2 2 3 3 3 3 2 + 72 p x1 x2 - 45 p x1 x2 + 6 p x1 x2 + 10 p x1 - 63 p x1 x2 3 2 3 3 2 2 2 2 3 2 2 + 63 p x1 x2 - 10 p x2 - 36 p x1 x2 + 45 p x1 x2 + 63 p x1 x2 2 2 2 3 3 2 2 2 - 126 p x1 x2 + 30 p x2 - 15 p x1 x2 - 36 p x1 + 90 p x1 x2 2 2 2 3 2 3 - 36 p x2 + 63 p x1 x2 - 30 p x2 - 90 p x1 x2 + 72 p x2 + 10 x2 2 / 3 + 45 p x1 - 45 p x2 - 36 x2 + 45 x2 - 20) / ((p x2 - x2 + 1) / 3 (p x1 - 1) ) 2 2 L2(1, 1) = (1 - p) x2 + p x1, L2(1, 2) = (1 - p) x2 + p x1 + p x1 (1 - p) x2, 3 3 2 2 L2(1, 3) = (1 - p) x2 + p x1 + p x1 (1 - p) x2 + p x1 (1 - p) x2 , 2 2 L2(2, 1) = (1 - p) x2 + p x1 (1 - p) x2 + p x1 , L2(2, 2) = 2 2 2 2 2 2 2 2 (1 - p) x2 + 2 p x1 (1 - p) x2 + p x1 + 2 p x1 (1 - p) x2, L2(2, 3) 3 3 3 3 2 2 2 2 = (1 - p) x2 + 3 p x1 (1 - p) x2 + p x1 + 2 p x1 (1 - p) x2 2 2 2 2 + 3 p x1 (1 - p) x2 , 2 2 3 3 L2(3, 1) = (1 - p) x2 + p x1 (1 - p) x2 + p x1 (1 - p) x2 + p x1 , 2 2 2 2 2 2 2 2 L2(3, 2) = (1 - p) x2 + 2 p x1 (1 - p) x2 + 3 p x1 (1 - p) x2 3 3 3 3 3 3 + p x1 + 3 p x1 (1 - p) x2, L2(3, 3) = (1 - p) x2 3 3 2 2 3 3 3 3 + 3 p x1 (1 - p) x2 + 6 p x1 (1 - p) x2 + p x1 3 3 3 3 2 2 + 3 p x1 (1 - p) x2 + 6 p x1 (1 - p) x2 and in Maple notation -p^2*x1^2*(h+t+1)/(p*x2-x2+1)/(h+2)*L(h,t)+p*x1*(h*p*x1+h*p*x2-h*x2+(t+1)*p*x1+ (t+1)*p*x2+2*h-(t+1)*x2+t+3)/(p*x2-x2+1)/(h+2)*L(h+1,t)-(h*p^2*x1*x2-h*p*x1*x2+ (t+1)*p^2*x1*x2+2*h*p*x1+h*p*x2-(t+1)*p*x1*x2-h*x2+(t+3)*p*x1+2*p*x2+h-2*x2+2)/ (p*x2-x2+1)/(h+2)*L(h+2,t)+L(h+3,t) = 0 x2^2*(p-1)^2*(h+t+1)/(p*x1-1)/(t+2)*L(h,t)-x2*(p-1)*(t*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2+30*p^2*x2^3-15*p*x1*x2^3-36*p^ 2*x1^2+90*p^2*x1*x2-36*p^2*x2^2+63*p*x1*x2^2-30*p*x2^3-90*p*x1*x2+72*p*x2^2+10* x2^3+45*p*x1-45*p*x2-36*x2^2+45*x2-20)/(p*x2-x2+1)^3/(p*x1-1)^3 L2(1,1) = (1-p)*x2+p*x1, L2(1,2) = (1-p)^2*x2^2+p*x1+p*x1*(1-p)*x2, L2(1,3) = ( 1-p)^3*x2^3+p*x1+p*x1*(1-p)*x2+p*x1*(1-p)^2*x2^2, L2(2,1) = (1-p)*x2+p*x1*(1-p) *x2+p^2*x1^2, L2(2,2) = (1-p)^2*x2^2+2*p*x1*(1-p)^2*x2^2+p^2*x1^2+2*p^2*x1^2*(1 -p)*x2, L2(2,3) = (1-p)^3*x2^3+3*p*x1*(1-p)^3*x2^3+p^2*x1^2+2*p^2*x1^2*(1-p)*x2 +3*p^2*x1^2*(1-p)^2*x2^2, L2(3,1) = (1-p)*x2+p*x1*(1-p)*x2+p^2*x1^2*(1-p)*x2+p^ 3*x1^3, L2(3,2) = (1-p)^2*x2^2+2*p*x1*(1-p)^2*x2^2+3*p^2*x1^2*(1-p)^2*x2^2+p^3* x1^3+3*p^3*x1^3*(1-p)*x2, L2(3,3) = (1-p)^3*x2^3+3*p*x1*(1-p)^3*x2^3+6*p^2*x1^2 *(1-p)^3*x2^3+p^3*x1^3+3*p^3*x1^3*(1-p)*x2+6*p^3*x1^3*(1-p)^2*x2^2 These recurrences enable very fast compuations of the expected number of the\ se bi-variate prob. gen. functions and deducing relevant statistics. Chapter I Let's illustrate it with p=1/2 and (m,n)=(50*i,50*i) for i from 1 to, 6 if the goal is , 50, Heads OR , 50, Tails (you are happy once you have one of them) The expected number of Heads is, 46.02053813, and the standard-deviation is , 30.18442136 The expected number of Tails is, 46.02053813, and the standard-deviation is , 30.18442136 of course they are the same by symmetry The skewness and kurtosis of the number of Heads are, -1.413810762, 4.359607124, respectively The skewness and kurtosis of the number of Tails are, -1.413810762, 4.359607124, respectively of course they are the same by symmetry More interesting is the coefficient of correlation that is , -0.5246453652 On the other hand if the goal is (at least) , 50, Heads AND (at least), 50, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 53.97946187, and the standard-deviation is , 38.14334510 The expected number of Tails is, 53.97946187, and the standard-deviation is , 38.14334510 of course they are the same by symmetry The skewness and kurtosis of the number of Heads are, 1.865404311, 6.603194947, respectively The skewness and kurtosis of the number of Tails are, 1.865404311, 6.603194947, respectively of course they are the same by symmetry More interesting is the coefficient of correlation that is , -0.4151737801 if the goal is , 100, Heads OR , 100, Tails (you are happy once you have one of them) The expected number of Heads is, 94.36515210, and the standard-deviation is , 62.61364123 The expected number of Tails is, 94.36515210, and the standard-deviation is , 62.61364123 of course they are the same by symmetry The skewness and kurtosis of the number of Heads are, -1.480406987, 4.651086362, respectively The skewness and kurtosis of the number of Tails are, -1.480406987, 4.651086362, respectively of course they are the same by symmetry More interesting is the coefficient of correlation that is , -0.5071021305 On the other hand if the goal is (at least) , 100, Heads AND (at least), 100, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 105.6348479, and the standard-deviation is , 73.88333703 The expected number of Tails is, 105.6348479, and the standard-deviation is , 73.88333703 of course they are the same by symmetry The skewness and kurtosis of the number of Heads are, 1.799753605, 6.237979654, respectively The skewness and kurtosis of the number of Tails are, 1.799753605, 6.237979654, respectively of course they are the same by symmetry More interesting is the coefficient of correlation that is , -0.4297519866 if the goal is , 150, Heads OR , 150, Tails (you are happy once you have one of them) The expected number of Heads is, 143.0958728, and the standard-deviation is , 95.42890096 The expected number of Tails is, 143.0958728, and the standard-deviation is , 95.42890096 of course they are the same by symmetry The skewness and kurtosis of the number of Heads are, -1.509863860, 4.784330359, respectively The skewness and kurtosis of the number of Tails are, -1.509863860, 4.784330359, respectively of course they are the same by symmetry More interesting is the coefficient of correlation that is , -0.4995024715 On the other hand if the goal is (at least) , 150, Heads AND (at least), 150, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 156.9041272, and the standard-deviation is , 109.2371553 The expected number of Tails is, 156.9041272, and the standard-deviation is , 109.2371553 of course they are the same by symmetry The skewness and kurtosis of the number of Heads are, 1.770615385, 6.080145515, respectively The skewness and kurtosis of the number of Tails are, 1.770615385, 6.080145515, respectively of course they are the same by symmetry More interesting is the coefficient of correlation that is , -0.4363622593 if the goal is , 200, Heads OR , 200, Tails (you are happy once you have one of them) The expected number of Heads is, 192.0261396, and the standard-deviation is , 128.4436900 The expected number of Tails is, 192.0261396, and the standard-deviation is , 128.4436900 of course they are the same by symmetry The skewness and kurtosis of the number of Heads are, -1.527409557, 4.864958186, respectively The skewness and kurtosis of the number of Tails are, -1.527409557, 4.864958186, respectively of course they are the same by symmetry More interesting is the coefficient of correlation that is , -0.4950219784 On the other hand if the goal is (at least) , 200, Heads AND (at least), 200, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 207.9738604, and the standard-deviation is , 144.3914108 The expected number of Tails is, 207.9738604, and the standard-deviation is , 144.3914108 of course they are the same by symmetry The skewness and kurtosis of the number of Heads are, 1.753229675, 5.987220477, respectively The skewness and kurtosis of the number of Tails are, 1.753229675, 5.987220477, respectively of course they are the same by symmetry More interesting is the coefficient of correlation that is , -0.4403478656 if the goal is , 250, Heads OR , 250, Tails (you are happy once you have one of them) The expected number of Heads is, 241.0838386, and the standard-deviation is , 161.5859047 The expected number of Tails is, 241.0838386, and the standard-deviation is , 161.5859047 of course they are the same by symmetry The skewness and kurtosis of the number of Heads are, -1.539377170, 4.920494454, respectively The skewness and kurtosis of the number of Tails are, -1.539377170, 4.920494454, respectively of course they are the same by symmetry More interesting is the coefficient of correlation that is , -0.4919855729 On the other hand if the goal is (at least) , 250, Heads AND (at least), 250, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 258.9161614, and the standard-deviation is , 179.4182275 The expected number of Tails is, 258.9161614, and the standard-deviation is , 179.4182275 of course they are the same by symmetry The skewness and kurtosis of the number of Heads are, 1.741358265, 5.924305197, respectively The skewness and kurtosis of the number of Tails are, 1.741358265, 5.924305197, respectively of course they are the same by symmetry More interesting is the coefficient of correlation that is , -0.4430872772 if the goal is , 300, Heads OR , 300, Tails (you are happy once you have one of them) The expected number of Heads is, 290.2320206, and the standard-deviation is , 194.8185990 The expected number of Tails is, 290.2320206, and the standard-deviation is , 194.8185990 of course they are the same by symmetry The skewness and kurtosis of the number of Heads are, -1.548208055, 4.961756387, respectively The skewness and kurtosis of the number of Tails are, -1.548208055, 4.961756387, respectively of course they are the same by symmetry More interesting is the coefficient of correlation that is , -0.4897551981 On the other hand if the goal is (at least) , 300, Heads AND (at least), 300, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 309.7679794, and the standard-deviation is , 214.3545578 The expected number of Tails is, 309.7679794, and the standard-deviation is , 214.3545578 of course they are the same by symmetry The skewness and kurtosis of the number of Heads are, 1.732591606, 5.878123639, respectively The skewness and kurtosis of the number of Tails are, 1.732591606, 5.878123639, respectively of course they are the same by symmetry More interesting is the coefficient of correlation that is , -0.4451196305 -------------------------------------------- Chapter II Let's illustrate it with p=1/3 and (m,n)=(20*i,40*i) for i from 1 to, 6 if the goal is , 20, Heads OR , 40, Tails (you are happy once you have one of them) The expected number of Heads is, 17.82549854, and the standard-deviation is , 33.84851177 The expected number of Tails is, 35.65099708, and the standard-deviation is , 8.819206678 Note that the ratio of the expectations is, 2.000000000 The skewness and kurtosis of the number of Heads are, -9.777232381, 57.40499013, respectively The skewness and kurtosis of the number of Tails are, -0.1805758270, 0.2797534629, respectively More interesting is the coefficient of correlation that is , -0.5473496605 On the other hand if the goal is (at least) , 20, Heads AND (at least), 40, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 22.17450146, and the standard-deviation is , 48.32383547 The expected number of Tails is, 44.34900292, and the standard-deviation is , 11.72388013 Note that the ratio of the expectations is, 2.000000000 The skewness and kurtosis of the number of Heads are, 16.62096695, 124.2135835, respectively The skewness and kurtosis of the number of Tails are, 0.2280627597, 0.4030775275, respectively More interesting is the coefficient of correlation that is , -0.3973132233 if the goal is , 40, Heads OR , 80, Tails (you are happy once you have one of them) The expected number of Heads is, 36.91730801, and the standard-deviation is , 71.71999031 The expected number of Tails is, 73.83461601, and the standard-deviation is , 18.43998456 Note that the ratio of the expectations is, 2.000000000 The skewness and kurtosis of the number of Heads are, -10.73216504, 65.02769688, respectively The skewness and kurtosis of the number of Tails are, -0.1880337869, 0.2962162731, respectively More interesting is the coefficient of correlation that is , -0.5226246352 On the other hand if the goal is (at least) , 40, Heads AND (at least), 80, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 43.08269199, and the standard-deviation is , 92.25609021 The expected number of Tails is, 86.16538399, and the standard-deviation is , 22.55403557 Note that the ratio of the expectations is, 2.000000000 The skewness and kurtosis of the number of Heads are, 15.59106590, 112.3250584, respectively The skewness and kurtosis of the number of Tails are, 0.2213705271, 0.3831712426, respectively More interesting is the coefficient of correlation that is , -0.4166588509 if the goal is , 60, Heads OR , 120, Tails (you are happy once you have one of them) The expected number of Heads is, 56.22142881, and the standard-deviation is , 110.3005700 The expected number of Tails is, 112.4428576, and the standard-deviation is , 28.20180027 Note that the ratio of the expectations is, 2.000000000 The skewness and kurtosis of the number of Heads are, -11.16286154, 68.64366015, respectively The skewness and kurtosis of the number of Tails are, -0.1912495072, 0.3036555987, respectively More interesting is the coefficient of correlation that is , -0.5119858029 On the other hand if the goal is (at least) , 60, Heads AND (at least), 120, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 63.77857119, and the standard-deviation is , 135.4786282 The expected number of Tails is, 127.5571424, and the standard-deviation is , 33.24299929 Note that the ratio of the expectations is, 2.000000000 The skewness and kurtosis of the number of Heads are, 15.13553527, 107.2777608, respectively The skewness and kurtosis of the number of Tails are, 0.2184034208, 0.3745865210, respectively More interesting is the coefficient of correlation that is , -0.4255001501 if the goal is , 80, Heads OR , 160, Tails (you are happy once you have one of them) The expected number of Heads is, 75.63511403, and the standard-deviation is , 149.2468430 The expected number of Tails is, 151.2702281, and the standard-deviation is , 38.03650115 Note that the ratio of the expectations is, 2.000000001 The skewness and kurtosis of the number of Heads are, -11.42161417, 70.86942578, respectively The skewness and kurtosis of the number of Tails are, -0.1931441440, 0.3081355556, respectively More interesting is the coefficient of correlation that is , -0.5057349229 On the other hand if the goal is (at least) , 80, Heads AND (at least), 160, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 84.36488597, and the standard-deviation is , 178.3353204 The expected number of Tails is, 168.7297719, and the standard-deviation is , 43.85903971 Note that the ratio of the expectations is, 2.000000000 The skewness and kurtosis of the number of Heads are, 14.86439594, 104.3345473, respectively The skewness and kurtosis of the number of Tails are, 0.2166318498, 0.3695343153, respectively More interesting is the coefficient of correlation that is , -0.4308514501 if the goal is , 100, Heads OR , 200, Tails (you are happy once you have one of them) The expected number of Heads is, 95.11872286, and the standard-deviation is , 188.4264257 The expected number of Tails is, 190.2374457, and the standard-deviation is , 47.91774482 Note that the ratio of the expectations is, 2.000000000 The skewness and kurtosis of the number of Heads are, -11.59900469, 72.41851431, respectively The skewness and kurtosis of the number of Tails are, -0.1944282754, 0.3112128111, respectively More interesting is the coefficient of correlation that is , -0.5015079678 On the other hand if the goal is (at least) , 100, Heads AND (at least), 200, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 104.8812771, and the standard-deviation is , 220.9586421 The expected number of Tails is, 209.7625543, and the standard-deviation is , 54.42852215 Note that the ratio of the expectations is, 2.000000001 The skewness and kurtosis of the number of Heads are, 14.67958328, 102.3544177, respectively The skewness and kurtosis of the number of Tails are, 0.2154211609, 0.3661138536, respectively More interesting is the coefficient of correlation that is , -0.4345383990 if the goal is , 120, Heads OR , 240, Tails (you are happy once you have one of them) The expected number of Heads is, 114.6519623, and the standard-deviation is , 227.7715762 The expected number of Tails is, 229.3039246, and the standard-deviation is , 57.83203489 Note that the ratio of the expectations is, 2.000000000 The skewness and kurtosis of the number of Heads are, -11.73035255, 73.57770007, respectively The skewness and kurtosis of the number of Tails are, -0.1953718281, 0.3134949469, respectively More interesting is the coefficient of correlation that is , -0.4984078979 On the other hand if the goal is (at least) , 120, Heads AND (at least), 240, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 125.3480377, and the standard-deviation is , 263.4163657 The expected number of Tails is, 250.6960754, and the standard-deviation is , 64.96495061 Note that the ratio of the expectations is, 2.000000000 The skewness and kurtosis of the number of Heads are, 14.54329148, 100.9076323, respectively The skewness and kurtosis of the number of Tails are, 0.2145264047, 0.3636029729, respectively More interesting is the coefficient of correlation that is , -0.4372783575 -------------------------------------------- Chapter III Let's illustrate it with p=1/4 and (m,n)=(20*i,60*i) for i from 1 to, 6 if the goal is , 20, Heads OR , 60, Tails (you are happy once you have one of them) The expected number of Heads is, 17.94914843, and the standard-deviation is , 67.81655280 The expected number of Tails is, 53.84744530, and the standard-deviation is , 7.985041079 Note that the ratio of the expectations is, 3.000000001 The skewness and kurtosis of the number of Heads are, -32.30366782, 282.5209708, respectively The skewness and kurtosis of the number of Tails are, -0.05605641479, 0.05882021102, respectively More interesting is the coefficient of correlation that is , -0.5422296726 On the other hand if the goal is (at least) , 20, Heads AND (at least), 40, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 22.05085157, and the standard-deviation is , 96.47558852 The expected number of Tails is, 66.15255470, and the standard-deviation is , 10.26964129 Note that the ratio of the expectations is, 3.000000000 The skewness and kurtosis of the number of Heads are, 57.12241672, 644.0220456, respectively The skewness and kurtosis of the number of Tails are, 0.06510579772, 0.07538147211, respectively More interesting is the coefficient of correlation that is , -0.4008698160 if the goal is , 40, Heads OR , 120, Tails (you are happy once you have one of them) The expected number of Heads is, 37.09310550, and the standard-deviation is , 143.6202092 The expected number of Tails is, 111.2793165, and the standard-deviation is , 16.59960168 Note that the ratio of the expectations is, 3.000000000 The skewness and kurtosis of the number of Heads are, -35.68701728, 322.8050205, respectively The skewness and kurtosis of the number of Tails are, -0.05751681460, 0.06111124460, respectively More interesting is the coefficient of correlation that is , -0.5191862532 On the other hand if the goal is (at least) , 40, Heads AND (at least), 80, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 42.90689450, and the standard-deviation is , 184.2791492 The expected number of Tails is, 128.7206835, and the standard-deviation is , 19.83366036 Note that the ratio of the expectations is, 3.000000000 The skewness and kurtosis of the number of Heads are, 53.32133825, 578.6365051, respectively The skewness and kurtosis of the number of Tails are, 0.06383239376, 0.07275237090, respectively More interesting is the coefficient of correlation that is , -0.4193148670 if the goal is , 60, Heads OR , 180, Tails (you are happy once you have one of them) The expected number of Heads is, 56.43711658, and the standard-deviation is , 220.8279398 The expected number of Tails is, 169.3113497, and the standard-deviation is , 25.32477443 Note that the ratio of the expectations is, 2.999999999 The skewness and kurtosis of the number of Heads are, -37.22367860, 342.0310142, respectively The skewness and kurtosis of the number of Tails are, -0.05813722800, 0.06213202286, respectively More interesting is the coefficient of correlation that is , -0.5092425413 On the other hand if the goal is (at least) , 60, Heads AND (at least), 120, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 63.56288342, and the standard-deviation is , 270.6775709 The expected number of Tails is, 190.6886503, and the standard-deviation is , 29.28694898 Note that the ratio of the expectations is, 3.000000001 The skewness and kurtosis of the number of Heads are, 51.64535128, 550.9764977, respectively The skewness and kurtosis of the number of Tails are, 0.06327138028, 0.07161810898, respectively More interesting is the coefficient of correlation that is , -0.4277216952 if the goal is , 80, Heads OR , 240, Tails (you are happy once you have one of them) The expected number of Heads is, 75.88438880, and the standard-deviation is , 298.7597417 The expected number of Tails is, 227.6531664, and the standard-deviation is , 34.10714706 Note that the ratio of the expectations is, 3.000000000 The skewness and kurtosis of the number of Heads are, -38.14984481, 353.8996846, respectively The skewness and kurtosis of the number of Tails are, -0.05850058333, 0.06274310170, respectively More interesting is the coefficient of correlation that is , -0.5033918748 On the other hand if the goal is (at least) , 80, Heads AND (at least), 160, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 84.11561120, and the standard-deviation is , 356.3516580 The expected number of Tails is, 252.3468336, and the standard-deviation is , 38.68300846 Note that the ratio of the expectations is, 3.000000000 The skewness and kurtosis of the number of Heads are, 50.64950999, 534.8781312, respectively The skewness and kurtosis of the number of Tails are, 0.06293717709, 0.07095013780, respectively More interesting is the coefficient of correlation that is , -0.4328031599 if the goal is , 100, Heads OR , 300, Tails (you are happy once you have one of them) The expected number of Heads is, 95.39756818, and the standard-deviation is , 377.1534889 The expected number of Tails is, 286.1927045, and the standard-deviation is , 42.92605698 Note that the ratio of the expectations is, 3.000000000 The skewness and kurtosis of the number of Heads are, -38.78602944, 362.1748102, respectively The skewness and kurtosis of the number of Tails are, -0.05874603536, 0.06316141686, respectively More interesting is the coefficient of correlation that is , -0.4994320619 On the other hand if the goal is (at least) , 100, Heads AND (at least), 200, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 104.6024318, and the standard-deviation is , 441.5636947 The expected number of Tails is, 313.8072955, and the standard-deviation is , 48.04251897 Note that the ratio of the expectations is, 3.000000001 The skewness and kurtosis of the number of Heads are, 49.97151687, 524.0611075, respectively The skewness and kurtosis of the number of Tails are, 0.06270904139, 0.07049763889, respectively More interesting is the coefficient of correlation that is , -0.4363012106 if the goal is , 120, Heads OR , 360, Tails (you are happy once you have one of them) The expected number of Heads is, 114.9575299, and the standard-deviation is , 455.8750517 The expected number of Tails is, 344.8725897, and the standard-deviation is , 51.77091359 Note that the ratio of the expectations is, 3.000000000 The skewness and kurtosis of the number of Heads are, -39.25772369, 368.3748011, respectively The skewness and kurtosis of the number of Tails are, -0.05892599948, 0.06347094185, respectively More interesting is the coefficient of correlation that is , -0.4965261096 On the other hand if the goal is (at least) , 120, Heads AND (at least), 240, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 125.0424701, and the standard-deviation is , 526.4478635 The expected number of Tails is, 375.1274103, and the standard-deviation is , 57.37607699 Note that the ratio of the expectations is, 3.000000000 The skewness and kurtosis of the number of Heads are, 49.47194893, 516.1648132, respectively The skewness and kurtosis of the number of Tails are, 0.06254054857, 0.07016530455, respectively More interesting is the coefficient of correlation that is , -0.4388992199 Chapter IV Let's illustrate it with p=2/5 and (m,n)=(20*i,30*i) for i from 1 to, 6 if the goal is , 20, Heads OR , 30, Tails (you are happy once you have one of them) The expected number of Heads is, 17.70882894, and the standard-deviation is , 21.11108427 The expected number of Tails is, 26.56324342, and the standard-deviation is , 9.633081163 Note that the ratio of the expectations is, 1.500000001 The skewness and kurtosis of the number of Heads are, -4.199906324, 18.60320848, respectively The skewness and kurtosis of the number of Tails are, -0.4100907950, 0.8351868405, respectively More interesting is the coefficient of correlation that is , -0.5521644071 On the other hand if the goal is (at least) , 20, Heads AND (at least), 30, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 22.29117106, and the standard-deviation is , 30.26632408 The expected number of Tails is, 33.43675658, and the standard-deviation is , 13.20132255 Note that the ratio of the expectations is, 1.500000000 The skewness and kurtosis of the number of Heads are, 6.904537584, 38.51529908, respectively The skewness and kurtosis of the number of Tails are, 0.5587043434, 1.337478291, respectively More interesting is the coefficient of correlation that is , -0.3939287949 if the goal is , 40, Heads OR , 60, Tails (you are happy once you have one of them) The expected number of Heads is, 36.75123420, and the standard-deviation is , 44.75824887 The expected number of Tails is, 55.12685130, and the standard-deviation is , 20.25054350 Note that the ratio of the expectations is, 1.500000000 The skewness and kurtosis of the number of Heads are, -4.585329960, 20.92109106, respectively The skewness and kurtosis of the number of Tails are, -0.4329200883, 0.8998593566, respectively More interesting is the coefficient of correlation that is , -0.5258636883 On the other hand if the goal is (at least) , 40, Heads AND (at least), 60, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 43.24876580, and the standard-deviation is , 57.74659463 The expected number of Tails is, 64.87314870, and the standard-deviation is , 25.30716472 Note that the ratio of the expectations is, 1.500000000 The skewness and kurtosis of the number of Heads are, 6.503553600, 35.01871428, respectively The skewness and kurtosis of the number of Tails are, 0.5375872659, 1.254615555, respectively More interesting is the coefficient of correlation that is , -0.4141361415 if the goal is , 60, Heads OR , 90, Tails (you are happy once you have one of them) The expected number of Heads is, 56.01758939, and the standard-deviation is , 68.85383938 The expected number of Tails is, 84.02638409, and the standard-deviation is , 31.04175409 Note that the ratio of the expectations is, 1.500000000 The skewness and kurtosis of the number of Heads are, -4.757996521, 22.01465595, respectively The skewness and kurtosis of the number of Tails are, -0.4428616661, 0.9294408162, respectively More interesting is the coefficient of correlation that is , -0.5145719674 On the other hand if the goal is (at least) , 60, Heads AND (at least), 90, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 63.98241061, and the standard-deviation is , 84.77798649 The expected number of Tails is, 95.97361591, and the standard-deviation is , 37.23905740 Note that the ratio of the expectations is, 1.500000000 The skewness and kurtosis of the number of Heads are, 6.325801872, 33.53031036, respectively The skewness and kurtosis of the number of Tails are, 0.5282085708, 1.218985476, respectively More interesting is the coefficient of correlation that is , -0.4233917998 if the goal is , 80, Heads OR , 120, Tails (you are happy once you have one of them) The expected number of Heads is, 75.39948544, and the standard-deviation is , 93.18070069 The expected number of Tails is, 113.0992282, and the standard-deviation is , 41.92269587 Note that the ratio of the expectations is, 1.500000001 The skewness and kurtosis of the number of Heads are, -4.861414322, 22.68606873, respectively The skewness and kurtosis of the number of Tails are, -0.4487433474, 0.9473501470, respectively More interesting is the coefficient of correlation that is , -0.5079447679 On the other hand if the goal is (at least) , 80, Heads AND (at least), 120, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 84.60051456, and the standard-deviation is , 111.5779953 The expected number of Tails is, 126.9007718, and the standard-deviation is , 49.08116902 Note that the ratio of the expectations is, 1.500000000 The skewness and kurtosis of the number of Heads are, 6.219861078, 32.66111147, respectively The skewness and kurtosis of the number of Tails are, 0.5226068611, 1.198054615, respectively More interesting is the coefficient of correlation that is , -0.4290000591 if the goal is , 100, Heads OR , 150, Tails (you are happy once you have one of them) The expected number of Heads is, 94.85511087, and the standard-deviation is , 117.6551140 The expected number of Tails is, 142.2826663, and the standard-deviation is , 52.86092139 Note that the ratio of the expectations is, 1.500000000 The skewness and kurtosis of the number of Heads are, -4.932183306, 23.15262760, respectively The skewness and kurtosis of the number of Tails are, -0.4527392517, 0.9596909255, respectively More interesting is the coefficient of correlation that is , -0.5034664442 On the other hand if the goal is (at least) , 100, Heads AND (at least), 150, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 105.1448891, and the standard-deviation is , 138.2304074 The expected number of Tails is, 157.7173337, and the standard-deviation is , 60.86597700 Note that the ratio of the expectations is, 1.500000000 The skewness and kurtosis of the number of Heads are, 6.147584638, 32.07576323, respectively The skewness and kurtosis of the number of Tails are, 0.5187784697, 1.183901808, respectively More interesting is the coefficient of correlation that is , -0.4328667293 if the goal is , 120, Heads OR , 180, Tails (you are happy once you have one of them) The expected number of Heads is, 114.3630648, and the standard-deviation is , 142.2342383 The expected number of Tails is, 171.5445971, and the standard-deviation is , 63.83981286 Note that the ratio of the expectations is, 1.499999999 The skewness and kurtosis of the number of Heads are, -4.984517947, 23.50137617, respectively The skewness and kurtosis of the number of Tails are, -0.4556799635, 0.9688626494, respectively More interesting is the coefficient of correlation that is , -0.5001836289 On the other hand if the goal is (at least) , 120, Heads AND (at least), 180, Tails (you are only happy once you have BOTH goals The expected number of Heads is, 125.6369352, and the standard-deviation is , 164.7780861 The expected number of Tails is, 188.4554029, and the standard-deviation is , 72.61010911 Note that the ratio of the expectations is, 1.500000001 The skewness and kurtosis of the number of Heads are, 6.094247686, 31.64777262, respectively The skewness and kurtosis of the number of Tails are, 0.5159492378, 1.173522436, respectively More interesting is the coefficient of correlation that is , -0.4357416561 This ends this paper that took, 28593.222, seconds to generate. --------------------------------------- This took, 28593.222, seconds.