Conditional distribution of a Bernoulli given the relative binomial

probabilityprobability distributionsrandom variables

Let $X_1,\dots,X_n$ be independent random variables with $X_i \sim $ Ber($p$), and let $S_n=X_1+\dots+X_n$ be the relative binomial distribution with parameters $n,p$. Then, what is the conditional distribution of $X_i$ given $S_n=r$? I have that
$$P(X_i=k \mid S_n=r)=\dfrac{P(X_i=k,\ S_n=r)}{P(S_n=r)}$$
With $k=0,1$, but I really don't understand what can I say about $P(X_i=k,\ S_n=r)$. I mean, they aren't independent, but how the fact that $S_n=r$ influences the probability that $X_i=k$?

Best Answer

The conditional distribution you are looking for is the following

$$ P(X_i=k) = \begin{cases} \frac{n-r}{n}, & \text{if k=0} \\ \frac{r}{n}, & \text{if k=1} \end{cases}$$

it is very easy to prove..

Without loss of generality let's prove the conditional distribution of $X_1$ (all the variables have the same density)

$$\mathbb{P}[X_1=0|\sum_iX_i=r]=\frac{\mathbb{P}[X_1=0;\sum_{i=1}^nX_i=r]}{\mathbb{P}[\sum_{i=1}^nX_i=r]}=$$

$$=\frac{\mathbb{P}[X_1=0;\sum_{i=2}^nX_i=r]}{\mathbb{P}[\sum_{i=1}^nX_i=r]}=\frac{\mathbb{P}[X_1=0]\mathbb{P}[\sum_{i=2}^nX_i=r]}{\mathbb{P}[\sum_{i=1}^nX_i=r]}=$$

$$\frac{(1-p)\binom{n-1}{r}p^r(1-p)^{n-1-r}}{\binom{n}{r}p^r(1-p)^{n-r}}=\frac{(n-1)!r!(n-r)!}{r!(n-1-r)!n!}=\frac{n-r}{n}$$

Similar brainstorming for $\mathbb{P}[X_1=1]$