Inclusion-Exclusion Calculator

Use inclusion-exclusion to count the union of two or three overlapping sets. This educational calculator shows the result, explains the rule, and gives step-by-step reasoning.

High SchoolCollegeDiscrete Math

Calculator

|A|
|B|
|C| (optional)
|A ∩ B|
|A ∩ C|
|B ∩ C|
|A ∩ B ∩ C|
Please enter valid values.

What this calculator teaches

Use inclusion-exclusion to count the union of two or three overlapping sets.

Discrete mathematics is the foundation for logic, algorithms, data structures, graphs, combinatorics, and many computer-science topics. These calculators are designed to support learning rather than replace reasoning.

Formula & Symbols

ConceptFormula or rule
Two sets|A ∪ B| = |A| + |B| − |A ∩ B|
Three sets|A ∪ B ∪ C| = |A|+|B|+|C|−|AB|−|AC|−|BC|+|ABC|

Worked Example

Example
Try the default values
  • Keep the default inputs in the calculator.
  • Click Calculate to see the result and steps.
  • Change one input and compare how the answer changes.
The calculator output explains both the answer and the method.

When to use it

🎓
Students
Practice discrete mathematics with clear examples and interpretable outputs.
💻
Computer science
Connect the math to algorithms, logic, data structures, and theoretical CS topics.
🧠
Problem solving
Use the calculator result as a guide, then study the steps to understand the method.

Common mistakes

⚠️
Mixing notation with the actual set.

Enter only the elements or pairs requested. Avoid extra words unless they are part of the element names.

⚠️
Forgetting edge cases.

Discrete math often depends on empty sets, repeated items, self-pairs, and direction. Check these carefully.

⚠️
Treating a count as a proof.

A calculator can check examples, but proofs require explaining why the rule works for all valid cases.

Related calculators

FAQ

What is the Inclusion-Exclusion Calculator?▾
Use inclusion-exclusion to count the union of two or three overlapping sets.
Is this for high school, college, or computer science?▾
This page is most useful for discrete mathematics and computer-science mathematics, but many topics also appear in advanced high-school or college courses.
Can I use this result as homework proof?▾
Use it as a learning check. For proof-based assignments, write the reasoning in complete sentences and justify every step.
Why are repeated set elements ignored?▾
In standard set notation, repeated elements are counted once. For lists or multisets, the counting rules may be different.
Why does CalcNovaHub show steps?▾
The goal is not only to calculate the answer but to explain the reasoning so students can learn the method.

Formula Explorer connections

Interpretation: This relationship counts discrete structures, analyzes logic and sets, or describes algorithmic growth. Assumption: Define the sample space, recurrence, logical variables and counting constraints precisely. Avoid double counting and distinguish worst, average and best cases.

Karnaugh Map Calculator →Logic Expression Simplifier Calculator →Logical Equivalence Checker Calculator →Math Formula Explorer →