# Conditional distribution of sum of iid bernoulli variables

How do I find the distribution of the following iid variables?

$$X_i\sim Ber(p)$$ , $$n>m$$

$$P(\sum_{i=1}^m X_i | \sum_{i=1}^n X_i ) = \frac {P(\sum_{i=1}^m X_i , \sum_{i=1}^n X_i )}{P(\sum_{i=1}^n X_i )}$$

• It might be clearer if you wrote $P\left(\sum\limits_{i=1}^m X_i =a \mid \sum\limits_{i=1}^n X_i=b \right)$. This is not equal to $\dfrac{P\left(\sum\limits_{i=1}^m X_i =a\right)}{ P\left(\sum\limits_{i=1}^n X_i=b \right)}$, and obviously not if $a > b$ Jun 19, 2020 at 13:19
• I understand. Thank you! Jun 19, 2020 at 13:25

• In effect, you will have $$\sum\limits_{i=1}^n X_i$$ ones out of $$n$$ with the rest zeros, and you want to know how many of these ones are in the first $$m$$
• The conditional probability will not depend on $$p$$ and will end up being a hypergeometric distribution
• If you do not take that shortcut, you could investigate $$\dfrac{P\left(\sum\limits_{i=1}^m X_i =a\right)P\left(\sum\limits_{i=m+1}^n X_i =b-a\right)}{ P\left(\sum\limits_{i=1}^n X_i=b \right)}$$