Set Theory Question Generator
Two sets inside a stated universe, and the four operations that get asked about them. The identity worth carrying away is inclusion-exclusion: adding two set sizes counts everything in both of them twice, so the union is the sum minus the overlap. That is stated in the working with the actual numbers, and it is also the check this tool runs — along with confirming the four Venn regions add up to the whole universe with nothing counted twice.
What this generator does
Builds two subsets of a stated universe and asks for their union, intersection, difference and the complement of the first. The answer includes the four Venn region counts — only A, both, only B, neither — which is the picture the operations describe.
How to use this tool
- Choose how large the universe should be.
- Work out the union, intersection, difference and complement.
- Reveal the answers, with the counting check written out.
- Seed the question to set the same one for a group.
Understanding the controls
- How big is the universe
- Between 6 and 20 elements. Twelve is comfortable: large enough that the regions differ, small enough to list every set in full.
- Seed
- Reproduces the same two sets exactly, so a question can be set and marked later.
- Show the answer
- Reveals every operation along with the inclusion-exclusion arithmetic.
Common use cases
- Practice at the four basic set operations with concrete elements
- Introducing inclusion-exclusion as arithmetic rather than as a formula
- Reading off the four Venn regions from two sets
- Reinforcing that a complement depends on the universe you chose
- Reproducing the same sets for a printed exercise
How this generator works
Each element of the universe joins each set independently, so overlaps arise naturally rather than being planted. The check requires inclusion-exclusion to balance, the four regions to sum to the universe size, and the complement to be disjoint from its set and cover the rest exactly.
Randomness and fairness
Membership of each set is random; the operations and the identities are arithmetic. Seeded questions reproduce and are therefore explicitly not cryptographically secure. Unseeded ones use the browser's cryptographically secure generator.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- Two sets only. Three-set Venn diagrams have seven regions and are a noticeably harder question.
- Elements are the whole numbers up to the universe size, not named objects.
- No diagram is drawn — the regions are given as counts.
- Power sets, Cartesian products and cardinality arguments are not covered.
- Questions are not stored between visits.
Privacy and your data
Sets and operations are computed in your browser. Nothing you generate is transmitted or retained.
Related generators
- Matrix Question GeneratorMultiplication, determinant and inverse questions, with inverses built to have whole-number entries.
- Modular Arithmetic Question GeneratorRemainders, modular powers by repeated squaring, and inverses that only exist when the values are coprime.
- Probability Question GeneratorProbability questions built to order, from counters in a bag — single events, complements, either-or, and two draws with and without replacement.
- Random Sample GeneratorDraw a sample without replacement from your own list, and see exactly how many different samples were possible.