Suppose we perform n different Bernoulli experiments, each time with two possible outcomes: “red” and “blue”. The probability of drawing “red” in the i-th experiment is pi and the probability of drawing “blue” qi (= 1 - pi). That is, the probabilities differ for different experiments. We do know all the pi (i=1,…,n).
Let xi be the outcome of the i-th experiment.
Now we are told that we have to draw “red” nr times and “blue” n – nr times.
My problem is that I want to sample the xi (i=1,…,n) given that nr draws are “red” and n – nr are “blue”.
Does anyone know how to do this in an efficient way?