Skip to main content

Set Operations Calculator

Perform union, intersection, and difference on sets.

Reviewed for accuracy by the Math Ora X team Last updated

Result

About Set Operations Calculator

Union combines all elements, intersection finds common elements, difference finds elements in A but not B.

$$A \cup B, A \cap B, A \setminus B$$

How to use this calculator

  1. Enter the first set, for example \(A = \{1, 2, 3, 4\}\).
  2. Enter the second set, for example \(B = \{3, 4, 5\}\).
  3. Choose the operation you want, union \(A \cup B\), intersection \(A \cap B\), or difference \(A \setminus B\).
  4. Read the result, which lists the elements in the new set.

The formula explained

The formulas \(A \cup B\), \(A \cap B\), and \(A \setminus B\) compute the union, intersection, and difference of two sets. Union combines all unique elements, intersection keeps only common elements, and difference keeps elements in the first set that are not in the second.

  • A = the first set
  • B = the second set
  • \(\cup\) = union, all elements from either set without duplicates
  • \(\cap\) = intersection, elements common to both sets
  • \(\setminus\) = difference, elements in the first set but not in the second

Step by step method

  1. List the elements in each set clearly, without repeating any element inside a set.
  2. For union, collect every unique element that appears in either set.
  3. For intersection, keep only the elements that appear in both sets.
  4. For difference \(A \setminus B\), remove from \(A\) any elements that also appear in \(B\).

Worked example

Problem. Let \(A = \{1, 2, 3, 4\}\) and \(B = \{3, 4, 5\}\). Find \(A \cup B\), \(A \cap B\), and \(A \setminus B\).

  1. Union: combine all unique elements from both sets, so \(A \cup B = \{1, 2, 3, 4, 5\}\).
  2. Intersection: find the elements shared by both sets, so \(A \cap B = \{3, 4\}\).
  3. Difference: keep elements in \(A\) that are not in \(B\), so \(A \setminus B = \{1, 2\}\).

Answer. \(A \cup B = \{1, 2, 3, 4, 5\}\), \(A \cap B = \{3, 4\}\), and \(A \setminus B = \{1, 2\}\).

Tips and common mistakes

  • A set does not repeat elements, so write \(\{1, 1, 2\}\) as \(\{1, 2\}\).
  • Be careful with difference, because \(A \setminus B\) is not the same as \(B \setminus A\).

Frequently asked questions

How do I use the set operations calculator for union, intersection, and difference?+

Enter the elements of each set, usually separated by commas, then choose the operation you want, such as union, intersection, or difference. The calculator returns the resulting set instantly, based on the formula A \cup B, A \cap B, or A \setminus B.

What does the formula A ∪ B, A ∩ B, and A \setminus B mean?+

A ∪ B is the union, which includes every element in A or B. A ∩ B is the intersection, which includes only elements shared by both sets, and A \setminus B is the difference, which includes elements in A that are not in B.

What happens if the two sets have repeated elements or are written in a different order?+

Repeated elements do not change the result, because sets list each distinct element only once. The order of elements also does not affect the calculation, so {1, 2, 2, 3} is treated the same as {3, 2, 1}.

How should I interpret the result of a set difference like A \setminus B?+

A \setminus B means you start with all elements in A and remove any elements that also appear in B. For example, if A = {1, 2, 3} and B = {2, 4}, then A \setminus B = {1, 3}.

What is the difference between union, intersection, and difference?+

Union combines everything from both sets, intersection keeps only the common elements, and difference keeps only the elements unique to the first set. So each operation answers a different question about how two sets relate to each other.

More Mathematics Tools

Explore related calculators in this category

You Might Also Like

Popular tools from other categories

Can't Find the Right Calculator?

Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.

Try AI Solver

Browse All Categories

Home Mathematics Current Tool
Facebook Twitter WhatsApp