Black and white ball drawing without replacement expected number of ball color switches

905 Views Asked by At

We randomly draw balls one by one without replacement from an urn with $w$ white balls and $b$ black balls until the urn is emptied. We call the event of a consecutive appearance of two balls of distinct colors a color switch. What is the expected number of color switches in this process?

We can model this as a random walk on a lattice. I do not think the probability of a color switch at a pair of given consecutive draws starting at the $i$'th draw is independent of $i$. Am I right?

4

There are 4 best solutions below

6
On

I do not think the probability of a color switch at a pair of given consecutive draws starting at the $i^{th}$ draw is independent of $i$.

No, it is identical for all $i$ in $1$ to $b+w-1$.

The probability for a colour switch after draw $i$ (call this event $S_i=1$), is the probability that draw $i$ is one colour and draw $i+1$ is the other. $$\forall i{\in}\{1,..,b{+}w{-}1\}~~, ~~\mathsf P(S_i{=}1)=\dfrac{\ldots}{\ldots~\ldots}$$

That will help you find the expectation.


For the variance, note that events $S_i{=}1, S_j{=}1$ are not going to be independent.$$\mathsf P(S_i{=}1,S_j{=}1)=\begin{cases}\mathsf P(S_i{=}1) &:& i=j, i{\in}\{1,..,b{+}w{-}1\},j{\in}\{1,..,b{+}w{-}1\}\\\ldots &:& \lvert i-j\rvert=1, i{\in}\{1,..,b{+}w{-}1\},j{\in}\{1,..,b{+}w{-}1\}\\\ldots &:&\lvert i-j\rvert>1, i{\in}\{1,..,b{+}w{-}1\},j{\in}\{1,..,b{+}w{-}1\}\\0&:& i{\notin}\{1,..,b{+}w{-}1\} \lor j{\notin}\{1,..,b{+}w{-}1\} \end{cases}$$

0
On

Inspired by Graham Kemp's answer, I come up with a direct answer.

Consider the set of sequences where the $i$'th draw initiates a color switch (2 possibilities). Cutting out $i$'th and $i+1$'st draws, with two possible subsequences WB and BW, from each of these sequences generates a unique sequence of draws from $b-1$ black balls and $w-1$ white balls. Conversely inserting WB and BW between the $i-1$'th and $i$'th draws of each sequence of draws from $b-1$ black balls and $w-1$ white balls generates two distinct sequences of draws from $b$ black balls and $w$ white balls. The $(b,w)$ sequences thus generated are all distinct. The $(b-1,w-1)$ sequences are all equally probable. Thus the total number of $(b,w)$ sequences with a color switch initiating at draw $i$ is $2 {b+w-2\choose b-1}$. The total number of $(b,w)$ sequences is $b+w\choose b$. The probability is then $2\frac b{b+w}\frac w{b+w-1}$.

0
On

Here is a more direct solution than my first one. The probability of getting a black ball on any draw is $\frac b{b+w}$ because by labeling the balls there is an equal probability of a specifically labeled ball as any other emerging out of any given draw. This can also be seen by using the characteristic function of a labeled ball falling on the $i$'th draw and the linearity of the expectation function. By the same token, given the first of two consecutive draws being a black ball, the immediate second draw is equivalent to have a white ball out of a specific draw for $b-1$ black balls and $w$ white balls ensemble. That conditional probability is then $\frac w{b+w-1}$. There are $2$ sequences to realize the color switch, namely WB and BW. So the probability of a color switch occurring starting on any arbitrary draw is $2\frac b{b+w}\frac w{b+w-1}$.

8
On

There are $b+w-1$ consecutive pairs.

Number the draws chronologically and for $i=1,\dots,b+w-1$ let $X_i$ take value $1$ if pair $(i,i+1)$ produces a switch. Let $X_i$ take value $0$ otherwise.

Then $X:=\sum_{i=1}^{b+w-1}X_i$ denotes the total number of switches and the $X_i$ have equal distribution.

With linearity of expectations and symmetry we find:$$\mathbb EX=(b+w-1)P(X_1=1)=(b+w-1)\frac{2wb}{(b+w)(b+w-1)}=\frac{2wb}{b+w}$$

Actually this is not more than a work-out of the answer of Graham.


addendum

The balls are placed on the spots $1,2,\dots, b+w$.

For $i\in\{1,2,\dots,b+w-1\}$ let $W_i$ denote the event that a white ball will cover spot $i$ and let $B_i$ denote the event that a black ball will cover spot $i$.

Then: $$P(W_i\cap B_{i+1})=P(W_i)P(B_{i+1}\mid W_i)=\frac{w}{b+w}\frac{b}{b+w-1}$$

To understand this let it land that all original balls have equal probability to become the ball that covers spot $i$, so that for each of them this probability is $\frac1{b+w}$.

Then - since $w$ of these balls are white - the probability that a white ball will do that is $\frac{w}{b+w}$, which is expressed in $P(W_i)=\frac{w}{b+w}$.

Under the condition that this indeed happens there are $b+w-1$ equiprobable candidates left for covering spot $i+1$ and $b$ of them are black so that $P(B_{i+1}\mid W_i)=\frac{b}{b+w-1}$

Similarly we find that: $$P(B_i\cap W_{i+1})=\frac{b}{b+w}\frac{w}{b+w-1}$$

Then: $$P(X_i=1)=P(W_i\cap B_{i+1})+P(B_i\cap W_{i+1})=\frac{2wb}{(b+w)(b+w-1)}$$

This for every $i$.