GCSE Link: None

A set is an unordered collection of items with no duplicates.

They are written in curly brackets, e.g. S = {123, -5, 10.1}. Note that {0, 0, 7} is not a set because it contains two zeroes.

As we learnt in 11.01 (Number Systems), the symbol ℕ represents the set of natural numbers, {0, 1, 2, 3, ...}, the symbol ℤ represents the set of integers, {0, 1, -1, 2, -2, ...}, and the symbols ℚ and ℝ represent the rationals and reals respectively. The empty set, {}, can also be written using the symbol ∅.


The notation x ∈ S is used to check if an item x is in the set S. We can use set comprehensions to compactly represent sets. Set comprehensions are of the form {expression | condition}. For example, {3x | x ∈ ℕ} represents the set {0, 3, 6, 9, ...}. In the condition, we can use the symbol ∧ to mean AND, and the symbol ∨ to mean OR. For example, the comprehension {3x | x ∈ ℕ ∧ x ≥ 10} represents the set {30, 33, 36, 39, ...}.


Sets can also contain strings. One way to write sets of strings is using notation such as {AnBn | n ≥ 2}, which would mean "at least two As followed by the same number of Bs", i.e. the set {AABB, AAABBB, AAAABBBB, ...}.


A finite set is one which ends at some point.

This means that you can count its elements using natural numbers, up to a point. The length of a finite set is called its cardinality. The set {123, -5, 10.1} is finite with cardinality 3.

An infinite set is one which never ends.

For example, the natural numbers, integers, rational numbers, and real numbers. A countably infinite set is one where every element of the set can be mapped to a different natural number. The natural numbers are obviously countably infinite, as are the integers: an example mapping could be {0: 0, 1: 1, 2: -1, 3: 2, 4: -2, ...}. The rational numbers and real numbers are uncountably infinite.



Write out the set represented by the comprehension {PmQn | m + n = 7}.

{PPPPPPP, PPPPPPQ, PPPPPQQ, PPPPQQQ, PPPQQQQ, PPQQQQQ, PQQQQQQ, QQQQQQQ}