General Aptitude

Venn diagrams and sets

Part 1 of 2 · 17 min

Two sets, four regions

The concept

Start with something familiar

A teacher asks her class of 40: "Hands up if you drink tea." 25 hands go up. "Now hands up if you drink coffee." 20 hands go up. That's 25+20=4525 + 20 = 45 hands, from only 40 students.
Nobody has two hands up at once, so what happened? 10 students raised their hand both times. They drink tea and coffee, so the teacher counted them twice. Take the double count away and 45−10=3545 - 10 = 35 students drink at least one of the two. The other 40−35=540 - 35 = 5 drink neither.
In the syllogisms lesson you asked whether a region of a Venn diagram was empty or not. Here you put a number in each region. Almost every set question in GATE is about counting people without counting anyone twice.

Idea 1: two groups split everyone into four regions

Draw two overlapping circles, A (tea) and B (coffee), inside a box for the whole class. Every student lands in exactly one of four regions:
  • Only A: in A, not in B (tea only).
  • Only B: in B, not in A (coffee only).
  • Both: in the overlap.
  • Neither: inside the box, outside both circles.
For the class of 40:
Only AOnly BBothNeither
1510105
Play with it
TeaCoffee1510105

Tap a phrase to light up the regions it means.

Each student is in one region and only one, so the four numbers add up to the total: 15+10+10+5=4015 + 10 + 10 + 5 = 40. And a whole circle is made of two regions: tea drinkers are "only A" plus "both", 15+10=2515 + 10 = 25.
Key idea
Every person sits in exactly one region, so the four regions add up to the total, and each circle is "only" plus "both".
A=only A+bothTotal=only A+only B+both+neither\begin{aligned} A &= \text{only } A + \text{both} \\ \text{Total} &= \text{only } A + \text{only } B \\ &\quad + \text{both} + \text{neither} \end{aligned}
Example
In a group, 18 people speak only Hindi and 12 speak both Hindi and Marathi. How many speak Hindi?
The Hindi circle is "only Hindi" plus "both": 18+12=3018 + 12 = 30.

Idea 2: the union is A plus B, minus the overlap once

"At least one of A and B" is called the union of A and B. It is the three regions inside the circles: only A, only B and both.
When you add A+BA + B, the "only" regions are counted once each, but the "both" region is counted twice: once inside A and again inside B. Subtract it once and every person is counted exactly once:
RegionIn A+BA + BAfter −both-\text{both}
Only Aonceonce
Only Bonceonce
Bothtwiceonce
At least one=A+B−both\text{At least one} = A + B - \text{both}
Example
In a class of 60, 35 students like Hindi films, 28 like English films and 15 like both. How many like at least one?
35+28−15=4835 + 28 - 15 = 48.

Idea 3: "only A" means take the overlap out of A

When a question says "like only Hindi films", it means the people in A who are not in B. Start with the whole circle and remove the overlap:only A=A−bothonly B=B−both\begin{aligned} \text{only } A &= A - \text{both} \\ \text{only } B &= B - \text{both} \end{aligned}"Exactly one of the two" is the two "only" regions together. Here each circle loses the overlap, so it is subtracted twice:Exactly one=A+B−2×both\text{Exactly one} = A + B - 2 \times \text{both}
Example
Same class: 35 like Hindi films, 28 like English films, 15 like both. How many like only Hindi, only English, and exactly one?
Only Hindi: 35−15=2035 - 15 = 20. Only English: 28−15=1328 - 15 = 13. Exactly one: 20+13=3320 + 13 = 33, which is also 35+28−2×15=3335 + 28 - 2 \times 15 = 33.

Idea 4: neither, at least one, at most one

The box holds everyone, so whatever is not inside a circle is "neither":Neither=Total−(A+B−both)\text{Neither} = \text{Total} - (A + B - \text{both})The phrases GATE uses map onto regions like this:
PhraseRegions
at least oneonly A, only B, both
exactly oneonly A, only B
at most oneonly A, only B, neither
neither, noneneither
"At most one" means zero or one, so it is everyone except the people in both: Total−both\text{Total} - \text{both}.
Example
Class of 60, with 48 liking at least one kind of film and 15 liking both. How many like neither, and how many like at most one?
Neither: 60−48=1260 - 48 = 12. At most one: 60−15=4560 - 15 = 45. Check: 20+13+12=4520 + 13 + 12 = 45. ✓

Idea 5: the overlap has a floor and a ceiling

Sometimes a question doesn't give the overlap and asks for its smallest or largest possible value. Take 100 office workers, where 70 drink tea and 60 drink coffee.
Ceiling. The overlap can't be bigger than the smaller circle. At most all 60 coffee drinkers also drink tea, so both ≤60\le 60.
Floor. Count the people who are not in both. They are missing from tea or from coffee. Only 100−70=30100 - 70 = 30 people skip tea and 100−60=40100 - 60 = 40 skip coffee, so at most 30+40=7030 + 40 = 70 people miss out on one. That leaves at least 100−70=30100 - 70 = 30 in both.
BothAt least oneNeither
30 (least)1000
60 (most)7030
both≥max⁡(0, A+B−Total)both≤smaller of A,B\begin{aligned} \text{both} &\ge \max(0,\ A + B - \text{Total}) \\ \text{both} &\le \text{smaller of } A, B \end{aligned}
Example
100 workers: 70 drink tea, 60 drink coffee. What is the smallest and largest number who drink both?
Smallest: 70+60−100=3070 + 60 - 100 = 30. Largest: the smaller group, 6060. So both lies from 30 to 60.

Idea 6: set symbols name the same regions

GATE sometimes writes sets in symbols, each a region you know:
SymbolRead asMeans
A∪BA \cup BA union Bat least one
A∩BA \cap BA intersection Bboth
A′A'complement of Aoutside A
A⊆BA \subseteq BA is a subset of Bevery member of A is in B
n(A)n(A)size of Ahow many in A
"Neither" is n((A∪B)′)n((A \cup B)'). If A⊆BA \subseteq B, circle A sits inside B, so A∩B=AA \cap B = A and A∪B=BA \cup B = B. A set of nn members has 2n2^n subsets, empty set and whole set included, since each member is in or out.
Key idea
n(A∪B)=n(A)+n(B)−n(A∩B)n(A \cup B) = n(A) + n(B) - n(A \cap B), and a set of nn members has 2n2^n subsets.
Example
List the subsets of {1,2,3}\{1, 2, 3\}.
{}\{\}, {1}\{1\}, {2}\{2\}, {3}\{3\}, {1,2}\{1, 2\}, {1,3}\{1, 3\}, {2,3}\{2, 3\}, {1,2,3}\{1, 2, 3\}: that is 23=82^3 = 8.

How to spot which idea you need

The question says...Use
region counts, find a group or the totalIdea 1: regions add up
"at least one", "A or B", "either"Idea 2: A+B−bothA + B - \text{both}
"only A", "exactly one"Idea 3: remove the overlap
"neither", "none", "at most one"Idea 4: total minus a part
"least / most possible", "at least ... both"Idea 5: floor and ceiling
∪\cup, ∩\cap, A′A', "subsets"Idea 6: symbols and 2n2^n

Worked example 1warm-up

In a class of 50 students, 30 play cricket, 25 play football and 12 play both. How many play only cricket, exactly one game, and neither?
Solution
Step 1. Fill the overlap firstIdea 1: the regions
Both =12= 12.
Step 2. Find the "only" regionsIdea 3
Only cricket =30−12=18= 30 - 12 = 18. Only football =25−12=13= 25 - 12 = 13.
Step 3. Exactly oneIdea 3
18+13=3118 + 13 = 31.
Step 4. NeitherIdeas 2 and 4
At least one is 30+25−12=4330 + 25 - 12 = 43, so neither is 50−43=750 - 43 = 7.
Step 5. Answer and check
Only cricket 18, exactly one 31, neither 7. The four regions add up: 18+13+12+7=5018 + 13 + 12 + 7 = 50.

Worked example 2GATE level

In an exam, 65% of the students passed Mathematics, 50% passed Physics and 20% failed both. If 175 students passed both subjects, how many students wrote the exam, and how many passed only Mathematics?
Solution
Step 1. Find the unionIdea 4
20% failed both, so 100−20=80%100 - 20 = 80\% passed at least one.
Step 2. Find the overlapIdea 2, solved for both
80=65+50−both80 = 65 + 50 - \text{both}, so both =115−80=35%= 115 - 80 = 35\%.
Step 3. Turn the percentage into people
35% of the students is 175, so the total is 1750.35=500\dfrac{175}{0.35} = 500.
Step 4. Only MathematicsIdea 3
65−35=30%65 - 35 = 30\% of 500 =150= 150.
Step 5. Answer and check
500 students, 150 passed only Mathematics. In people: only Maths 150, only Physics 7575, both 175, neither 100. Total 150+75+175+100=500150 + 75 + 175 + 100 = 500.

All the equations at a glance

IdeaEquation
Regionstotal == sum of the four regions
At least oneA+B−bothA + B - \text{both}
Only AA−bothA - \text{both}
Exactly oneA+B−2×bothA + B - 2 \times \text{both}
Neithertotal −- at least one
At most onetotal −- both
Overlap rangeA+B−totalA + B - \text{total} up to the smaller set