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

Math Help - (Hardish) Combinatorics problem: how often are consecutive balls the same colour?

  1. #1
    Newbie
    Joined
    Aug 2012
    From
    United Kingdom
    Posts
    3

    (Hardish) Combinatorics problem: how often are consecutive balls the same colour?

    Hi all, first post, and not entirely sure it belongs here, but the problem seems hard enough to me!

    I have a bag containing X red balls and Y blue balls.

    Balls are withdrawn one at a time until no balls remain.

    What is the expected number of times that two blue balls are withdrawn in a row?

    (E.g. in: r b b r b r r b b b b, there are 4 b-b events)

    Is it possible to work out a general formula?
    Follow Math Help Forum on Facebook and Google+

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

    Re: (Hardish) Combinatorics problem: how often are consecutive balls the same colour?

    This is easier to work out via probability theory rather than combinatorics.

    Let's say T_i = 1 if the ith and (i+1)th balls are both blue,
    = 0 otherwise.

    Then \Pr(A_i = 1) = \frac{X}{X+Y} \cdot \frac{X-1}{X+Y-1} for i = 1, 2, 3, \dots X+Y-1.

    So the expected number of times two blue balls are drawn in a row is
    E(\sum T_i) = \sum E(T_i) = \sum \Pr(T_i = 1)
    = (X+Y-1) \cdot  \frac{X}{X+Y} \cdot \frac{X-1}{X+Y-1} = \frac{X(X-1)}{X+Y}

    Here we have used the theorem that E(X+Y) = E(X) + E(Y). It's important to realize that this theorem holds even if X and Y are not independent. That is good for us here, because the T_i's are not independent.
    Thanks from sirdakka
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Aug 2012
    From
    United Kingdom
    Posts
    3

    Re: (Hardish) Combinatorics problem: how often are consecutive balls the same colour?

    Thank you very much for your answer.

    I realize now that I also require the variance, which I am currently trying to work out, but as a neuroscience student I am struggling somewhat.

    Is there any chance you could help me out once again?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Aug 2012
    From
    United Kingdom
    Posts
    3

    Re: (Hardish) Combinatorics problem: how often are consecutive balls the same colour?

    Also, the variances for the cases in which a red follows a blue, a blue follows a red and a red follows a red.
    Follow Math Help Forum on Facebook and Google+

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

    Re: (Hardish) Combinatorics problem: how often are consecutive balls the same colour?

    Quote Originally Posted by sirdakka View Post
    Thank you very much for your answer.

    I realize now that I also require the variance, which I am currently trying to work out, but as a neuroscience student I am struggling somewhat.

    Is there any chance you could help me out once again?
    It's more involved, but the technique in my previous post can be extended to find the variance. Here is the idea. Consider the sum
    \sum_{i < j} T_i T_j, where T_i is defined as before. This sum is equal to the number of pairs of blue-blue pairs; so if Z is the number of blue-blue pairs, then
    \binom{Z}{2} = \sum_{i < j} T_i T_j
    so
    \frac{Z^2 - Z}{2} = \sum_{i < j} T_i T_j
    whence
    Z^2 = Z + 2 \sum_{i < j} T_i T_j
    so
    E(Z^2) = E(Z)  + 2 E \left( \sum_{i < j} T_i T_j \right)

    We already know E(Z) from the previous post; so if we can find E \left( \sum_{i < j} T_i T_j \right) then we can find E(Z^2).
    Once we know E(Z) and E(Z^2), we can find var(Z) from the equation var(Z) = E(Z^2) - E(Z)^2.

    So consider the expected number of pairs of blue-blue pairs. Let's say (i, i+1) and (j, j+1) are one such pair, where i < j. There are two possibilities: i+1 = j and i+1 < j.

    In the first case (i+1 = j), the probability of occurrence is
    \frac{X}{X+Y}  \cdot \frac{X-1}{X+Y-1}  \cdot \frac{X-2}{X+Y-2}
    There are X+Y-2 such pairs.

    In the second case (i+1 < j), the probability of occurrence is
    \frac{X}{X+Y}  \cdot \frac{X-1}{X+Y-1} \cdot \frac{X-2}{X+Y-2} \frac{X-3}{X+Y-3}
    There are \binom{X+Y-1}{2} - (X+Y-2) = \frac{(X+Y-2) (X+Y-3)}{2} such pairs.

    Therefore
    E \left( \sum_{i < j} T_i T_j \right) = (X+Y-2) \cdot \frac{X}{X+Y}  \cdot \frac{X-1}{X+Y-1}  \cdot \frac{X-2}{X+Y-2}
     +  \frac{(X+Y-2) (X+Y-3)}{2} \cdot \frac{X}{X+Y}  \cdot \frac{X-1}{X+Y-1}  \cdot \frac{X-2}{X+Y-2}  \cdot \frac{X-3}{X+Y-3}
    which can be simplified to
    E \left( \sum_{i < j} T_i T_j \right) = \frac{X (X-1)^2 (X-2)}{2 (X+Y) (X+Y-1)}

    Taken together with previous remarks, you now have enough information to calculate the variance.
    Thanks from sirdakka
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 3
    Last Post: October 7th 2011, 04:58 PM
  2. a basket contains 5 red balls, 3 blue balls, 1 green balls
    Posted in the Advanced Statistics Forum
    Replies: 3
    Last Post: May 28th 2010, 02:39 AM
  3. Another Consecutive Problem
    Posted in the Algebra Forum
    Replies: 1
    Last Post: June 10th 2009, 04:18 PM
  4. Consecutive Problem?
    Posted in the Algebra Forum
    Replies: 2
    Last Post: June 10th 2009, 04:13 PM
  5. Colour and size of balls
    Posted in the Advanced Math Topics Forum
    Replies: 1
    Last Post: June 15th 2006, 01:16 PM

Search Tags


/mathhelpforum @mathhelpforum