Serving the Quantitative Finance Community

 
User avatar
gbhal
Topic Author
Posts: 1
Joined: May 16th, 2005, 1:41 am

A accumulates more than B

May 28th, 2008, 1:00 pm

Hi all, A and B toss, A goes first, if heads, he gets to continue, if tails, B gets a chance, and so on.....Find the prob that A accumulates x heads before B gets to y heads. Fair coin!
 
User avatar
Zedr0n
Posts: 1
Joined: April 6th, 2007, 5:07 am

A accumulates more than B

May 29th, 2008, 1:11 pm

Do you know if there is a closed-form answer?So far, I get only recurrent equation for p(x,y) where it is the probability that A accumulates x heads before B gets to y heads(I assume in total?).Rearranging, I finally getI also found that p(x,1) = (2/3)^x, p(1,x) = 1 - 0.5(2/3)^x
Last edited by Zedr0n on May 28th, 2008, 10:00 pm, edited 1 time in total.
 
User avatar
twofish
Posts: 0
Joined: February 18th, 2005, 6:51 pm

A accumulates more than B

June 4th, 2008, 8:54 pm

take one turn.The probability that A in one turn wins is \frac{1}{2^x}The probability that B in one turn wins is (1 - \frac{1}{2^{x}} )\frac{1}{2^(y+1)} The probability that someone wins is A+BThis gives you \frac{2^(y+1)}{2^(y+1) + 2^x -1}
 
User avatar
Curves
Posts: 0
Joined: April 4th, 2007, 6:37 am

A accumulates more than B

November 13th, 2008, 12:41 pm

hope i got the algebra correct ...answer:p = 0.5^x, q = 0.5^yprobability of A winning = (1-q)(1-2pq)/q(1-pq)^2probability that A wins in 1st turn = p probability that B wins in 1st turn = q(1-p)probability that A wins in ith turn p_i= p(1-q_i-1) = p(1-q(1-p_i-1)) = p(1-q)+pq.p_i-1p_i - pq.p_i-1 = p(1-q)SUM(i=1,n) p_i - pq.SUM(i=1,n) p_i-1 = np(1-q)say P_i = SUM(i=1,n) p_i = cummulative probability that in n turns A will winP_n - pq.P_n-1 = np(1-q)P_n-1 - pq.P_n-2 = (n-1)p(1-q) multiply equation by pq:::----------------------------------------Sum up all the euqationsP_n - (pq)^n.P_0 = ....Simply algebraHopefully we can match if i am ok.
 
User avatar
quantyst
Posts: 0
Joined: June 4th, 2008, 5:08 am

A accumulates more than B

November 14th, 2008, 11:53 am

QuoteOriginally posted by: gbhalHi all, A and B toss, A goes first, if heads, he gets to continue, if tails, B gets a chance, and so on.....Find the prob that A accumulates x heads before B gets to y heads. Fair coin!My thanks to Curves for reviving this problem.Here's another, simpler and cleaner, recursive relation:Let p(x,y)=P{A=x before B=y} denote the probability that A gets x heads before B gets y heads given that A gets to toss first.Let R denote the result of the first toss made by A. Either R=H with probability 1/2 or R=T with probability 1/2.We will now condition p(x,y) on the first toss R:p(x,y) = (1/2)*P{A=x before B=y | R=H} + (1/2)*P{A=x before B=y | R=T} (***1***)Clearly P{A=x before B=y | R=H} = P{A=(x-1) before B=y} = p(x-1,y). (***2***)It is obvious that if R=T, then B gets to toss. At this point -- as B gets to toss the coin, hence being in the same position as A was just a moment ago -- what is the probability that A gets x heads before B gets y heads? Answer: it is the probability that B does not get y heads before A gets x heads. In other words, the answer is: 1 - P{B=y before A=x}.So, we have P{A=x before B=y | R=T} = 1 - P{B=y before A=x} = 1 - p(y,x). (***3***)Combining (***1***), (***2***), (***3***), we get:p(x,y) = (1/2)*p(x-1,y) + (1/2)*(1 - p(y,x)) (***4***)with initial conditions p(0,y)=1 fro all y in {1,2,3,....} and p(x,0)=0 for all x in {0,1,2,....}.Note that the recursive relation (***4***) agrees with Zedr0n's finding: "p(x,1) = (2/3)^x, p(1,x) = 1 - 0.5(2/3)^x" for x>0.
Last edited by quantyst on November 13th, 2008, 11:00 pm, edited 1 time in total.
 
User avatar
wileysw
Posts: 7
Joined: December 9th, 2006, 6:13 pm

A accumulates more than B

November 15th, 2008, 12:09 am

Curves, your recursion formula p_i= p(1-q_{i-1}) is not correct - that ignores all the heads A already got in the first (i-1) round. note "accumulate" in the original problem.i considered a special case when x=y (following the notation above):where 2F1 is the Gauss hypergeometric function.i kinda went through all the specific values, identities of this function, but did not find anything useful. so i really doubt there would be a closed-form expression (unless you consider hypergeometric function as one, but keep in mind that it's an infinite sum). i think the best you could do is to use quantyst's recursion formula and build your way to particular x and y you are interested.
Last edited by wileysw on November 14th, 2008, 11:00 pm, edited 1 time in total.
 
User avatar
sixthday
Posts: 0
Joined: February 17th, 2008, 10:31 pm

A accumulates more than B

November 20th, 2008, 8:14 pm

Edited: not correct
Last edited by sixthday on November 19th, 2008, 11:00 pm, edited 1 time in total.
 
User avatar
wileysw
Posts: 7
Joined: December 9th, 2006, 6:13 pm

A accumulates more than B

November 20th, 2008, 8:29 pm

sixthday, i was gonna say that you cannot assign balls arbitrarily to A or B, because consecutive heads have to go to one person, but i guess you already noticed it now.i have another approach to this problem:consider an alternative game: let A and B each has his own coin and tosses it consecutively. A stops when he collects x heads, and B stops when he collects y heads. now they compare the number of tails they get. if B has got (strictly) few tails than A, the winner is B; otherwise the winner is A.this is how i got my formula above when x=y. the situation is symmetric except the case when A and B get exactly the same number of tails and heads, in which case, A wins by the rule. so A has a probability advantage ofwhere i is the number of tails, and C_m^n is m chooses n. note the sequences A and B get has to end with head by definition. the sum by definition is the Gauss hypergeometric function (there is a trick to convert it into a sum of finite number of terms, but would not provide more insights).
Last edited by wileysw on November 19th, 2008, 11:00 pm, edited 1 time in total.
 
User avatar
quantyst
Posts: 0
Joined: June 4th, 2008, 5:08 am

A accumulates more than B

November 20th, 2008, 9:05 pm

Consider the case when players A and B get to toss n times BETWEEN the two of them. That is, the number of tosses made by A and the number of tosses made by B together total to n. Let A(n) denote the number of Heads that A has ACCUMULATED when players A and B together have tossed the coin a total of n times. And let B(n) denote the number of Tails that B has ACCUMULATED when players A and B together have tossed the coin a total of n times.ThenA(n)=SUM{X(i-1)*X(i) as i runs from 1 to n}.That is,A(n)=X(0)*X(1)+X(1)*X(2)+X(2)*X(3)+...+X(n-1)*X(n).AndB(n)=SUM{(1-X(i-1))*(1-X(i)) as i runs from 1 to n}. That is,B(n)=(1-X(0))*(1-X(1))+(1-X(1))*(1-X(2))+(1-X(2))*(1-X(3))+...+(1-X(n-1))*(1-X(n)).See A MODEL FOR A accumulates more than B