A three-set survey question ends with "how many students belong to exactly two of the three sets?" A student who has not internalised the pattern starts drawing a Venn diagram, fills in regions from the centre outward, and adds up three specific zones. A student who has internalised the pattern writes one formula and the answer.

The formula is:

|\text{exactly two of } A, B, C| = |A \cap B| + |A \cap C| + |B \cap C| - 3|A \cap B \cap C|

That is: add the three pairwise intersections, subtract three times the triple intersection. The arithmetic takes a single line once you have the six cardinalities.

The recognition cue

The trigger phrase is any of these:

All mean the same thing: the person belongs to two of the three sets and not the third. In a three-set Venn diagram, this is three specific regions — the three pairwise-overlap-but-not-centre zones.

Three-set Venn diagram with the three 'exactly two' regions shadedThree overlapping circles labelled A, B, and C form a symmetric three-set Venn diagram inside a rectangle. The three regions where exactly two circles overlap but not the third are shaded. The central region where all three circles overlap is not shaded. The three exclusive-only regions and the outside are also not shaded. U A B C A∩B∩C (not shaded)
The three shaded crescents are the "exactly two" regions: in $A$ and $B$ but not $C$, in $A$ and $C$ but not $B$, and in $B$ and $C$ but not $A$. The central region $A \cap B \cap C$ is deliberately left unshaded because it is not "exactly two" — it is "all three." The formula counts the three shaded crescents.

Why the formula works

Each pairwise intersection A \cap B contains two kinds of elements:

So |A \cap B| = |\text{exactly } A B| + |A \cap B \cap C|. Rearranging:

|\text{exactly } AB| = |A \cap B| - |A \cap B \cap C|

Similarly for the other two pairs:

|\text{exactly } AC| = |A \cap C| - |A \cap B \cap C|
|\text{exactly } BC| = |B \cap C| - |A \cap B \cap C|

Adding the three "exactly two" counts:

|\text{exactly two}| = |A \cap B| + |A \cap C| + |B \cap C| - 3|A \cap B \cap C|

The -3|A \cap B \cap C| comes from the three separate subtractions, one per pairwise intersection. That is the whole derivation — three lines.

Walked mini-examples

Example 1. In a class of 50 students, 30 study maths, 25 study physics, 20 study chemistry. 15 study maths and physics, 12 study physics and chemistry, 10 study maths and chemistry, 8 study all three. How many study exactly two subjects?

Given: |M \cap P| = 15, |P \cap C| = 12, |M \cap C| = 10, |M \cap P \cap C| = 8. Apply:

|\text{exactly two}| = 15 + 12 + 10 - 3 \times 8 = 37 - 24 = 13

13 students study exactly two subjects.

Example 2. A town survey says 60 people use WhatsApp, 50 use Instagram, 40 use Facebook. 30 use WhatsApp and Instagram, 25 use Instagram and Facebook, 20 use WhatsApp and Facebook, 15 use all three. How many use exactly two?

|\text{exactly two}| = 30 + 25 + 20 - 3 \times 15 = 75 - 45 = 30

30 people use exactly two apps.

Example 3. Sanity check via direct region counting. Take the numbers from Example 1. Fill the Venn diagram:

Add the three "exactly two" regions: 7 + 4 + 2 = 13. Matches the formula.

The companion formulas

The same derivation pattern gives the other "exactly k" counts in a three-set problem. Memorise the set:

Exactly one (in A only, or B only, or C only):

|\text{exactly one}| = |A| + |B| + |C| - 2(|A \cap B| + |A \cap C| + |B \cap C|) + 3|A \cap B \cap C|

Exactly two (in two of the three):

|\text{exactly two}| = |A \cap B| + |A \cap C| + |B \cap C| - 3|A \cap B \cap C|

Exactly three (in all three):

|\text{exactly three}| = |A \cap B \cap C|

Sum of all three "exactly k" counts equals |A \cup B \cup C|, which is the inclusion-exclusion total. Every "exactly k" question for a three-set problem is a single formula away from the given data.

The companion cue: "at least two"

Sometimes the question says "at least two," which differs from "exactly two" by the triple overlap. The relation is:

|\text{at least two}| = |\text{exactly two}| + |\text{exactly three}|
= \big(|A \cap B| + |A \cap C| + |B \cap C| - 3|A \cap B \cap C|\big) + |A \cap B \cap C|
= |A \cap B| + |A \cap C| + |B \cap C| - 2|A \cap B \cap C|

The coefficient on the triple intersection is -2 for "at least two," but -3 for "exactly two." Getting the coefficient wrong is the single most common error on this family of problems — the mini-derivation from "each pairwise intersection double-counts the triple" keeps you honest.

Summary table worth putting on your rough sheet:

Question Formula
"exactly two of A, B, C" $\sum
"at least two of A, B, C" $\sum
"exactly three of A, B, C" $
"at least one of A, B, C" $

The exam reflex

The whole skill is pattern recognition. Once you have seen the formula and its derivation three times, the "exactly two" phrase goes from "draw a Venn diagram" to "write the one-liner" — and that shift saves you two minutes per problem in every three-set survey you ever face.

Related: Set Operations · Inclusion-Exclusion vs Direct Venn Counting · Three-Set Venn: Where to Start · Given |A|, |B|, |A ∪ B|