Given an #n of balls. you are only allowed to pick between two balls at a time with a probability $P_{i}=0.5$ with i being the number of the ball.
For example: you're presented with a black ball and a red ball.. so to be uniformly distributed the probability would be $P_{black}=P_{red}=0.5$ so you pick the red ball and forget about the black ball.
but then you're introduced to a blue ball. what is the probability of picking the blue $P_{picking}$ ball so that the set would be uni-formally distributed? $P_{black}=P_{red}=P_{blue}=1/3$
after each pick you're given a new ball what is the $p_{picking}$ to make $p_{ball}=1/n$
How do you go about solving this?
As we are picking in a sequential order either to pick the next ball or not with the main goal of making the distribution of result uniform which means that for all balls it's equally likely for all other balls to be selected.
so let's analyze the first three balls.
$P_{picking}=100\%$ for the first ball $P_{1st} = 100\%$
$p_{picking}=50\%$ for the second ball $P_{1st} = 50\% , P_{2nd}=50\%$
$P_{picking}= ??$ for the third ball, for this we have to consider
$P_{3rd} = P_{picking,3rd} \times p_{picking,2nd} \times n_{ways}$
$P_{ball} = \frac{1}{n}$ Target
$ways = i-1$ where i equals the number of total balls
General form would be $P_{picking,new} = \frac{1}{i} / P_{picking,old} / (i-1)$
Credit: thanks for dsillman2000 for pointing out that the probability of the ball newly added ball equals to the sum of it's ways