calculator.onl
Categories50

Finite set operations calculator

Find unions, intersections, differences, symmetric differences and Cartesian products of two explicit finite sets.

A worked example

Switch from union to intersection and see which tokens stay in the result tray.

Result{1; 3; 5; 7; 9; 2}n6n(A∩B)3
A: Separate list items with semicolons; decimal commas are allowed. Follow the item limit shown for the field.

B: Separate list items with semicolons; decimal commas are allowed. Follow the item limit shown for the field.

Mode: A∪B / A∩B / A∖B / B∖A / A△B / A×B

Updates as you type

Use a dot or comma for decimals. No thousands separators.

YOUR RESULT

Result

{1; 3; 5; 7; 9; 2}

Calculated from your inputs

n6
n(A)5
n(B)4
n(A∩B)3
The numbers, at a glance

Calculations run in your browser.
UNDERSTAND THE RESULT

A little context. A clearer answer.

↑ Back to calculator

When this calculator is useful

Keep every distinct element for union, common members for intersection and one-sided members for differences. Symmetric difference combines the two one-sided parts. Cartesian product contains ordered pairs with the first entry from A and the second from B. Display order follows first occurrence. For a related calculation, try Boolean logic, truth table and Karnaugh map calculator.

What to enter

InputWhat it meansExample value
AA: Separate list items with semicolons; decimal commas are allowed. Follow the item limit shown for the field.1;3;5;7;9
BB: Separate list items with semicolons; decimal commas are allowed. Follow the item limit shown for the field.2;3;5;7
ModeMode: A∪B / A∩B / A∖B / B∖A / A△B / A×BA∪B

How the calculation works

  1. Change the inputs to explore your own scenario. A: Separate list items with semicolons; decimal commas are allowed. Follow the item limit shown for the field.; B: Separate list items with semicolons; decimal commas are allowed. Follow the item limit shown for the field.; Mode: A∪B / A∩B / A∖B / B∖A / A△B / A×B.
  2. A∪B; A∩B; A∖B; B∖A; A△B; A×B={(a,b): a∈A,b∈B}
  3. Separate textual elements with semicolons or new lines, without braces. Blank input means the empty set. Duplicates are removed after trimming outer spaces; comparison is case sensitive and treats 1 and 01 as different text. Maximum 50 entries per input and 60 characters per element. No infinite sets, expression evaluation or implicit numeric conversion.
The formulaA∪B; A∩B; A∖B; B∖A; A△B; A×B={(a,b): a∈A,b∈B}

A worked example

In the OpenStax example, A contains 1, 3, 5, 7, 9 and B contains 2, 3, 5, 7. Their common elements are 3, 5 and 7. Only 1 and 9 are in A alone. The union contains six distinct elements and the Cartesian product has 5 × 4 = 20 ordered pairs. Empty B to see both the intersection and product become empty while the union stays equal to A.

Example you can load

What to enter
Result for this example · Result{1; 3; 5; 7; 9; 2}

This is a fixed example; changing the form above does not change these numbers.

Assumptions & limits

Separate textual elements with semicolons or new lines, without braces. Blank input means the empty set. Duplicates are removed after trimming outer spaces; comparison is case sensitive and treats 1 and 01 as different text. Maximum 50 entries per input and 60 characters per element. No infinite sets, expression evaluation or implicit numeric conversion.

Frequently asked questions

Are repeated values counted twice?

No. A set contains each distinct trimmed text element once.

Are 1 and 01 equal here?

No. Elements are compared as text, with case preserved.

Is A×B the same as B×A?

The number of pairs is equal, but their order matters: (a, b) is different from (b, a) in general.