MathematicsFoundation22 min read

Sets and Functions

Collections, the operations on them, and the rule that turns one set into another

This topic appears in:

01

A set is a collection with no argument about membership

A set is a well-defined collection of distinct objects. "Well-defined" is doing real work in that sentence: given any object, there must be no dispute about whether it belongs. "The set of prime numbers below 20" is a set. "The set of interesting numbers" is not, because nobody can settle the boundary.

Sets are written in three ways, and the paper expects you to move between them: descriptive ("the set of even numbers less than 10"), tabular or roster form ({2, 4, 6, 8}), and set-builder notation ({x | x is even, x < 10, x ∈ ℕ}).

Two conventions catch people out. Order does not matter, so {1, 2, 3} and {3, 1, 2} are the same set. And repetition does not count, so {1, 2, 2, 3} is just {1, 2, 3}.

TermMeaningExample
Subset A ⊆ Bevery element of A is in B{1,2} ⊆ {1,2,3}
Proper subset A ⊂ BA ⊆ B but A ≠ B{1,2} ⊂ {1,2,3}
Empty set { } or ∅a set with no elementsthe set of even primes above 2
Singletona set with exactly one element{0}
Equal setsexactly the same elements{a,b} = {b,a}
Equivalent setsthe same number of elements{1,2} and {p,q}
Power set P(A)the set of all subsets of AP({1,2}) has 2² = 4 members

∅ and {∅} are not the same thing

The empty set has no elements. The set {∅} has one element, and that element happens to be the empty set. Likewise {0} is not empty — it contains the number zero. The number of elements in P(A) is 2ⁿ where n is the number of elements of A, and the empty set is always one of them.

02

The four operations

Everything the chapter asks you to shade or calculate is built from four operations, and a Venn diagram settles every one of them faster than the algebra does.

  • Union A ∪ B — everything in A, or in B, or in both.
  • Intersection A ∩ B — only what is in both. If A ∩ B = ∅ the sets are disjoint.
  • Difference A − B — in A but not in B. Note that A − B and B − A are usually different sets.
  • Complement A′ — everything in the universal set U that is not in A. Always relative to some stated U.

Compare (A∪B)′ with what you get by shading A′ and B′ and taking the overlap. They are the same region — that is De Morgan's law, and shading it is a perfectly valid way to answer a "verify" question.

03

De Morgan's laws and the laws you can quote

These are worth memorising because "verify the following" is a standing exam question and quoting the law tells you what you are trying to reach.

(A ∪ B)′ = A′ ∩ B′(A ∩ B)′ = A′ ∪ B′A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)De Morgan first, then the two distributive laws

How to verify a set law for full marks

Take the sets you are given. Work out the left-hand side completely, listing its elements. Work out the right-hand side completely, listing its elements. Then write the sentence "the two sets have the same elements, so the law is verified". Marks are given for the two lists and for the concluding statement — skipping the conclusion is the commonest way to lose one.

04

From ordered pairs to relations

Once you can build sets you can build sets of pairs. The Cartesian product A × B is the set of all ordered pairs (a, b) with a ∈ A and b ∈ B. If A has m elements and B has n, then A × B has mn of them.

Order matters in an ordered pair: (2, 5) and (5, 2) are different, and in general A × B ≠ B × A.

A relation from A to B is any subset of A × B — any rule picking out some of the pairs. The set of first components is the domain; the set of second components is the range.

Worked example

A = {1, 2} and B = {p, q, r}. Write A × B and state how many relations from A to B exist.

  1. Pair every element of A with every element of B: A × B = {(1,p), (1,q), (1,r), (2,p), (2,q), (2,r)}.Work systematically — all pairs starting with 1, then all starting with 2 — so none is missed.
  2. Count: 2 × 3 = 6 ordered pairs.n(A × B) = n(A) × n(B), which is a useful check on your list.
  3. A relation is any subset of A × B, so the number of relations is the size of the power set: 2⁶ = 64.Each of the six pairs is either in the relation or not, independently — two choices, six times.

A × B has 6 elements; there are 64 possible relations.

05

A function is a relation that never hesitates

A function from A to B is a relation in which every element of A is paired with exactly one element of B. Two conditions, and both matter: nothing in the domain may be left out, and nothing in the domain may have two outputs.

That is the whole test. If any first component appears twice with different second components, it is a relation but not a function. Graphically this is the vertical line test: a vertical line drawn anywhere must cut the graph at most once.

TypeConditionPlain English
Intorange ⊆ B, some of B unusednot every output gets used
Onto (surjective)range = Bevery element of B is hit
One-one (injective)different inputs → different outputsno output is reused
Bijectiveone-one and onto togethera perfect pairing, so an inverse exists

The mistake that costs a mark every year

A function may send two different inputs to the same output — that is allowed, and it simply means the function is not one-one. What it may never do is send one input to two different outputs. Students reverse this constantly. f(x) = x² is a function even though f(2) and f(−2) are both 4.

Before you leave this chapter

  1. A set must be well defined; order and repetition are ignored.
  2. n(P(A)) = 2ⁿ, and ∅ is a subset of every set.
  3. De Morgan: complement of a union is the intersection of the complements, and vice versa.
  4. n(A × B) = n(A) × n(B), and (a, b) ≠ (b, a).
  5. Function = every input used, each input giving exactly one output. Two outputs for one input is fatal; two inputs sharing an output is fine.

Practice questions

6 questions · 20 marks · full working on every one

Try each one on paper first, then open the working. The marks are shown where they are actually awarded, because that is where they are actually lost.

Short questions

3 · 6 marks

Two marks each, in the style of the short-question section of the paper. Answer in two or three lines.

SQ1[2 marks]
Define a set and explain why "the set of tall students in a class" is not a set in the mathematical sense.
Model answer

A set is a well-defined collection of distinct objects, meaning that for any object it can be decided without dispute whether it belongs. "Tall" has no agreed boundary, so membership cannot be decided, and the collection is not well defined.

Examiner tip. The mark is for the phrase "well defined" plus a reason tied to the example. A definition without the phrase usually scores half.

SQ2[2 marks]
If A = {1, 2, 3}, write P(A) and state n(P(A)).
Model answer

P(A) = { ∅, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3} } and n(P(A)) = 2³ = 8.

Examiner tip. List them in order of size — empty set, singletons, pairs, the whole set. Working systematically is how you avoid missing one under time pressure.

SQ3[2 marks]
Distinguish between a relation and a function.
Model answer

A relation from A to B is any subset of A × B. A function is a relation in which every element of A appears exactly once as a first component — every input is used, and none has more than one output. So every function is a relation, but not every relation is a function.

Examiner tip. Finish with the containment sentence. It is often worth the second mark on its own.

Solved numericals

2 · 8 marks

Full working, one step per line, with the marks shown where they are awarded.

N1[4 marks]
U = {1,2,3,…,10}, A = {1,2,3,4,5} and B = {4,5,6,7}. Verify that (A ∪ B)′ = A′ ∩ B′.
Full working
  1. A ∪ B = {1,2,3,4,5,6,7}, so (A ∪ B)′ = {8,9,10}complement taken with respect to U[1]
  2. A′ = {6,7,8,9,10}[1]
  3. B′ = {1,2,3,8,9,10}, so A′ ∩ B′ = {8,9,10}[1]
  4. Both sides equal {8, 9, 10}, therefore the law is verifiedthe concluding statement is a mark in its own right[1]

Both sides equal {8, 9, 10}, so the law holds.

Examiner tip. Never abbreviate a verification. Every complement you take is a mark, and the final sentence saying the two sides agree is another.

N2[4 marks]
The relation R = {(1,2), (2,4), (3,6), (4,8)} is defined from A = {1,2,3,4} to B = {2,4,6,8}.
  1. State the domain and range of R.
  2. Determine, with a reason, whether R is a function.
  3. State whether it is one-one and whether it is onto.
Full working
  1. Domain = {1, 2, 3, 4}; Range = {2, 4, 6, 8}first components and second components respectively[1]
  2. R is a function, because every element of A appears exactly once as a first componenta reason is required, not just the verdict[1]
  3. It is one-one, since no two different inputs share an output[1]
  4. It is onto, since the range equals B and no element of B is unusedso R is a bijection[1]

(a) Domain {1,2,3,4}, Range {2,4,6,8} (b) yes, a function (c) one-one and onto, so bijective

Examiner tip. Notice the rule is f(x) = 2x. Spotting the rule is not required but it makes the one-one and onto checks instant.

Long questions

1 · 6 marks

Theory and numerical together, as they appear in the long-question section.

LQ1[6 marks]
In a class of 40 students, 24 study Physics, 20 study Chemistry and 8 study both.
  1. Draw a Venn diagram to represent this information.
  2. Find the number of students studying at least one of the two subjects.
  3. Find the number studying neither subject.
Mark scheme
  1. Two overlapping circles inside a rectangle labelled U, with 8 written in the overlapalways fill the intersection first[1]
  2. Physics only = 24 − 8 = 16; Chemistry only = 20 − 8 = 12the given totals include the overlap[1]
  3. Uses n(A ∪ B) = n(A) + n(B) − n(A ∩ B)the inclusion–exclusion principle[1]
  4. = 24 + 20 − 8 = 36 students study at least oneor 16 + 8 + 12 from the diagram[1]
  5. Neither = n(U) − n(A ∪ B)[1]
  6. = 40 − 36 = 4 students[1]

(b) 36 students (c) 4 students

Examiner tip. Subtracting the overlap once is the entire trick: adding 24 and 20 counts the 8 students who do both twice, which is why the formula takes one copy back off.