I need to use the principle of inclusion/exclusion to calculate the "OR" probability of a large number of events
$$ P( A_1 \cup A_2 \cup \dots \cup A_n ) $$
For two events the formula to use is (from Wikipedia http://en.wikipedia.org/wiki/Inclusion%E2%80%93exclusion_principle#In_probability) :
$$P(A_1\cup A_2)=P(A_1)+P(A_2)-P(A_1\cap A_2) $$.
For three events :
$$ P(A_1\cup A_2\cup A_3)=P(A_1)+P(A_2)+P(A_3) -P(A_1\cap A_2)-P(A_1\cap A_3)-P(A_2\cap A_3)+P(A_1\cap A_2\cap A_3) $$
For n events :
$$ P\biggl(\bigcup_{i=1}^n A_i\biggr) {} =\sum_{i=1}^n P(A_i) -\sum_{i<j}P(A_i\cap A_j) \qquad+\sum_{i<j<k}P(A_i\cap A_j\cap A_k)- \cdots\ +(-1)^{n-1}\, P\biggl(\bigcap_{i=1}^n A_i\biggr) $$
The latter contains a very large number of terms, making it hard to compute. So I thought it might be possible to use a trick. If this works, I am surely not the first one to come up with this.
The idea, illustrated on 4-event example, is $$ P( A_1 \cup A_2 \cup A_3 \cup A_4 ) $$ is equivalent to $$ P( (A_1 \cup A_2) \cup (A_3 \cup A_4) )$$ is equivalent to $$ P( A_1 \cup A_2) + P( A_3 \cup A_4) - P( A_1 \cup A_2) * P( A_3 \cup A_4) $$ .
The 2-event unions can be computed by the formula above.
This can be applied to $n$ events also. The algorithm always unifies 2 events to a new event, which is then combined with another unified event. So each step reduces the number of events to $n/2$ or $n/2+1$ if $n$ is odd. The procedure is repeated until a single union probability remains.
This makes it possible to reduce the required computational steps to $ O(log n) $ (or something like that).
I have tested this by numerically comparing the results of the procedure for 3 events and 4 events. It seems to work.
So my questions are: Is this wrong? And is there any literature reference on this approach?