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

IF $A$,$B$,$C$ are finite sets then,

Number of elements in exactly one of sets $A$,$B$,$C$:$$n(A)+n(B)+n(C)-2 \times n(A \cap B)-2 \times n(A \cap C)-2 \times n(C \cap B) + 3 \times n(A \cap B \cap C)$$

Number of elements in exactly two of the sets $A$,$B$,$C$: $$n(A \cap B)+(A \cap C)+n(C \cap B) - 3 \times n(A \cap B \cap C)$$

Could somebody explain how can we prove them? I think it's something with inclusion and exclusion but am not getting how to get those results.Also I think we can have a generalized results for these kinds ?!

share|cite|improve this question
It is exactly PIE (inclusion-exclusion). This is trivial though with a Venn diagram. – picakhu Dec 21 '10 at 20:07
Please change the title to something more descriptive. – Aryabhata Dec 21 '10 at 23:06
@Moron:Please check. – Quixotic Dec 22 '10 at 5:42
Deb: Seems ok... – Aryabhata Dec 22 '10 at 6:03
up vote 2 down vote accepted

You're right about inclusion and exclusion.

For the number of elements in exactly one of the sets, you first count all $n(A) + n(B) + n(C)$ elements. You disregard the $n(A \cap B)$ elements twice, as you need to disregard them from your count for both $A$ and $B$. The logic is similar for $A \cap C$ and $B \cap C$. Finally, you've disregarded the $n(A \cap B \cap C)$ elements in all three sets twice, so you have to correct the count by adding this quantity back in.

I bet you can figure out the second one once you've carefully understood the first.

share|cite|improve this answer
Thanks, I understood,it was really trivial on analyzing with a venn diagram. – Quixotic Dec 22 '10 at 5:40

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.