Results
Union = “at least one” (A or B or …). If you enter N, then none = N − union.
Show the formula used
—
Share URL: —
Examples
Tip: use “Regions” for 2–3 sets when you’re unsure which intersections you need.
Quick intuition (why the signs alternate)
If you add |A| + |B|, the overlap |A∩B| is counted twice, so you subtract it once. With 3 sets, the triple overlap is subtracted too many times, so you add it back. That’s why the sign flips with the intersection size.
- Typical use cases: surveys (multiple choices), class tests, and deduplicating overlapping segments in reports.
- Independence is a different assumption (probability), not part of inclusion–exclusion itself.
How to use inclusion-exclusion
Choose whether you know set sizes and intersections or Venn regions. The calculator then alternates add and subtract terms so overlapping members are counted once.
How it works
For two sets the union is |A| + |B| - |A∩B|. For three or more sets, pairwise overlaps are subtracted and higher-order overlaps are added back. If you enter a universe size, the tool also reports none and at-least-one probabilities.
When to use
Use it for survey responses with multiple choices, class rosters with overlapping groups, report deduplication, or classroom Venn diagram checks. It is a counting method; independence is a separate probability assumption.
Common mistakes to avoid
- Entering an intersection larger than one of its parent sets.
- Mixing Venn region counts with total intersection counts in the same run.
- Forgetting the universe size when you want none or at-least-one probabilities.
- Treating independence as automatic instead of computing or entering intersections explicitly.
See also
FAQ
What is the inclusion–exclusion principle?
It is a formula for counting “at least one” by adding single-set sizes, subtracting pairwise intersections, adding triple intersections, and so on with alternating signs.
How do I compute “A or B”?
For 2 sets: |A∪B| = |A| + |B| − |A∩B|. This tool shows the union immediately once all required fields are filled.
Do I need intersections to compute the union?
Yes. Intersections represent items counted multiple times. For 2–3 sets, the “Venn regions” mode lets you input regions directly so you don’t have to think about which intersections are needed.
Why do I see an inconsistency warning?
If an intersection is larger than a subset (e.g., |A∩B| > |A|) or if derived exact regions become negative, the inputs cannot describe real sets. The tool warns you so you don’t trust a wrong count.
Is independence the same as inclusion–exclusion?
No. Inclusion–exclusion is about counting overlaps. Independence is a probabilistic assumption that may help compute intersections, but it is not part of the counting formula itself.
Can I compute “none”?
Yes. If you enter the universe size N, then none = N − union and both probabilities are shown.