Set Operations Calculator
Perform union, intersection, and difference on sets.
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
- Enter the first set, for example \(A = \{1, 2, 3, 4\}\).
- Enter the second set, for example \(B = \{3, 4, 5\}\).
- Choose the operation you want, union \(A \cup B\), intersection \(A \cap B\), or difference \(A \setminus B\).
- 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
- List the elements in each set clearly, without repeating any element inside a set.
- For union, collect every unique element that appears in either set.
- For intersection, keep only the elements that appear in both sets.
- 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\).
- Union: combine all unique elements from both sets, so \(A \cup B = \{1, 2, 3, 4, 5\}\).
- Intersection: find the elements shared by both sets, so \(A \cap B = \{3, 4\}\).
- 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
Absolute Value Calculator
Calculate the absolute value of any number. Use this free calculator for fast, accurate answers, complete with the formula and a worked example.
Absolute Value Equation Solver
Solve equations of the form |ax + b| = c.
Adding Fractions Calculator
Add two fractions with step-by-step simplification.
One-Way ANOVA Calculator
Perform one-way ANOVA on multiple groups.
You Might Also Like
Popular tools from other categories
AC to DC Converter Calculator
Convert AC voltage to DC voltage for different rectifier configurations. Free online calculator with instant, step-by-step results.
Acid-Base Titration Calculator
Calculate concentration from titration data. Get quick, accurate results with this free online calculator, including formulas and worked examples.
ABV Calculator
Calculate alcohol by volume from original and final gravity. Free calculator with instant calculations, the underlying formula, and an easy-to-follow example.
Amortization Schedule Calculator - Free Online
Free Generate a complete amortization schedule. Step-by-step solutions and formulas included. Free, accurate results with step-by-step explanations.
Can't Find the Right Calculator?
Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.