Combinatorics
Counting the ways…
Initializing Sorting Algorithms...
Sorting
Trees
Graphs
Preparing interactive visualizations...
Combinatorics
Counting the ways…
To count a union of overlapping sets, add the sets, subtract every pairwise overlap, add back the triple overlap — until each region of the Venn diagram is counted exactly once.
Which of the numbers 1 to 30 are divisible by 2, 3 or 5? Call the three sets A, B and C. Each circle is a set; the badge in every region will show how many times that region has been counted so far.
Each badge is a region's tally: how many of the switched-on terms contain it. The total is right exactly when every non-empty region reads ×1.