Racira Calculator

Set Operations Calculator

Elements can be numbers or words; duplicates are removed.

The Four Core Set Operations

Given two sets A and B, the four fundamental operations answer every question about how their elements relate. The union A ∪ B is everything in either set; the intersection A ∩ B is what they share; the difference A − B is what belongs only to A; and the symmetric difference A △ B is everything in exactly one of them.

Set Sizes and the Inclusion–Exclusion Principle

Counting the union naively — adding |A| and |B| — double-counts the shared elements, so the correct formula subtracts them once: |A ∪ B| = |A| + |B| − |A ∩ B|. This calculator verifies that identity on your own sets in the summary panel, turning the result into a self-checking calculation.

Where Sets Appear in Practice

Database queries (UNION, INTERSECT, EXCEPT), spreadsheet filters, tagging systems, and probability all run on set operations under the hood. Because a set discards order and duplicates, it is also the natural model for 'which customers bought X or Y' style analytics — exactly what this tool computes in one pass.

Frequently Asked Questions

Related Calculators