Interval and set-builder notation
The condition x \ge 3 is met by endlessly many numbers, and there is no next number after 3 to start a list with. How can a whole stretch of the number line be written down in a few symbols?
Where you are 7 in Inequalities
Why this exists
The condition x \ge 3 is met by 3, by 4, by 3.5, by 1000, and by numbers as close above 3 as anyone cares to name. A roster cannot hold them: a list with an ellipsis needs a next entry, and there is no next number after 3, since halfway between 3 and any number above it is a smaller number still above 3.
A graph on the number line shows the set perfectly, with a filled dot at 3 and shading to the right. But a drawing does not fit in a sentence.
Mathematics uses two written forms instead. Set-builder notation writes the rule in symbols. Interval notation writes only the ends. A stretch of the line with no gaps is fixed by where it starts, where it stops, and whether it keeps each end, and interval notation records exactly those three things.
Definition
Set-builder notation. The set of all objects that meet a condition is written
and read “the set of all x such that x is greater than or equal to 3”. The braces are the same braces as a roster, but instead of a list they hold a letter standing for a typical member, a bar, and the condition. The elements are exactly the objects that meet the condition. Some books write a colon for the bar, \{x : x \ge 3\}, with the same meaning.
The letter is only a placeholder: \{t \mid t \ge 3\} is the same set as \{x \mid x \ge 3\}. Unless the condition says otherwise, the letter stands for a real number. The condition can narrow that down: \{x \mid x \text{ is an integer and } x \ge 3\} is \{3, 4, 5, \dots\}, a different set from \{x \mid x \ge 3\}, which also holds 3.5.
Intervals. An interval is a set of real numbers with no gaps: all the numbers between two endpoints, or all the numbers on one side of one endpoint, or every real number. Interval notation writes the left endpoint, a comma, then the right endpoint, smaller number first, and marks each end.
- A square bracket, [ or ], means that endpoint is in the set.
- A parenthesis, ( or ), means that endpoint is left out.
- When the set has no end on the right, the right endpoint is written \infty, read “infinity”; with no end on the left, -\infty, read “negative infinity”. These are not numbers. They say “the set carries on for ever in this direction”, and they always take a parenthesis.
With a < b, every interval has one of these nine forms.
| Inequality | Set-builder | Interval |
|---|---|---|
| a < x < b | \{x \mid a < x < b\} | (a, b) |
| a \le x \le b | \{x \mid a \le x \le b\} | [a, b] |
| a \le x < b | \{x \mid a \le x < b\} | [a, b) |
| a < x \le b | \{x \mid a < x \le b\} | (a, b] |
| x > a | \{x \mid x > a\} | (a, \infty) |
| x \ge a | \{x \mid x \ge a\} | [a, \infty) |
| x < b | \{x \mid x < b\} | (-\infty, b) |
| x \le b | \{x \mid x \le b\} | (-\infty, b] |
| any x | \{x \mid x \text{ is real}\} | (-\infty, \infty) |
[a, b] is called a closed interval, (a, b) an open interval, and [a, b) and (a, b] half-open.
Union. A condition joined by “or” can give a set in separate pieces, such as the numbers with x < -2 or x \ge 5. Each piece is written as an interval and the pieces are joined with \cup, read “union”:
is the set of numbers that lie in at least one of the two pieces. Union for sets of every kind is the subject of union and intersection.
Intuition
The brackets copy the dots of the graph. A filled dot keeps its number in, and so does a square bracket; an open circle leaves its number out, and so does a parenthesis. The comma stands for the shading: everything between is in. An arrow running off the drawing becomes \infty or -\infty.
The order follows the line: the smaller endpoint is written first, so -\infty can only appear on the left and \infty only on the right.
Results
One set, four descriptions. The inequality x \ge 3, the set \{x \mid x \ge 3\}, the interval [3, \infty), and the graph with a filled dot at 3 and shading to the right all describe exactly the same numbers.
An interval has no gaps. If p and q belong to an interval and p < r < q, then r belongs to it too. So a set with a gap is not a single interval, and needs \cup to join its pieces.
Equal endpoints. [a, a] = \{a\}, a set with exactly one element. The intervals (a, a), [a, a) and (a, a] are all the empty set, \varnothing.
Why it is true
Why \infty never takes a bracket. A bracket says “this endpoint is a member of the set”. The members of [3, \infty) are real numbers, and \infty is not one. If some real number M were the largest, M + 1 would be larger, so there is no largest real number for \infty to be. A bracket at \infty would claim a member that does not exist.
Why an interval has no gaps. Take [a, b], with p and q in it and p < r < q. From a \le p and p < r, it follows that a < r. From r < q and q \le b, it follows that r < b. So a \le r \le b, and r is in [a, b]. The same chain works for every other form in the table; when one side runs to \infty or -\infty, there is only one side to check.
Why equal endpoints give one number or none. Every real number x is less than 3, equal to 3 or greater than 3, and exactly one of the three holds.
- [3, 3] = \{x \mid 3 \le x \le 3\}. A number less than 3 fails 3 \le x, and a number greater than 3 fails x \le 3. The number 3 passes both. So [3, 3] = \{3\}.
- (3, 3) = \{x \mid 3 < x < 3\}. A member would have to be greater than 3 and less than 3 at once, and no number is. So (3, 3) = \varnothing.
- [3, 3) asks for 3 \le x and x < 3, and (3, 3] for 3 < x and x \le 3. Neither pair can hold at once, so both sets are empty.
Worked examples
From an inequality to an interval
Write each set in interval notation and in set-builder notation, and describe its graph.
(a) x > -9
(b) x \le \tfrac{7}{2}
(c) -6 \le x < 1
Solution(a) The numbers greater than -9 run to the right with no end. The left endpoint -9 is left out, because the inequality is strict, so it takes a parenthesis; the right end is \infty, also with a parenthesis.
The graph has an open circle at -9, shading to the right and an arrow.
(b) The stretch runs left for ever and stops at \tfrac{7}{2}, which is included because the inequality allows equality. So the interval is (-\infty, \tfrac{7}{2}], or \{x \mid x \le \tfrac{7}{2}\}. The graph has a filled dot at \tfrac{7}{2} = 3.5, shading to the left and an arrow.
(c) The left end -6 is included (\le), so it takes a bracket; the right end 1 is left out (<), so it takes a parenthesis.
The graph has a filled dot at -6, an open circle at 1 and shading between them. As a check, -6 belongs (-6 \le -6), 1 does not (1 < 1 is false), and 0.99 does.
From an interval back to an inequality
Write each interval as an inequality and say in words which numbers it holds.
(a) (0, 8]
(b) (-\infty, -5)
(c) [-1, \infty)
Then decide which of 0, \tfrac{1}{100}, 8 and 8.5 belong to (0, 8].
Solution(a) The parenthesis at 0 leaves 0 out, so 0 < x; the bracket at 8 keeps 8 in, so x \le 8. Together, 0 < x \le 8: the numbers greater than 0 and at most 8.
(b) No left end, and -5 left out: x < -5, the numbers less than -5.
(c) -1 kept in and no right end: x \ge -1, the numbers greater than or equal to -1.
Now the four numbers against 0 < x \le 8.
- 0: the condition 0 < 0 is false, so 0 is not in (0, 8].
- \tfrac{1}{100}: 0 < \tfrac{1}{100} \le 8, so it is in. The interval holds numbers as close to 0 as anyone likes; it leaves out only 0 itself.
- 8: 0 < 8 \le 8, so it is in, as the bracket says.
- 8.5: 8.5 \le 8 is false, so it is not in.
Intervals from a context
(a) A hiking backpack’s water bladder holds at most 3 liters. Write the set of amounts of water v, in liters, that can be in it, in set-builder and interval notation.
(b) A cinema sells a youth ticket to anyone aged at least 12 and under 18. Write the set of ages as an interval. Then write it as a roster of ages counted in whole years.
Solution(a) “At most 3” is v \le 3. But the inequality alone would allow v = -1, and an amount of water cannot be negative. An empty bladder holds 0 liters, which is allowed. So the context supplies the left endpoint, and both ends are included:
Writing (-\infty, 3] would describe the inequality, not the amounts.
(b) With a the exact age in years, “at least 12” is 12 \le a and “under 18” is a < 18, so the ages are [12, 18): every age from 12 up to but not including 18. Someone aged 17 years and 11 months has a \approx 17.9, which is in; on the eighteenth birthday a = 18, which is not.
Counted in whole years, as ages usually are, the same people have one of six ages, 12 to 17:
This set has gaps between its elements, so it is not an interval. What the letter stands for decides the set, and set-builder notation lets the condition say so.
Two pieces joined by a union
(a) Write the set of numbers with x < -2 or x \ge 5 in interval notation, and decide whether -2, 0 and 5 belong to it.
(b) Write the set of all real numbers except 2.
Solution(a) Each condition gives a ray: x < -2 is (-\infty, -2) and x \ge 5 is [5, \infty). “Or” means a number belongs when it meets at least one of the conditions, which is the union:
- -2: -2 < -2 is false and -2 \ge 5 is false, so -2 is not in the set.
- 0: fails both, since it lies in the gap between the pieces.
- 5: 5 \ge 5 is true, so 5 is in the set.
(b) A real number other than 2 is either less than 2 or greater than 2. So the set \{x \mid x \ne 2\} is
The parenthesis on both sides of 2 says 2 is in neither piece. The graph is the whole line with an open circle at 2.
One number or none
Say what each set contains.
(a) [-2, -2]
(b) (-2, -2)
(c) [7, 7)
(d) \{x \mid x^2 \le 0\}
(e) \{x \mid x^2 < 0\}
Solution(a) The condition is -2 \le x \le -2, which only x = -2 meets. So [-2, -2] = \{-2\}.
(b) The condition is -2 < x < -2: greater than -2 and less than -2 at once. No number does both, so (-2, -2) = \varnothing.
(c) The condition 7 \le x < 7 would make x both at least 7 and less than 7. So [7, 7) = \varnothing.
(d) The square of a real number is never negative, and it is 0 only when the number is 0. So x^2 \le 0 forces x = 0. The set is \{0\}, which is the interval [0, 0]. The condition does not look like an interval, but the set it describes is one.
(e) No real number has a negative square, so \{x \mid x^2 < 0\} = \varnothing.
Interval or point?
Kenzo is reading four sentences, each with a pair of numbers in parentheses. In each, does the pair name an interval or a point?
(a) “x is a number in (-2, 7).”
(b) “The line y = 3x + 13 passes through (-2, 7).”
(c) “(-2, 7) contains \pi.”
(d) “Plot (7, -2).”
SolutionThe same symbols are used for two different things: an open interval of numbers, and a point in the coordinate plane with x-coordinate first and y-coordinate second. Only the context tells them apart.
(a) An interval. “A number in” asks for membership of a set of numbers, so the sentence says -2 < x < 7.
(b) A point. A line passes through points. Here x = -2 and y = 7, and 3(-2) + 13 = 7, so the point is on the line.
(c) An interval. A point is a single location and contains nothing. As an interval, (-2, 7) contains \pi \approx 3.14, because -2 < \pi < 7.
(d) A point. Plotting is done to points, and the order is a second clue: an interval always writes the smaller endpoint first, and 7 > -2.
Boundaries
- Only sets of real numbers with no gaps are intervals. A set with a gap is a union of intervals; a set of separate numbers, such as \{12, 13, \dots, 17\}, is written as a roster.
- Set-builder notation depends on what the letter stands for: real numbers, unless the condition narrows it.
- \infty and -\infty are not numbers, so they are never members and never take a bracket.
- The smaller endpoint comes first. A reversed pair such as (5, 2) is never used as an interval; read through its condition 5 < x < 2, it would be empty.
- (a, b) is also a point, and square brackets are also grouping symbols, as in 2[x + 3(x - 1)]. When the sentence does not settle it, say “the interval (a, b)” or “the point (a, b)”.
Where this goes next
Every inequality solved from here on has a solution set that interval notation can write: linear inequalities and multi-step inequalities give rays, and compound inequalities give a single interval for an “and” and, often, a union for an “or”. Absolute value inequalities and quadratic inequalities produce both shapes. A graph’s domain and range are usually read off as intervals. And union and intersection takes \cup, and its partner \cap for “and”, to sets of every kind.
Exercises
Writing intervals
Write each set in interval notation and in set-builder notation, and describe its graph.
- x \ge -11
- x < 0
- -5 < x \le 9
- \tfrac{1}{3} \le x \le 2
- 11 > x
- -8 < x
Reading intervals
- Write [-4, 6) as an inequality and in set-builder notation, and describe its graph.
- Write (-\infty, -3] as an inequality and say in words which numbers it holds.
- Write (2, \infty) in set-builder notation.
- Which of -3, 0, 5, 5.5 and 6 belong to (-3, 5.5]?
Gaps and unions
- A graph has an open circle at -6 with shading to the left and an arrow, and a filled dot at 1 with shading to the right and an arrow. Write the set it shows in interval notation and in set-builder notation.
- Write the set of all real numbers except -3 in interval notation.
- Write the set of numbers with x \le 0 or x > 10 in interval notation.
- Write [-2, 3) \cup [3, 7] as a single interval, and explain why it is one.
Contexts and special cases
- A glass dish is marked safe in an oven up to and including 230^\circ\text{C}. Linnea’s oven dial runs from 50^\circ\text{C} to 250^\circ\text{C}. Write the dial settings at which the dish is safe as an interval.
- Say what each set contains: (a) [9, 9]; (b) (9, 9]; (c) \{x \mid x \le -1 \text{ and } x \ge -1\}.
- Write \{x \mid x \text{ is an integer and } -2 \le x < 3\} as a roster, and say how it differs from the interval [-2, 3).
Reasoning
- Idris-Lee writes the numbers with x \ge 12 as [12, \infty]. Explain what is wrong.
- Hesper says that (2, 5) and (5, 2) are the same thing written in a different order. Explain why she is wrong whether the symbols name points or intervals.
- Explain why \{x \mid x \ne 0\} is not a single interval.
Answers
- [-11, \infty), \{x \mid x \ge -11\}. Filled dot at -11, shading right, arrow.
- (-\infty, 0), \{x \mid x < 0\}. Open circle at 0, shading left, arrow.
- (-5, 9], \{x \mid -5 < x \le 9\}. Open circle at -5, filled dot at 9, shading between.
- [\tfrac{1}{3}, 2], \{x \mid \tfrac{1}{3} \le x \le 2\}. Filled dots at \tfrac{1}{3} and 2, shading between.
- (-\infty, 11), \{x \mid x < 11\}, since 11 > x says x is less than 11. Open circle at 11, shading left, arrow.
- (-8, \infty), \{x \mid x > -8\}. Open circle at -8, shading right, arrow.
- -4 \le x < 6, \{x \mid -4 \le x < 6\}. Filled dot at -4, open circle at 6, shading between.
- x \le -3: the numbers less than or equal to -3.
- \{x \mid x > 2\}.
- 0, 5 and 5.5. The condition is -3 < x \le 5.5: -3 fails -3 < -3, and 6 fails 6 \le 5.5.
- (-\infty, -6) \cup [1, \infty), \{x \mid x < -6 \text{ or } x \ge 1\}.
- (-\infty, -3) \cup (-3, \infty). Every other real number is less than or greater than -3.
- (-\infty, 0] \cup (10, \infty). Bracket at 0 for \le, parenthesis at 10 for >.
- [-2, 7]. The first piece stops just before 3 and the second starts at 3 itself, so together they cover every number from -2 to 7 with no gap.
- [50, 230]. The dial allows 50 \le t \le 250 and the dish needs t \le 230; both hold exactly when 50 \le t \le 230.
- (a) \{9\}, since only 9 meets 9 \le x \le 9. (b) \varnothing: 9 < x \le 9 would make x greater than 9 and at most 9. (c) \{-1\}, the interval [-1, -1].
- \{-2, -1, 0, 1, 2\}, five elements. The interval [-2, 3) also holds every real number between, such as 0.5 and 2.99, so it has infinitely many elements.
- A bracket says the endpoint belongs to the set, and \infty is not a number, so it cannot belong. The correct form is [12, \infty).
- As points, (2, 5) has x-coordinate 2 and y-coordinate 5, and (5, 2) has them the other way round, so they sit in different places. As intervals, (2, 5) is the numbers with 2 < x < 5, while (5, 2) is not used, since the smaller endpoint comes first; read through its condition 5 < x < 2, it would be empty. Either way, order matters.
- -1 and 1 are both in the set, and 0 lies between them but is not in the set. An interval has no gaps, so the set is not one interval. It is (-\infty, 0) \cup (0, \infty).