1.5 - Set notation and counting elements

1.5 - Set notation and counting elements

You will use algebra to define sets, distinguish elements from subsets, and count overlapping groups without counting anyone twice. Set sizes help you solve practical problems even when no list of names is available. Start with membership, complements and Venn regions, then add a careful counting method.

Algebraically defined sets (Higher)

Can 4040 people produce club membership totals of 2222, 2020 and 1717 without a mistake? Those totals add to 5959. The answer depends on who belongs to more than one club; you will resolve it in the last part.

You already know

In a Venn diagram, the overlap belongs to both sets. Inequalities such as x<3x<3 exclude the endpoint, while x≤3x\leq3 includes it.

Sometimes a rule is shorter than a list. In {x:x is an integer, −2<x≤3}\{x:x\text{ is an integer},\ -2<x\leq3\}, read the colon as “such that”. The variable names a candidate; the words and inequalities decide whether it belongs.

Set-builder notation and set size

Set-builder notation describes a set by a rule for its elements. The notation n(A)n(A) means the number of elements in the finite set AA. For example, A={2,4,6}A=\{2,4,6\} is a set, while n(A)=3n(A)=3 is a number.

State the domain, such as integers. A real-number interval would include numbers between the integers too. Neither set-builder notation nor set-size rules are supplied on the Higher formulae sheet; they are not Foundation requirements.

Worked example 1: list an integer-defined set

Question. List A={x:x is an integer, −2<x≤3}A=\{x:x\text{ is an integer},\ -2<x\leq3\} and state n(A)n(A).

Plan. Decide which endpoints are allowed, list the integers between them, then count.

−2<x≤3⇒x=−1,0,1,2,3exclude the lower endpointA={−1,0,1,2,3}write the setn(A)=5count distinct entries\begin{aligned} -2<x\leq3&\quad\Rightarrow\quad x=-1,0,1,2,3 && \text{exclude the lower endpoint}\\ A&=\{-1,0,1,2,3\} && \text{write the set}\\ n(A)&=5 && \text{count distinct entries} \end{aligned}

Why start at −1-1? The strict inequality rules out −2-2, and −1-1 is the next integer.

Answer. A={−1,0,1,2,3}A=\{-1,0,1,2,3\}, n(A)=5n(A)=5.

Check. Every listed number satisfies both inequalities; the neighbouring integers −2-2 and 44 do not.

Change only the lower inequality from strict to inclusive. One extra integer now qualifies.

Worked example 2: include an endpoint

Question. List B={x:x is an integer, −2≤x≤3}B=\{x:x\text{ is an integer},\ -2\leq x\leq3\} and state n(B)n(B).

Plan. Include both endpoints, then list and count the integers.

−2≤x≤3⇒x=−2,−1,0,1,2,3include both endpointsB={−2,−1,0,1,2,3}write the setn(B)=6count the entries\begin{aligned} -2\leq x\leq3&\quad\Rightarrow\quad x=-2,-1,0,1,2,3 && \text{include both endpoints}\\ B&=\{-2,-1,0,1,2,3\} && \text{write the set}\\ n(B)&=6 && \text{count the entries} \end{aligned}

Why count zero? It is an integer and satisfies both bounds, so it is an element like any other.

Answer. B={−2,−1,0,1,2,3}B=\{-2,-1,0,1,2,3\}, n(B)=6n(B)=6.

Check. This list contains exactly the earlier five elements plus −2-2.

The set and its size answer different questions.

Watch out

Writing n(A)={−1,0,1,2,3}n(A)=\{-1,0,1,2,3\} confuses a number with a set. Write A={−1,0,1,2,3}A=\{-1,0,1,2,3\} and n(A)=5n(A)=5. Braces belong around the elements, not around the count.

Try new bounds. Read each endpoint separately before you list anything.

Elements and subsets (Higher)

A single shared member does not make one set part of another. Compare A={1,2,3,4}A=\{1,2,3,4\} with B={2,4}B=\{2,4\}: every member of BB belongs to AA. That is a stronger statement than saying the two sets overlap.

Subset

A set BB is a subset of AA if every element of BB belongs to AA. Use B⊂AB\subset A in this course. A proper subset has at least one element of AA missing; for example, {2,4}\{2,4\} is a proper subset of {1,2,3,4}\{1,2,3,4\}.

To establish the relationship, check all elements of the smaller set. To disprove it, one counterexample is enough. For instance, D={2,5}D=\{2,5\} is not a subset of AA, because 55 is missing from AA. The shared member 22 cannot rescue the claim.

Be precise about what you are comparing. The statement 2∈B2\in B compares an element with a set. The statement {2}⊂B\{2\}\subset B compares two sets. In a Venn diagram, a subset's curve lies wholly inside the containing set's curve; partial overlap alone does not show a subset.

The empty set is a subset of every set: it has no member that could fail the membership test. If two sets have exactly the same elements, say they are equal. If the distinction matters, state “proper subset” or “equal” explicitly, since symbol conventions can vary. Subset notation and these facts are not supplied on the Higher formulae sheet.

Key idea

“Every element belongs” proves a subset relationship; one element outside disproves it. Use ∈\in for an element and ⊂\subset for a set.

A set's size alone cannot settle the question either. The sets {1,2}\{1,2\} and {3,4}\{3,4\} have the same size but share no element. Look at membership, not just totals.

Counting disjoint Venn regions (Higher)

A number in a Venn region can be a frequency rather than an individual element. Read the caption. In this diagram, 99 means nine learners in AA only; it does not mean that the number 99 is an element of AA.

[DIAGRAM: asset_slug: sets_venn_counts; caption: Numbers of learners in the four disjoint regions; description: Rectangle E and overlapping circles A and B. A only has count 9, intersection has count 5, B only count 6, neither count 3. These are frequencies not individual elements and areas are not to scale.; file: sets_venn_counts.png; recommended_method: matplotlib]
Numbers of learners in the four disjoint regions

Read whole circles by including the overlap: here n(A)=9+5=14n(A)=9+5=14, n(B)=5+6=11n(B)=5+6=11, and n(E)=9+5+6+3=23n(\mathrm{E})=9+5+6+3=23. The region counts do not overlap, so you can add them directly.

Counting two overlapping sets

n(A∪B)=n(A)+n(B)−n(A∩B)n(A\cup B)=n(A)+n(B)-n(A\cap B)

For finite sets, subtract the intersection once because it appears in both set totals. The number in neither is n(E)−n(A∪B)n(\mathrm{E})-n(A\cup B). Higher: not supplied. Not in the formulae sheet: learn it.

Start with the shared region, subtract it from each circle total, then use the universal total for the outside region. Each resulting count must be a nonnegative integer.

Worked example 3: find the four regions

Question. Of 3030 students, 1818 belong to AA, 1515 to BB, and 77 to both. Find the numbers in AA only, BB only and neither.

Plan. Enter the overlap first, then subtract it from each set total and from the universal total as needed.

A only=18−7=11remove the overlapB only=15−7=8remove the overlapn(A∪B)=11+7+8=26add disjoint regionsneither=30−26=4use the universe\begin{aligned} A\text{ only}&=18-7=11 && \text{remove the overlap}\\ B\text{ only}&=15-7=8 && \text{remove the overlap}\\ n(A\cup B)&=11+7+8=26 && \text{add disjoint regions}\\ \text{neither}&=30-26=4 && \text{use the universe} \end{aligned}

Why subtract 77 from both totals? Each total already includes those shared students, who have their own region.

Answer. 1111 in AA only, 88 in BB only, and 44 in neither.

Check. 11+7=1811+7=18, 8+7=158+7=15, and 11+7+8+4=3011+7+8+4=30.

Change only the overlap from 77 to 88. The circle totals stay fixed, so both “only” regions become smaller.

Worked example 4: a larger overlap

Question. Of 3030 students, 1818 belong to AA, 1515 to BB, and 88 to both. Find the numbers in AA only, BB only and neither.

Plan. Use the new overlap in the same region method.

A only=18−8=10subtract the new overlapB only=15−8=7subtract the new overlapn(A∪B)=10+8+7=25add regions onceneither=30−25=5find the remainder\begin{aligned} A\text{ only}&=18-8=10 && \text{subtract the new overlap}\\ B\text{ only}&=15-8=7 && \text{subtract the new overlap}\\ n(A\cup B)&=10+8+7=25 && \text{add regions once}\\ \text{neither}&=30-25=5 && \text{find the remainder} \end{aligned}

Why does the union shrink? With fixed set totals, more shared people means fewer distinct people overall.

Answer. 1010 in AA only, 77 in BB only, and 55 in neither.

Check. 18+15−8=2518+15-8=25, agreeing with the sum of the internal regions.

Language tells you which regions to add. “Exactly one” excludes the overlap; “at least one” includes it.

Watch out

Writing n(A∪B)=18+15=33n(A\cup B)=18+15=33 double counts the shared students. For Worked example 44, the correct line is 18+15−8=2518+15-8=25. A union cannot exceed its universe of 3030.

Use fresh survey totals and find the union before the outside count.

Practical problems with overlapping groups (Higher)

With three sets, begin where all three overlap. A pairwise total such as n(A∩B)n(A\cap B) normally includes the people in all three sets. Subtract the triple intersection to obtain “AA and BB only”. Then work outwards to the single-set regions.

For the opening puzzle, let A,B,CA,B,C be three clubs. A person can contribute to two or three club totals, but still occupies one region of the diagram. “Memberships” and “people” are different totals.

Worked example 5: three clubs

Question. There are 4040 people. Club totals are n(A)=22n(A)=22, n(B)=20n(B)=20, n(C)=17n(C)=17. The pairwise totals are n(A∩B)=9n(A\cap B)=9, n(A∩C)=8n(A\cap C)=8, n(B∩C)=7n(B\cap C)=7, each including the 33 people in all three. Find the numbers in each region and in none.

Plan. Place the triple count, remove it from each pair total, then use the club totals for the single regions.

AB only=9−3=6remove the triple countAC only=8−3=5remove the triple countBC only=7−3=4remove the triple countA only=22−6−5−3=8complete the A circleB only=20−6−4−3=7complete the B circleC only=17−5−4−3=5complete the C circle\begin{aligned} AB\text{ only}&=9-3=6 && \text{remove the triple count}\\ AC\text{ only}&=8-3=5 && \text{remove the triple count}\\ BC\text{ only}&=7-3=4 && \text{remove the triple count}\\ A\text{ only}&=22-6-5-3=8 && \text{complete the A circle}\\ B\text{ only}&=20-6-4-3=7 && \text{complete the B circle}\\ C\text{ only}&=17-5-4-3=5 && \text{complete the C circle} \end{aligned}

Why remove the triple count from each pair total? Those people already have a central region; they are not in a pair-only region as well.

n(A∪B∪C)=8+7+5+6+5+4+3=38add seven disjoint regionsnone=40−38=2use the whole group\begin{aligned} n(A\cup B\cup C)&=8+7+5+6+5+4+3=38 && \text{add seven disjoint regions}\\ \text{none}&=40-38=2 && \text{use the whole group} \end{aligned}

Answer. The diagram below gives all eight region counts, including 22 in none.

Check. The circles total 8+6+5+3=228+6+5+3=22, 7+6+4+3=207+6+4+3=20, and 5+5+4+3=175+5+4+3=17. All regions total 4040.

Read the diagram as frequencies. The central 33 contributes to every circle total, but to the universal total only once.

[DIAGRAM: asset_slug: sets_three_club_counts; caption: Forty people sorted into the eight regions of three clubs; description: Rectangle E contains three overlapping circles A, B and C. A only 8, B only 7, C only 5, AB only 6, AC only 5, BC only 4, all three 3, and none 2. Counts are frequencies and circle areas are not to scale.; file: sets_three_club_counts.png; recommended_method: matplotlib]
Forty people sorted into the eight regions of three clubs

Now change only the triple count, from 33 to 44. Keep the club totals and pairwise totals fixed. Recalculate every region affected by the change.

Worked example 6: change the central overlap

Question. For 4040 people, the club totals remain 22,20,1722,20,17 and the pairwise totals remain 9,8,79,8,7 for AB,AC,BCAB,AC,BC. Now 44 people belong to all three. Find the number in none.

Plan. Rebuild pair-only and single-only counts using the new central count, then total the union.

AB only,AC only,BC only=5,4,3subtract four from each pairA only=22−5−4−4=9complete AB only=20−5−3−4=8complete BC only=17−4−3−4=6complete Cunion=9+8+6+5+4+3+4=39add each region oncenone=40−39=1subtract from the universe\begin{aligned} AB\text{ only},AC\text{ only},BC\text{ only} &=5,4,3 && \text{subtract four from each pair}\\ A\text{ only}&=22-5-4-4=9 && \text{complete A}\\ B\text{ only}&=20-5-3-4=8 && \text{complete B}\\ C\text{ only}&=17-4-3-4=6 && \text{complete C}\\ \text{union}&=9+8+6+5+4+3+4=39 && \text{add each region once}\\ \text{none}&=40-39=1 && \text{subtract from the universe} \end{aligned}

Why redo the outer regions? Fixed circle totals must still be recovered when the central count changes.

Answer. 11 person belongs to none of the clubs.

Check. 9+5+4+4=229+5+4+4=22, 8+5+3+4=208+5+3+4=20, 6+4+3+4=176+4+3+4=17, and 39+1=4039+1=40.

Here is a surprising consequence: with the same three club totals and pairwise totals, the number of distinct members rose from 3838 to 3939. The larger triple overlap forced changes in the other six regions. You cannot reason about one region in isolation. This counting method is not supplied on the Higher formulae sheet.

Watch out

Putting 99 in the ABAB-only region in Worked example 55 is wrong: it includes the central 33 again. Write 9−3=69-3=6 there. Negative region counts or an overlap larger than a whole set signal inconsistent data or interpretation.

A useful final check is to reconstruct each original total. Checking only the grand total can miss a value placed in the wrong region.

Problem-solving

Translate “both”, “only”, “at least one” and “none” into regions before calculating. In three sets, start at the centre and work outwards.

The opening totals are possible: 3838 of the 4040 people can hold 5959 memberships between them, with 22 people in no club. Apply the same reasoning to a new group.

Quick Recap

  • Set-builder notation needs a domain and a rule; n(A)n(A) is a number, not a set.
  • A subset requires every member to belong; one counterexample disproves the claim.
  • Count disjoint regions once. Whole-set totals include their overlaps.
  • For three sets, place the triple intersection first, then pair-only regions, then single-only regions and none.

Yes, the opening totals 22,20,1722,20,17 are possible for 4040 people: the first club diagram has 3838 people in at least one club and 22 in none. Adding memberships counts some people more than once.