# Balls in Boxes, Probability Question

1. Dec 3, 2004

### dogma

Hello one and all. I could use a little guidance here on a probability problem.

Box #1 contains a black balls and b white balls while box #2 contains c black balls and d white balls. A ball is chosen randomly from box #1 and placed in box #2. A ball is then randomly chosen from box #2 and placed in box #1. What is the probability that box #1 still has a black balls and b white balls?

Okay, from that I come up with the following:

Let Random Variable X1 = a black ball is transferred to box #2 from box #1
Let R.V. X2 = a white ball is transferred to box #2 from box #1

Let R.V. Y1 = a black ball is transferred to box #1 from box #2
Let R.V. Y2 = a white ball is transferred to box #1 from box #2

$$P(X_1) = \frac{a}{a+b}$$ and $$P(X_2) = \frac{b}{a+b}$$

$$P(Y_1 \mid X_1) = \frac{c+1}{c+d+1}$$ and $$P(Y_1 \mid X_2) = \frac{c}{c+d+1}$$

$$P(Y_2 \mid X_1) = \frac{d}{c+d+1}$$ and $$P(Y_2 \mid X_2) = \frac{d+1}{c+d+1}$$

This is where I get stuck.

I know (for example) that I can define another R.V. to represent, say, a black ball was selected from box #2 (I'll call it R.V. A), and...

$$P(A) = P(X_1) \cdot P(Y_1 \mid X_1) + P(X_2) \cdot P(Y_1 \mid X_2)$$

Assuming I'm somewhat on the right track and haven't screwed things up, how would I go about determining the probability that box #1 still has a black balls and b white balls?

dogma

Last edited: Dec 3, 2004
2. Dec 3, 2004

### matt grime

You're on the right track by thinking conditionally.

Can I make some notational changes and abuses?

P(correct allocation of balls) = P(correct number given a white transferred or correct n umber given a black transferred)

mutuall exclusive

=P(correct number given white transferred) +P(correct number given black transferred)

=P(white put back given white taken) + P(balck put back given black taken)

= somethings you've worked out.

3. Dec 3, 2004

### dogma

First of all, thanks for your response. I greatly appreciate your help.

My mind is swimming…so hopefully I'm not going to make this worse. If I'm correctly utilizing the info you provided:

P(correct allocation of balls) = P(a black balls and b white balls), since box #1 started off with a black balls and b white balls [and box #2 started off with c black balls and d white balls].

P(white ball chosen from box #1) =$$\frac{b}{a+b}$$

P(black ball chosen from box #1) =$$\frac{a}{a+b}$$

and

P(white ball chosen from box #2 given a white ball chosen from box #1) =$$\frac{d+1}{c+d+1}$$

P(black ball chosen from box #2 given a black ball chosen from box #1) =$$\frac{c+1}{c+d+1}$$

and finally,the correct allocation of balls:

P(a black balls and b white balls) = $$\frac{b}{a+b} \cdot \frac{d+1}{c+d+1}+\frac{a}{a+b} \cdot \frac{c+1}{c+d+1}$$

Am I warmer, colder, or way out in left field?

Thanks again!

dogma

4. Dec 3, 2004

### matt grime

yp, that seems to be about right (and correcting any errors i may have made).

5. Dec 3, 2004

### dogma

thank you for your guidance and wisdom.

best of wishes,

dogma

6. Dec 3, 2004

### dogma

Could I have used a hypergeometric distribution to figure this out? I guess I would just have to figure out how to set it up that way.

dogma

7. Dec 3, 2004

### Lele

Hypergeometric

One can use the hypergeometic distribution to get to the same result. Using the conditional probability approach, the probabilities (for choosing the black or white ball from box#1 )and the conditional probabilities (of choosing the black or white balls from box#2) are the same as the one you got earlier.

Lets see for one case:
Box#1: choosing a black ball
Probability = (a choose 1) * (b choose 0) / (a+b choose 1)
= a/(a+b)
(a choose 1 : ways of choosing 1 ball from a black balls)
Similarly the probability of choosing a black ball from box# given black ball chosen from box#1 = (c+1)/ (c+d+1)

This is exactly the first term in your equation.

I would appreciate if someone could let me know how to handle mathematical notation in this text editor.

8. Dec 4, 2004

### dogma

Lele,

Check out this link on LaTex (it's in the General Physics forum): https://www.physicsforums.com/showthread.php?t=8997

It is a thread containing info about LaTex typesetting in a message. It's pretty easy to do.

Thanks and good luck.

dogma