# Probability of picking some balls before other balls

Given many black, red, yellow balls in a urn. You draw without replacement.(update:You draw all ball)
What is the probability that a red ball is picked before any yellow balls?

My gut feeling the solution is #red/(#red+#yellow); that is, I ignore the black balls and take the probability of red at first pick.

But however I cannot turn my intuition into a proof.

I think there's a short proof, can anyone provide a hint to me?

EDIT: in other word: (thank to @dv_bn)

So the game goes: Draw a ball, if Red: you win, if Yellow: you lose, if Black: Keep on drawing baby.

• I guess from your gut feeling that there are several balls of each color in the urn. Am I correct? You might want to clarify this point. – dv_bn Apr 20 '16 at 2:38
• How many draws? Is it a draw with replacement? Please elaborate. – dv_bn Apr 20 '16 at 2:49
• many balls, I think how many is not relevant, and draw without replacement. – WeiChing Lin Apr 20 '16 at 4:03
• How many balls of course matters. Compare the case you have 1000 yellow, 1 red and 1 red, 1000 yellow. You have to state how many balls of each color clearly. – Zhanxiong Apr 20 '16 at 4:05
• When you say "What is the probability that red ball is picked before yellow balls?", do you actually mean: "What is the probability that a red ball is picked before any yellow ball?". So the game goes: Draw a ball, if Red: you win, if Yellow: you lose, if Black: Keep on drawing baby. – dv_bn Apr 20 '16 at 4:28

Here is a short demonstration.

Select balls until the first red or yellow ball is picked. (We assume this is certain to happen.) Regardless of how balls are selected (and you can even play Polya urn-like games and put more balls back into the urn after each selection), let us suppose that so long as no red or yellow balls are picked, there always remain $r$ red balls and $y$ yellow balls in the urn and that all red and yellow balls are equally likely to be chosen. (This is the case with independent random selection, either with or without replacement.) This assumption implies that at the moment a red or yellow ball is first selected, it has $r$ chances of being red out of the $r+y$ possible balls, giving a probability of $r/(r+y)$. Done!

You asked for a proof. OK, that's fair: rigor requires mathematical notation and concepts because they help us avoid mistakes. The following analysis, which emulates the preceding demonstration, is extremely general but requires only definitions and axioms and therefore is completely elementary.

Let $$X_0, X_1, X_2, \ldots, X_n, \ldots$$ be a stochastic process that models the selection of balls. For each $i$ let $\mathcal{R}_i \subset \mathbb{R}$ and $\mathcal{Y}_i \subset \mathbb{R}$ be disjoint Borel sets modeling the events "a red ball is drawn at step $i$" and "a yellow ball is drawn at step $i$," respectively. Let $\mathcal{B}_i = \mathbb{R}\setminus \left(\mathcal{R}_i \cup \mathcal{Y}_i\right)$ be the event in which neither a red ball nor a yellow ball is drawn at step $i$. The event "no red or yellow balls are drawn before step $i$ but one of them is drawn at step $i$" is

$$\mathcal{A}_{i}=\{\omega\,|\, X_0(\omega) \in \mathcal{B}_0, X_1(\omega)\in\mathcal{B}_1,\ldots,X_{i-1}(\omega)\in\mathcal{B}_{i-1}, X_{i}(\omega)\in\mathcal{R}_i \cup\mathcal{Y}_i\}.$$

The chance of drawing a red ball at step $i$, after seeing no red or yellow balls before then, can be written in terms of the conditional probability

$$\Pr(X_i \in \mathcal{R}_i\,|\, \mathcal{A}_{i}) \Pr(\mathcal{A}_{i}).\tag{1}$$

By definition, if $\mathcal{A}_i$ occurs, then either $\mathcal{R}_i$ or $\mathcal{Y}_i$ must occur--and these events are disjoint. Therefore

$$\Pr(\mathcal{R}_i\,|\,\mathcal{A}_i) = \frac{\Pr(\mathcal{R}_i)}{\Pr(\mathcal{R}_i) + \Pr(\mathcal{Y}_i)}.\tag{2}$$

Let us suppose it is certain that eventually a red or yellow ball is drawn. Because the $\mathcal{A}_i$ are disjoint, this can be expressed

$$1 = \sum_{i=0}^\infty \Pr(\mathcal{A}_i).\tag{3}$$

The chance of drawing a red ball first is obtained (according to the definition of conditional probability) by summing over all possible $\mathcal{A}_i$, because these are disjoint and exhaustive (apart perhaps from a set of probability zero representing the event no red or yellow ball is ever drawn). Combining $(1)$ and $(2)$ gives the expression

$$\Pr(\text{Red drawn first}) = \sum_{i=0}^\infty \frac{\Pr(\mathcal{R}_i)}{\Pr(\mathcal{R}_i) + \Pr(\mathcal{Y}_i)} \Pr(\mathcal{A}_i).\tag{4}$$

This is the general solution we were aiming for.

When sampling randomly, with or without replacement, from an urn with $r$ red balls and $y$ yellow balls, suppose that at step $i$ there are $b_i \ge 0$ additional balls of any (non-red, non-yellow) color. Then

$$\Pr(\mathcal{R}_i) = \frac{r}{r + y + b_i}$$

and

$$\Pr(\mathcal{Y}_i) = \frac{y}{r + y + b_i},$$

whence

$$\frac{\Pr(\mathcal{R}_i)}{\Pr(\mathcal{R}_i) + \Pr(\mathcal{Y}_i)} = \frac{r/(r+y+b_i)}{r/(r+y+b_i) + y/(r+y+b_i)} = \frac{r}{r+y}.$$

Consequently $(4)$, by virtue of $(3)$, simplifies to

$$\Pr(\text{Red drawn first}) = \sum_{i=0}^\infty\frac{r}{r+y}\Pr(\mathcal{A}_i)=\frac{r}{r+y}\sum_{i=0}^\infty\Pr(\mathcal{A}_i) = \frac{r}{r+y}.$$

That finishes the proof when sampling from a finite urn without replacement, for it is certain that eventually a red or yellow ball will be drawn (assuming there is at least one of them in the urn). When sampling with replacement, a standard argument (based on the geometric distribution, but of only tangential interest here) shows that eventually drawing a red or yellow ball is certain provided the chances are not zero to begin with. That will be the case when sampling from any finite urn, QED.

• Are there any "canonical" posts dwelling on the notation for the Borel sets as applied to discrete events? I'm working on understanding Borel sigma algebras as those generated by the open sets of a standard topology, and I'm finding their use in more discrete (?) events like the ball/urn problems a bit unexpected. – Antoni Parellada Apr 20 '16 at 15:32
• @Antoni There's nothing special about "discrete events." As you have seen here, they are no different than any other kind of event. You might have in mind discrete random variables $X$. With probability $1$, they take on at most a countable number of values $x_0, x_1, \ldots, x_n, \ldots$. The corresponding events are, of course the $X^{-1}(x_i)$ (which are disjoint). The CDF of $X$ has finite jumps at the $x_i$ and otherwise is constant. But all this is an unnecessary complication. We need Borel sets only so that things like $X_i^{-1}(\mathcal{R}_i)$ have well-defined probabilities. – whuber Apr 20 '16 at 15:45
• Thank you. I guess what I am asking/trying to understand is whether the sigma algebras in probability spaces are always Borel algebras in the way of always having a generating topology. – Antoni Parellada Apr 20 '16 at 15:50
• @Antoni Borel sets in the reals are special due to their connection with distribution functions (CDFs). By definition, the CDF of a random variable $X$ is $$F_X(x)=\Pr(X \le x)=\Pr\{\omega\,|\,X(\omega)\in(\infty,x]\}=\Pr(X^{-1}((-\infty, x])).$$ For that last "$\Pr$" to have meaning, the set it is applied to must be in the sigma algebra. Thus, at a minimum we must assume that a random variable pulls back all such intervals to measurable sets. Consequently, it must pull back the entire sigma-algebra generated by those intervals to a sub-algebra. That sigma-algebra comprises the Borel sets. – whuber Apr 20 '16 at 15:54
• Thank you. Just apropos, this is the state of affairs... – Antoni Parellada Apr 20 '16 at 15:59