# Probability of drawing a red ball from a bag given bag state after ball is drawn

I have a bag with only red and blue balls. I take a ball out and hide it. Now there are x red balls and y blue balls in the bag. The bag was created with the following procedure. For each ball, there is a p chance of it being red, and 1-p chance of it being blue. What is the probability the hidden ball is red, expressed using only x, y, and p.

• Does this answer your question? Calculating Probability That Drawn Ball Is Red Given The State After It Is Drawn Commented May 13 at 5:43
• @Red, good to point out that closely related question, but it doesn't have an accepted answer, or even an answer with positive score. Commented May 13 at 7:51
• @GerryMyerson that may be because it was closed not too soon after being asked. Maybe the original question should be re-opened with this as an edit? Commented May 13 at 7:54

When we know there is (x+y+1) balls in the bag, the chance of bag containing (x + 1) red balls and y blue balls is $$\binom{x+y+1}{x+1}\cdot p ^{x+1} \cdot q^y$$
And the relative probability of taking a red ball from it is $$P(R) = \binom{x+y+1}{x+1}\cdot p ^{x+1} \cdot q^y \cdot \frac{x+1}{x+y+1} = \binom{x+y}{x}\cdot p ^{x+1} \cdot q^y = \binom{x+y}{x}\cdot p ^{x} \cdot q^y \cdot p$$
Similarly, the chance of the bag containing x red balls and (y+ 1) blue balls is $$\binom{x+y+1}{y+1} \cdot p ^x \cdot q^{y+1}$$ And the relative probability of taking a blue ball from it is $$P(B) = \binom{x+y+1}{y+1} \cdot p ^x \cdot q^{y+1} \cdot \frac{y+1}{x+y+1} = \binom{x+y}{x}\cdot p ^{x} \cdot q^{y+1} = \binom{x+y}{x}\cdot p ^{x} \cdot q^y \cdot q$$
Since the hidden ball can only be red or blue, the probability of hidden ball to be red is: $$\frac{P(R)}{P(R) + P(B)} = \frac{\binom{x+y}{x}\cdot p ^{x} \cdot q^y \cdot p } {\binom{x+y}{x}\cdot p ^{x} \cdot q^y \cdot (p + q)} = \frac{p}{p+q} = p$$