Results 1 to 5 of 5
Like Tree1Thanks
  • 1 Post By awkward

Math Help - Consecutive Heads/Tails in weighted coin toss

  1. #1
    Newbie
    Joined
    Sep 2008
    Posts
    1

    Arrow Consecutive Heads/Tails in weighted coin toss

    Hi,

    Can someone please help with this. I keep getting different answers to this from different people.

    Supposing you have a weighted coin which lands heads up 70% of the time and tails up 30% of the time.

    Q. What is the probability that it lands on tails 20 or more times in a row if I did this 1000 times?

    *Also could I have the equation on how you worked this out so that I can change the weighting, number of trials etc (I need to know this for my business!!!)

    Thank you very much.

    Zak
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    Joined
    Mar 2008
    Posts
    934
    Thanks
    33
    Awards
    1
    Quote Originally Posted by slyone View Post
    Hi,

    Can someone please help with this. I keep getting different answers to this from different people.

    Supposing you have a weighted coin which lands heads up 70% of the time and tails up 30% of the time.

    Q. What is the probability that it lands on tails 20 or more times in a row if I did this 1000 times?

    *Also could I have the equation on how you worked this out so that I can change the weighting, number of trials etc (I need to know this for my business!!!)

    Thank you very much.

    Zak
    Hi Zak,

    I don't know how to compute the probability you seek exactly, but I think I can give a pretty good approximation.

    To generalize the problem, let's suppose you have a possibly biased coin which comes up tails with probability p and heads with probability q, where p+q = 1. You flip the coin N times and look for a run of R or more successive tails. We would like to know the probability that at least one such run occurs. The "at least one" part is my interpretation of your problem statement; you didn't say that, but I'm guessing that's what you mean.

    As I said, I haven't come up with a reasonable way to compute the exact probability of having at least one run of length R, but think I can solve a closely associated problem which can be used to obtain an approximate answer.

    Let \lambda be the expected number of runs of R or more successive tails. It can be shown that

    \lambda = p^R \,[(N - R) q + 1].

    That is an exact result, not an approximation. (I derived this formula from scratch, but I suppose it must be a well-known result.) So in your case, for example, we have N = 1000, R = 20, p = 0.3 and q = 0.7, so \lambda = 2.4 * 10^{-8}.

    Now comes the approximation. Let's suppose the number of runs, say X, has a Poisson distribution with mean \lambda. It doesn't, but for small values of \lambda it should be pretty close. Then

     Pr(X > 0) = 1 - Pr(X = 0) = 1 - e^{-\lambda}.

    For small values of \lambda this value can be hard to compute precisely, but we can use another approximation:

    1 - e^{-\lambda} = \lambda (approximately),

    so the answer to your question is (once again, approximately) \lambda = 2.4 * 10^{-8}.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Apr 2013
    From
    Bern
    Posts
    1

    Re: Consecutive Heads/Tails in weighted coin toss

    Hi, great answer from awkward. But how did you figure out the expected number of runs of R or more successive tails:
    \lambda = p^R \,[(N - R) q + 1].
    You derived this formula from scratch. I tried to figure by myself this result and tried to Google it and did not find an answer.
    Could you share your Derivation ?
    Thanks
    Otto
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member
    Joined
    Oct 2012
    From
    Ireland
    Posts
    585
    Thanks
    155

    Re: Consecutive Heads/Tails in weighted coin toss

    The chance of getting 20 tails in a row in 20 tosses is 0.320. When tossing a coin 1000 times there is are (1000-20+1)=981 times where you can have 20 of an outcome in a row. Since it is 20 or more we don't care what the other 980 tosses are.
    Since the chance of getting 20 in a row in one attempt is 0.320 and you get 981 attempts the chance of getting 20 in a row through the whole 1000 tosses is 981(0.320)
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Super Member
    Joined
    Mar 2008
    Posts
    934
    Thanks
    33
    Awards
    1

    Re: Consecutive Heads/Tails in weighted coin toss

    Quote Originally Posted by ottof View Post
    Hi, great answer from awkward. But how did you figure out the expected number of runs of R or more successive tails:
    \lambda = p^R \,[(N - R) q + 1]
    You derived this formula from scratch. I tried to figure by myself this result and tried to Google it and did not find an answer.
    Could you share your Derivation ?
    Thanks
    Otto
    Let
    X_i = \begin{cases} 1     &\text{if there is a run of at least R tails starting with flip i}\\0    &\text{otherwise} \end{cases}
    Then X_1 = 1 if the first R flips are tails,
    but for i > 1, X_i = 1 if the (i-1)st flip is a head and the next R flips are tails.

    So
    E(X_1)=\Pr(X_1 = 1) = p^R
    and
    E(X_i)=\Pr(X_i = 1) = q p^R for i > 1

    Applying the theorem that E(X+Y) = E(X) + E(Y), we have

    E \left( \sum_{i=0}^{N-R+1} X_i \right) = \sum_{i=0}^{N-R+1} E(X_i) = p^R + (N-R)q p^R = p^R [(N-R)q + 1]
    Thanks from ottof
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 2
    Last Post: July 7th 2010, 11:54 PM
  2. Variance, Number of Heads and Tails
    Posted in the Statistics Forum
    Replies: 1
    Last Post: February 1st 2010, 12:27 AM
  3. Weighted coin toss
    Posted in the Statistics Forum
    Replies: 2
    Last Post: October 17th 2008, 05:29 AM
  4. Forming a function of heads vs. tails.
    Posted in the Advanced Statistics Forum
    Replies: 1
    Last Post: February 25th 2008, 12:21 PM
  5. Rigged Game of Heads or Tails
    Posted in the Statistics Forum
    Replies: 2
    Last Post: May 23rd 2007, 09:40 AM

Search Tags


/mathhelpforum @mathhelpforum