# Uniform distribution of a random variable

Suppose a box contains a yellow ball and a blue ball. Each time a ball is selected, another ball of the same colour is placed into the box. Suppose $$20$$ balls are selected. Let $$Y$$ be the random variable representing the number of yellow balls. Show that $$Y$$ is uniformly distributed with density $$f$$ given by $$f(y) = P(Y = y) = \frac{1}{21}.$$

For the case of one yellow ball, we have $$f(1) = \frac{1}2\cdot \frac{2}3\cdot \cdots \cdot \frac{20}{21} = \frac{1}{21}.$$ For two yellow balls, we just need to select a yellow ball one time in the twenty draws. If we select it the first time, we get a probability of $$\frac{1}{2}\cdot \frac{1}{3}\cdot \frac{2}{4} \cdots \cdot \frac{19}{21} = \frac{18}{20}\cdot \frac{1}{21}.$$ If we don't select it the first time, but select it the second time, the probability is the same. I'm not sure how to generalize this probability. It might be useful to consider invariants, but in my case I'm not sure which probabilities would be invariant.

The number $$20$$ shouldn't be very special so let's prove it for $$n$$ draws. Let $$P_n(y)$$ be the probability that there are $$y$$ yellow balls after $$n$$ draws. We will prove by induction that $$P_n(y)=\frac{1}{n+1}$$ for $$y=1,\ldots,n+1$$ and $$0$$ otherwise. It is easy to check that $$P_1(1)=\frac{1}{2}$$ and $$P_2(2)=\frac{1}{2}$$. Now suppose that after $$n$$ draws $$P_n(y)=\frac{1}{n+1}$$. We can only have $$y$$ yellow balls after the next draw if we had $$y$$ balls previously and draw a blue ball or if we had $$y-1$$ balls previously and draw a yellow ball (assuming $$y\neq 1$$, since we can never have $$0$$ yellow balls, but I will leave you to check this case). So, $$P_{n+1}(y)=P_n(y)\cdot P(B)+P_n(y-1)\cdot P(Y)$$ where $$B$$ and $$Y$$ are the events of drawing a blue or yellow ball if the the number of yellow balls is $$y$$ or $$y-1$$ after $$n$$ draws. Now $$P(B)=\frac{(n+2)-y}{n+2}$$ since after $$n$$ draws there are $$n+2$$ balls and $$P(Y)=\frac{y-1}{n+2}$$. Putting this together $$P_{n+1}(y)=\frac{1}{n+1}\frac{n+2 -y }{n+2}+\frac{1}{n+1}\frac{y-1}{n+2}=\frac{1}{n+2}$$ so the result follows by induction.