# probability of urn problem with replacements

i searched the site for the problem and unfortunately could not find an answer. the problem is as follow:

two urns, one with $n$ red balls, and the second urn contains $n$ blue balls. in every move, a ball is removed from urn No. 1, thrown away, and a ball from urn 2 is placed in urn 1 instead. the question is, what's the probability for the $n+1$ ball removed from urn 1 to be red (the first remove to be made when urn 2 is empty)?

i figured out that if i number the red balls, then the solution for a specific red ball would be ${\dfrac{1}{n}\big(\dfrac{n-1}{n}}\big)^n$ . can it imply on the solution for identical balls?

edit: Moreover, the general problem in which urn 1 and 2 contain $r1,b1$ and $r2,b2$ balls Respectively also confused me a little bit. i'm still trying to figure that out.

in the general problem, for the $r_1$ red balls which in the first urn, the probability would be ${\dfrac{r_1}{r_1+b_1}\big(\dfrac{r_1+b_1-1}{r_1+b_1}}\big)^{r_2+b_2}$. what can i do with the $r_2$ red balls in the second urn? if i can not tell exactly at what stage they were replaced in urn 1, do i have to separate the problem to different cases?

edit2: the solution for the general that i calculated is: ${\dfrac{r_1}{r_1+b_1}\big(\dfrac{r_1+b_1-1}{r_1+b_1}}\big)^{r_2+b_2}+{\dfrac{r_2}{r_2+b_2}\big(1-\big(\dfrac{r_1+b_1-1}{r_1+b_1}}\big)^{r_2+b_2})$

We may as well consider the following setup: The red balls are numbered from $1$ to $n$. The following operation is performed $n$ times: We draw a ball from urn $1$. If it is red it is repainted blue. Then it is put back. What is the probability that the $(n+1)^{\rm st}$ draw will produce a red ball?

Let $X_i=1$ if ball${}_i$ is still red after $n$ drawings, and $X_i=0$ otherwise. The probability that ball${}_i$ has never been drawn is $\left({n-1\over n}\right)^n$; whence $$E(X_i)=\left({n-1\over n}\right)^n\qquad(1\leq i\leq n)\ .$$ The expected number of red balls after $n$ drawings is therefore given by $$E(\#{\rm red\ balls})=\sum_{i=1}^n E(X_i)=n\left({n-1\over n}\right)^n\ ,$$ and the probability $P$ to draw a red ball on the $(n+1)^{\rm st}$ draw comes to $$P={E(\#{\rm red\ balls})\over n}=\left({n-1\over n}\right)^n\ .$$

• thank you for your answer. Commented Nov 10, 2015 at 7:59
• i have just edited the general problem, can you consider it now? @Christian Blatter Commented Nov 10, 2015 at 8:33

Here is a neat (though may be unorthodox) way to solve the problem.

For the first one imagine that the urn $1$ contains $nL$ wine and urn $2$, $nL$ water, that $1L$ from urn $1$ is thrown out and replaced by $1L$ of water, and that this is repeated $n$ times.

It is easy to show that the fraction of wine finally left in urn $1$ is $\left(\dfrac{n-1}{n}\right)^{n-1}$, which also represents the probability.

For the general problem, can you try and work out what happens if, say, urn $1$ contains $80\%$ wine and urn $2$ contains $20\%$ wine and the successive dilution is repeated, say, thrice ?

PS

Basically, we work with expected values, and the expected fraction of red balls left represents the probability.

PPS

For the general problem, you haven't specified how balls are transferred from urn 2. I presume that balls (red or blue) are randomly transferred.

General problem:

Following the unorthodox approach, let $\dfrac{r_2}{r_2+b_2}= a$,
then after 1 round, expected # of red balls in urn $1 = r_1 - 1 + an$
after $2$ rounds, it is $= r_1 - 2 + an + a(n-1)$,
after $k$ rounds, it is $= r_1 - k + an + a(n-1) + ... a(n-k+1)$,
so when the last ball is transferred from urn $2$, rearranging terms,
it is $= r_1 - n + a(1+2 +.... n) = r_1-n + 0.5an(n+1)$
and fraction of red remaining = desired expected value
$= \dfrac{r_1}{n} - 1 + 0.5a(n+1)$

I hope this is giving the desired answer !

• thank you for your comment, @true blue anil , i have just edited the general problem, can you consider it now? Commented Nov 10, 2015 at 8:33
• i solved it yesterday just the way you described !, i got a recurrence formula and solved it and got the solution, i will edit the post with it. Commented Nov 12, 2015 at 21:16