|A\cup B|=|A|+|B|-|A\cap B|Variables
- A, B: finite sets
- |A|: number of elements in A
How to use this formula
Counts elements in a union without counting the intersection twice.
Important notes
- The formula assumes ordinary finite cardinalities.
- For probabilities, replace cardinalities with probability measures.
Quick example
If |A|=12, |B|=9, and |A∩B|=4, then |A∪B|=17.
Applicability, worked calculation, and verification
Assumptions and domain checks
- For probabilities, replace cardinalities with probability measures.
- Define whether selections are ordered, repeated, labeled, or constrained before applying the counting formula.
Worked example
If |A|=12, |B|=9, and |A∩B|=4, then |A∪B|=17.
Common mistakes
- When using Inclusion–Exclusion for Two Sets, do not assume independence, exclusivity, ordering, or replacement unless the model establishes it.
- Check Inclusion–Exclusion for Two Sets against a small enumeration or limiting event and confirm that every resulting probability lies between 0 and 1.
Continue the workflow
Use Inclusion–Exclusion for Two Sets in your own work
- Check the domainMatch the variables and assumptions to the problem before substituting values.
- Copy the exact notationPreserve grouping, signs, and exponents in
|A\cup B|=|A|+|B|-|A\cap B|. - Edit or convertOpen the expression in the LaTeX editor, then export it for your document or web page.
Review and verification
Last reviewed: 2026-07-23
Automated quality check: Kept noindex until the missing evidence is supplied.
Formula references
- Digital Library of Mathematical FunctionsNational Institute of Standards and Technology — Definitions, notation, identities, and reference material for mathematical functions.
Frequently asked questions
What is the Inclusion–Exclusion for Two Sets used for?
Counts elements in a union without counting the intersection twice.
Can I copy this formula as LaTeX?
Yes. Copy |A\cup B|=|A|+|B|-|A\cap B| or open it in the LaTeX editor.
What should I check before using it?
Confirm that each variable, unit, domain restriction, and assumption matches the problem.