Writing down a set of numbers
Inequalities, interval notation and set-builder notation, and how to move between them.
A domain is a set of numbers, and sets of numbers turn up constantly once you start answering questions about functions. Saying the answer out loud is easy enough. Writing it in the form an examiner expects is a separate skill, and it is worth half an hour now to save marks later.
Start with the version you already write in code. Here is a test that decides whether a number belongs to a set. Run it and note which candidates get in.
Change -3 <= x to -3 < x and run it again. Exactly one line of output flips.
The set that test describes is every number from -3 up to but not including 5. The endpoint -3 is in because the test allows equality there. The endpoint 5 is out because it does not.
Written in mathematics that test is . The symbol is read as is less than or equal to, and it is what the code writes as <=. The symbol is read as is less than, with no equality allowed, and the code writes it the same way.
Interval notation
Interval notation writes that set as a pair of endpoints in brackets. A square bracket means the endpoint is included, a round bracket means it is excluded. So the set above is written .
The smaller number always goes on the left. There is no such interval as , and writing one is a wasted mark rather than an unusual set.
| Interval | Inequality | In words |
|---|---|---|
| Strictly between 2 and 7, neither end included | ||
| Between 2 and 7, both ends included | ||
| From 2 up to 7, 2 in and 7 out | ||
| From 2 up to 7, 2 out and 7 in |
When a set runs on forever in one direction, the symbol (read as infinity) takes the place of an endpoint, and does the same on the left. So is written , and is written .
Sets that come in two separate pieces are joined with the union symbol , which means take everything in either piece. The domain of is everything except 2, which is . Run the test for a two-piece set and watch the gap.
Change the test to x < 2 or x > 6 and run it again. The excluded set is now a whole stretch rather than a single number, and it needs the same union notation to describe what is left.
Set-builder notation
The other accepted way of writing a set describes it by its membership test rather than by its endpoints. Set-builder notation puts the variable, then a vertical bar meaning such that, then the condition.
Some books write a colon instead of the bar, as , and it means exactly the same. Set-builder is the better choice when the condition is not a simple stretch, for instance . The symbol is read as is not equal to, so that set is every real number except 2, and it needs no union at all.
| Inequality | Interval | Set-builder |
|---|---|---|
One worked example, done in full. Give the domain of in all three notations.
- The only danger is a zero on the bottom, so ask when .
- That happens at , so -3 is the one input to throw out.
- As an inequality: .
- As an interval: .
- As set-builder: .
Write the set of outputs of in interval notation.
. The smallest output is 3, reached at , so 3 is included and gets a square bracket. There is no largest output, so the right-hand end is with a round bracket.
Write the domain of in interval notation, and say where it starts.
, starting at 5. A square root refuses a negative input, so the inside must satisfy , that is . Equality is allowed, because is a perfectly good output, so the left end is a square bracket. There is no upper limit, so the right end is with a round bracket.