Where is an imperative implementation of the Poincaré-Sylvester formula for adding probabilities? (The formula is also known as inclusion exclusion principle formula for adding probabilities.)
Is there maybe already an open source java library that is able to handle thousands of probability inputs? Looking through typical math and statistics libraries, e.g., Apache Math, Weka and Colt, did not yield any implementation of the Poincaré-Sylvester formula so far.
Background: An implementation helps for computing big probability graphs fast and correctly. My probability graphs are comprising about some thousand input variables, which I’d like to sum up correctly (and efficiently). For n=2 input variables, P(A∪B) = P(A) + P(B) – P(AB); for n=3 input variables, P(A∪B∪C) = P(A) + P(B) + P(C) – P(AB) – P(AC) – P(BC) + P(ABC).