Every exam season there is one problem that shows up with cricket and football, or tea and coffee, or Hindi and Sanskrit. The numbers change; the shape never does. Some students like A, some like B, some like both, some like neither — you are asked how many fall in each region of the Venn diagram.

Rather than solve one version, this page gives you a slider you can drive. Change how many students like cricket, how many like football, and how many like both — and watch the Venn diagram auto-fill in real time. When the slider values are impossible (overlap bigger than either single group), the numbers tell you so.

The rule every survey problem uses

Start with a class of N students. Let A be the set who like the first activity, B the set who like the second. Only three numbers are given:

|A|, \quad |B|, \quad |A \cap B|.

From these, every other region-count follows by subtraction.

Why: the crescent "only A" is A with the overlap removed, so its size is |A| minus the overlap. The union adds both single counts, but because the overlap was counted twice, you subtract it once — the inclusion-exclusion formula. The "neither" region is whatever remains after the union is taken out of the universe.

That is the entire toolkit. The slider below applies it.

The auto-fill generator

Drag the three red points to set |A| (cricket fans), |B| (football fans), and |A \cap B| (both). The class has N = 100 students throughout. The readouts below the diagram show every region filled in.

Interactive survey-problem Venn generator with three draggable controlsA rectangle containing two overlapping circles labelled cricket and football. Three sliders at the bottom control the number who like cricket, the number who like football, and the number who like both. Readouts in the diagram show the computed numbers in each region: only cricket, only football, both, and neither. The totals obey inclusion-exclusion. U = 100 students cricket (A) football (B) only A both only B neither drag the three red points (top: |A|, middle: |B|, bottom: both)
Three red points on three horizontal rails. The top rail controls $|A|$, the middle controls $|B|$, the bottom controls $|A \cap B|$. The numbers inside each Venn region are computed live. When the overlap exceeds either single set size or forces the union past $100$, the status readout flips to "impossible" — the only invariant the generator enforces.

Try it with the textbook numbers: |A| = 60, |B| = 40, |A \cap B| = 20. The Venn fills as "only cricket = 40, both = 20, only football = 20, neither = 20." Check: 40 + 20 + 20 + 20 = 100 — every student placed, no double counting.

Why the middle number cannot exceed the sides

If a student is in A \cap B, they are also in A and also in B — that is the definition of the intersection. So the overlap count has to sit under both single counts:

|A \cap B| \le |A| \quad \text{and} \quad |A \cap B| \le |B|.

The moment you drag the "both" slider above the smaller of the two set sizes, the generator marks the state as impossible. In a real survey, this failure means someone double-counted or misread the question.

The union cannot exceed the universe

Inclusion-exclusion gives |A \cup B| = |A| + |B| - |A \cap B|. If this number turns out greater than N, the data is inconsistent — more students like at least one sport than there are students in total. The fix, when this happens in an exam, is always the same: the overlap count was reported too low. Raise |A \cap B| until |A \cup B| drops to N or below.

A worked survey example

Of $100$ students, $60$ like cricket, $40$ like football, and $20$ like both. How many like neither?

Step 1. Recognise the three given numbers as |A|, |B|, |A \cap B|.

Step 2. Apply inclusion-exclusion.

|A \cup B| = 60 + 40 - 20 = 80

Why: 60 + 40 = 100 counts the students who like both twice. Subtracting 20 removes the double count. The net is the number who like at least one sport.

Step 3. Subtract from N = 100 to get "neither."

|(A \cup B)'| = 100 - 80 = 20

Result. 20 students like neither cricket nor football.

Region check. Only cricket = 60 - 20 = 40. Only football = 40 - 20 = 20. Both = 20. Neither = 20. Total = 40 + 20 + 20 + 20 = 100. Every student accounted for.

Every survey-style Venn problem in NCERT, RD Sharma, and JEE Main collapses to this same four-step routine: read three numbers, apply inclusion-exclusion, subtract from the total, check the four regions sum to N.

The three-set upgrade

When a third activity enters — badminton, say — the generator logic gets richer. You need seven numbers to fix every region: the three singles |A|, |B|, |C|, the three pairwise overlaps |A \cap B|, |A \cap C|, |B \cap C|, and the triple overlap |A \cap B \cap C|. Inclusion-exclusion for three sets,

|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C|,

is the same idea extended one level deeper. The three-set Venn zone explorer is the matching generator for that case.

Related: Set Operations · Inclusion-Exclusion Calculator · Three-Set Venn Diagram · Animated Venn Diagrams