# How to calculate one probability out of several Bernoulli probabilities?

For a multi-agent problem I want to calculate the probability that a certain event happens for any agent (1 or more). There are n agents, and $P(X_i=1)=p_i$ for each agent. I want to calculate the probability that the event is true for any agent: $p_c = P(X_1=1 \vee X_2=1 \vee ... \vee X_n=1)$.

For $n=2$:

$p_c = p_1 + p_2 - p_1 p_2$

And for $n=3$:

$p_c = p_1 + p_2 + p_3 - p_1 p_2 - p_1 p_3 - p_2 p_3 + p_1 p_2 p_3$

Is there an easier way to calculate this probability?

• try $1-P(X_1=0 \& X_2=0 \& \dots \& X_n=0) ) = (1- (1-p_1)(1-p_2)\dots (1-p_n))$ ? – user83346 Feb 10 '16 at 16:45
• @fcop's solution is way easier (and should be posted as an answer), but just as a note, the general form of what you're doing is called the inclusion-exclusion principle. – Dougal Feb 10 '16 at 16:47

## 1 Answer

I would have left this as a comment but @Dougal says in his comment that I should post is as an answer:

The result can be found as \begin{align} p_c &= 1 - P(X_1=0 \,\&\, X_2=0 \,\&\, \dots \,\&\, X_n=0) \\&= 1 - (1-p_1)(1-p_2)\cdots (1-p_n) \\&= 1 - \prod_{i=1}^n (1-p_i) \end{align}