Skip to main content
Logo image

Section 5.5 Set-Builder Notation

Set-builder notation describes a set by giving the properties of its elements. We write sets in set-builder notation in the form
\begin{equation*} \{x\mid\text{ (properties of } x)\}\text{,} \end{equation*}
where (properties of \(x\)) stands for conditions that fully describe the elements of the set. The bar (\(\mid\)) separates the elements from their properties. We read the bar as “such that,” and we read the whole set as “the set of all elements \(x\) such that (properties of \(x\)).” We use a variable (here \(x\)) to state the properties of the elements in the set.
With a concrete example we show, how set builder is read and interpreted.

Example 5.5.1. Reading set-builder notation.

We consider the set
\begin{equation*} A=\{x\mid x\in\N \text{ and } x\lt 6\}\text{.} \end{equation*}
We read this as
\(A\) is equal to the set of all elements \(x\) such that \(x\) is a natural number and \(x\) is less than \(6\text{.}\)
Notice how we use \(x\) to formulate the properties of the elements in the set. Knowing what the elements of the set of natural numbers \(\N\) and that the set \(A\) only contains numbers that are less than \(6\) we find that the set \(A\) written in roster form is
\begin{equation*} \{ 1,2,3,4,5 \}\text{.} \end{equation*}
In the example above two properties of the elements in the set were given. Now we consider a set defined by four properties of its elements.

Problem 5.5.2. Four properties.

Give the set in roster form.
\begin{equation*} \{ x \mid x \in\Z \text{ and } x \gt 12 \text{ and } x \lt 20 \text{ and } x \fmod 3 = 1\} \end{equation*}
Solution.
We go through the conditions on the elements of the set one by one.
The first property is \(x\in\Z\text{,}\) so the possible values for \(x\) are:
\begin{equation*} \dots,\,-2,\,-1,\,0,\,1,\,0,\,1,\,2,\dots \end{equation*}
The first two properties are \(x \in\Z\) and \(x \gt 12 \text{,}\) so the possible values for \(x\) are:
\begin{equation*} 13,\,14,\,15,\,16,\,17,\dots \end{equation*}
The first three properties are \(x \in\Z\) and \(x \gt 12\) and \(x \lt 20\text{,}\) so the possible values for \(x\) are:
\begin{equation*} 13,\,14,\,15,\,16,\,17,\,18,\,19 \end{equation*}
Now we find the elements that satisfy all four properties \(x \in\Z\) and \(x \gt 12 \) and \(x \lt 20\) and \(x \fmod 3 = 1\text{,}\) that is we find all values of \(x\) from the list above that satisfy \(x \fmod 3 = 1\text{:}\)
\begin{gather*} 13 \fmod 3 = 1\\ 14 \fmod 3 = 2\\ 15 \fmod 3 = 0\\ 16 \fmod 3 = 1\\ 17 \fmod 3 = 2\\ 18 \fmod 3 = 0\\ 19 \fmod 3 = 1 \end{gather*}
So the elements satisfying all four properties are \(13\) and \(16\) and \(19\text{.}\) Thus
\begin{equation*} \{ x \mid x \in\Z \text{ and } x \gt 12 \text{ and } x \lt 20 \text{ and } x \fmod 3 = 1\} =\{13,16,19\}. \end{equation*}
In the video in Figure 5.5.3 we review the definition of set-builder notation. We also give examples of sets written in set-builder notation.
Figure 5.5.3. Set-Builder Notation by Matt Farmer and Stephen Steward
There are several ways of representing the same set. We can describe the same set verbally, in roster form, or in roster form with ellipsis. Set-builder notation gives even more ways of representing the same set.

Example 5.5.4. A set written in three ways.

There are many ways of describing the same set using set-builder notation:
  1. \(\displaystyle \{x\mid x \text{ is a natural number from \(4\) to \(8\) } \} = \{4,5,6,7,8\}\)
  2. \(\displaystyle \{x\mid x \in \mathbb{N} \text{ and } x>3 \text{ and } x\lt 9\} = \{4,5,6,7,8\}\)
  3. \(\displaystyle \{x\mid x \in \mathbb{N} \text{ and } x \geq 4 \text{ and } x \leq 8\} = \{4,5,6,7,8\}\)
Many sets that we have seen before can also be formulated in set builder notation.

Example 5.5.5. Selected sets in set-builder notation.

We formulate some familiar sets in set-builder notation.
  1. \(\{x\mid x\in\Z \text{ and } x>0\}\) is the set of positive integers, also known as the set of natural numbers.
  2. \(\{x\mid x\in\N\text{ and } x\fmod 2=0\}=\{2,4,6,8,\dots\}\) is the set of even natural numbers.
  3. \(\{x\mid x\in\N\text{ and } x\fmod 2=1\}=\{1,3,5,7,\dots\}\) is the set of odd natural numbers.
  4. \(\{x\mid x\in\N \text{ and } x\lt 0\}=\{\,\}\) as there are no natural numbers that are less than zero.
We represent some special sets in set-builder notation.

Example 5.5.6. Special sets in set-builder notation.

We give special sets from the previous section in set builder notation. Let \(m\in\N\text{.}\)
  • \(\Z_m=\{x\mid x\in\Z \text{ and } x\ge0 \text{ and } x\lt m\}\text{.}\)
  • \(\Z_m^\otimes=\{x\mid x\in\Z \text{ and } x>0 \text{ and } x\lt m\}\text{.}\)