# Finding probably exactly one event will occur among multiple independent events

Given events $A$, $B$ and $C$, I am somewhat lost as to how to compute exactly one of them happens. I was thinking of defining the event where you pass exactly one of them as so:

$D$ = event exactly one of the three events occur

$$D = (A \cap B'\cap C')\cup(A'\cap B\cap C')\cup (A'\cap B'\cap C) = A1\cup A2\cup A3$$

Now, since they're mutually independent, I understand $P(A'\cap B'\cap C)$, for example, can become $P(A')P(B')P(C)$. But since they aren't mutually exclusive, I cannot split up $P(D) = P(A1) + P(A2) + P(A3)$.

I drew a venn diagram and saw that the regions of interest $A1$, $A2$ and $A3$ are indeed disjoint, but I am not sure if this applies for all possible $A1$, $A2$ and $A3$, and so I am hesitant to assume this until I can be sure these events are disjoint.

$A1= A\cap B' \cap C'$ and $A2= A'\cap B \cap C'$ are mutually exclusive since for $A \cap B' \cap C'$ to happen we need $A$ to happen, and for the second one we need $A$ to not happen. So, $A1$ and $A2$ are mutually exclusive. Likewise $A2$ and $A3$ are mutually exclusive, and so are $A1$ and $A3$. So, they are all mutually exclusive.

This can be generalized as follows:

Say we have a numbers of events $B_1$ through $B_n$. Let $A_i$ be the event that $B_i$ happens but none of $B_j$ with $j \not = i$. Then any $A_i$ and $A_j$ with $i \not = j$ are mutually exclusive, since for $A_i$ to happen you need $B_i$ to happen, but for $A_j$ to happen you need $B_j$ to not happen. So, all the $A_i$'s are mutually exclusive.

Although @Bram28's answer is great, I want to add an answer because I have a resource on an algorithm written specifically for this. Here is a fast recursive algorithm to calculate the exact probability of $m$ out of $n$ events happening. It is important to note that this algorithm calculates the probability for each value of $m$. I will use the notation $P_k$ to denote the probability of the $k^{th}$ event and $P_{k,J}$ to denote the probability of $k$ out of $J$ events happening.

1. Give your events a numbered order. The order itself does not matter, but you have to give a consistent order.
2. Assuming you know your probabilities, use the following recursion formulas to get $P_{k,J}$.
1. $P_{0,0}=1$
2. $P_{0,J+1}=P_{0,J}\cdot(1-P_{J+1})$
3. $P_{k+1,J+1}=P_{k,J}\cdot P_{k+1}$
4. $P_{k,J+1}=P_{k,J}\cdot(1-P_{k+1})+P_{k-1,J}\cdot P_{k+1}$

You should use the recursive formulas first, then use the fourth one to fill the gaps left behind by the other ones.