Union and Intersection Calculator

Set theory is a fundamental branch of mathematics that deals with collections of objects, known as sets. Two of the most basic operations you can perform on sets are finding their union and their intersection. These concepts allow us to understand how different sets relate to each other—what they share in common and what their total combined collection looks like. Our Union and Intersection Calculator is a simple tool that helps students and data enthusiasts quickly perform these operations, providing a clear visual of the resulting sets.

How to Use the Union and Intersection Calculator

Finding the union and intersection of your sets is easy:

  1. Enter Set A: Input the elements of your first set into the designated field. Separate each element with a comma or a space.
  2. Enter Set B: Input the elements of your second set in the same way.
  3. Calculate: Click the "Calculate" button.
  4. View the Results: The calculator will display two new sets: the intersection of A and B, and the union of A and B.

Understanding Set Operations

Imagine you have two baskets of fruit. Set A contains {apple, banana, orange} and Set B contains {orange, grape, pear}. Set operations let us ask specific questions about what's in those baskets.

Intersection (A ∩ B): What Do They Have in Common?

The intersection of two sets, denoted by the symbol ∩, is a new set containing only the elements that are present in both Set A and Set B. It's the "overlap" between the two sets.

In our fruit basket example, the only fruit that is in both baskets is the orange. Therefore, the intersection is:

A ∩ B = {orange}

If two sets have no elements in common, their intersection is the "empty set," denoted as {} or ∅.

Union (A ∪ B): What Do We Have All Together?

The union of two sets, denoted by the symbol ∪, is a new set containing all the unique elements that appear in either Set A or Set B (or both). It's the total collection of all distinct items from both sets combined.

For our fruit basket example, the union would include every type of fruit present across both baskets:

A ∪ B = {apple, banana, orange, grape, pear}

Notice that "orange," even though it appears in both original sets, is only listed once in the union. This is because a fundamental property of a set is that it only contains distinct, unique elements.

Visualizing with Venn Diagrams

A Venn diagram is the perfect visual tool for understanding union and intersection. It uses overlapping circles to represent sets.

Applications in Data and Logic

These simple set operations are the foundation of database queries, logical reasoning, and probability.

Frequently Asked Questions

What if my sets have duplicate elements?

By definition, a set only contains distinct elements. If you enter a list with duplicates, like "1, 2, 2, 3", the calculator will treat it as the set {1, 2, 3}. All duplicates are automatically removed before the operations are performed.

What is the "difference" of two sets?

The difference, A - B, is another set operation. It results in a set containing all the elements that are in A but *not* in B. Using our fruit example, A - B would be {apple, banana}.

How does this relate to interval notation?

The concepts are identical. Finding the intersection or union of two intervals on a number line is a geometric application of these same set theory rules. You can explore this with our Interval Notation Calculator.

Related calculators