How the diagram splits the numbers 1 to 10
The default sample puts the even numbers in A, the multiples of 3 in B, and the primes in C. Three circles cut the rectangle into eight regions. Each number from 1 to 10 lands in exactly one.
- Only A 4, 8, 10
- Only B 9
- Only C 5, 7
- A ∩ B, outside C 6
- A ∩ C, outside B 2
- B ∩ C, outside A 3
- All three none, since no prime is both even and a multiple of 3
- Outside every circle 1, which is neither even, prime, nor a multiple of 3
The starting expression, (A ∪ B) ∩ C′, asks for numbers which are even or a multiple of 3 but not prime. The answer is {4, 6, 8, 9, 10}. Three regions light up: only A, only B, and the A ∩ B sliver outside C.
Expression syntax
Set names are A, B, C, and U, in upper or lower case. Every operator has a keyboard stand-in, so you never need the symbol keys.
| Operation | Symbol | Also accepted | Keeps elements |
|---|---|---|---|
| Union | A ∪ B | |+ | in either set |
| Intersection | A ∩ B | &* | in both sets |
| Difference | A − B | -\ | in A, missing from B |
| Symmetric difference | A △ B | ^ | in exactly one of the two |
| Complement | A′ | ' after, ~ before | in U, outside A |
| Empty set | ∅ | none | nothing |
Order of operations. Complement binds tightest, then ∩. Union, difference, and symmetric difference share one level and run left to right, so A − B ∪ C reads as (A − B) ∪ C. Textbooks disagree on these rules. Add brackets whenever a reader might stumble. A missing bracket or a stray symbol gets reported with its position.
Counting a course survey with inclusion-exclusion
The Course sign-ups sample tracks ten students across three short courses. A is Python, B is SQL, C is Excel. The question on most worksheets: how many students took at least one course?
|A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|
= 5 + 4 + 4 − 2 − 2 − 2 + 1
= 8Omar sits in all three circles. The single-set terms count Omar three times, the pair terms remove Omar three times, and the triple term adds Omar back once. Dmitri and Nia signed up for nothing, so (A ∪ B ∪ C)′ returns {Dmitri, Nia}. The counting panel prints the same sum with your own numbers, ready to copy into a written answer.
Checking De Morgan's laws
The two laws say (A ∪ B)′ = A′ ∩ B′ and (A ∩ B)′ = A′ ∪ B′. Type the left side, read the result and the shaded regions, then type the right side. Both sides return the same set for any input. Run the check on your homework sets before writing the formal proof, and you will see which regions the proof has to cover.
Where this calculator stops
- Elements are text. 1, 01, and 1.0 are three different elements. Apple and apple differ too.
- A comma always splits. An ordered pair such as (1,2) gets cut in two, which also rules out nested sets.
- Three sets maximum. A four-set Venn diagram needs ellipses, and the regions turn too thin to label. For overlaps across four or more lists, the list intersection tool fits better.
- Finite sets only. Set-builder notation like {x | x > 3} and infinite sets such as ℕ are not parsed.
- Areas mean nothing. Every circle has the same radius. Read sizes from the Count column, not from the picture.
- Crowded regions truncate. The diagram shows a few elements per region plus a +n marker. The region table lists all of them.
- Complement depends on U. Leave U blank and every complement returns ∅. Elements in A, B, or C but missing from U get flagged under the inputs.
