Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having an issue related to probability set theory with intersection/union terms.

When calculating the union of terms or in other words, the probability that at least one terms "fails", it can be written as the following for three terms:

P(A+B+C) = P(A)+P(B)+P(C)-P(AB)-P(AC)-P(BC)+P(ABC).

My question is how to assess a problem similar to this when we are looking at the probability at least x terms out of n terms fail. For example, at least 2 out of 4. Or at least 7 out of 10. I thought I came up with the correct answer when looking at a system of only 4 terms. For example:

P(at least 2 out of 4) = P(AB)+P(AC)+P(AD)+P(BC)+P(BD)+P(CD) -2*(P(ABC)+P(ABD)+P(ACD)+P(BCD)) +3*(P(ABCD))

P(at least 3 out of 4) = P(ABC)+P(ABD)+P(ACD)+P(BCD) -3*(P(ABCD))

This works here. In fact, it works for P(at least 2 out of n) and P(at least (n-1) out of n) for all cases of n. However it does not work for the situations in between.

I am looking for an analog formula that can evaluate any case for the probability of at least x out of n failure. Any help with be appreciate. Thanks!

share|cite|improve this question
You’re looking for the inclusion-exclusion principle; why don’t you have a look at that article and then see what questions you still have. – Brian M. Scott Nov 18 '12 at 2:56
Hi - thanks for responding. I understand this principle as it applies to the union of events occuring. I cannot figure out how it applies to the probability that suppose 2 out of n events fail since it is not as simple as adding and subtracting the sum of each intersection terms. Does this make sense? For example, P(at least 2 out of 4) is not equal to sum(P(2-int terms)) - sum(P(3-int terms)) + sum(P(3-int terms)). Does this make more sense? – Holly Nov 18 '12 at 3:06

Update - I figured it out. Yes, it does have to do with the exclusion/inclusion principle but it becomes very tricky. Basically I went through each intersection level for n = 5 events and calculated how many of each term I am subtracting and adding. Doing this, I was able to get coefficients needed for subtracting and adding each subsequent intersection term. There isn't a pretty formula for it, but I put it into a code to be able to populate the coefficients for each x out of n case of interest.

share|cite|improve this answer
My apologies for not getting back to you: I got distracted and completely forgot. – Brian M. Scott Nov 19 '12 at 7:40

Specfically, the cumulative distribution function (cdf). That formula tells the probability that less than or equal to x successes have occurred, so you'd want 1 - cdf for your "at least" question.

Example: 2 or fewer successes out of 3 trials where a success has probability 1/3

F(2,3,1/3) = ({3!/[0!(3-0)!]}[(1/3)^(0)][(2/3)^(3-0)]) + ({3!/[1!(3-1)!]}[(1/3)^(1)][(2/3)^(3-1)]) + ({3!/[2!(3-2)!]}[(1/3)^(2)][(2/3)^(3-2)])

= [(6/6)(8/27)] + [(6/2)(4/27)] + [(6/2)*(2/27)] ~= .963

In this case, you could have just found the probability of exactly 3 successes in 3 trails. Pr(X=3 | n=3, p=(1/3)) = (1/3)^3 ~= 0.037

I apologize for the lack of mathematical notation, but the formula on wikipedia is correct. For large n (trials), the formula is cumbersome and there are other methods described on wikipedia. There are also cumulative distribution tables for the binomial distribution.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.