Sub topic 2
Reading and Writing Solution Sets on the Number Line
Solving an inequality gives you a set of numbers, not a single value. CAT questions ask about that set in several ways. They may ask for its interval form, its length, its smallest integer, or whether a given option lies inside it. If you misread a bracket or write a union where you meant an intersection, the answer is wrong even when the algebra is right. This chapter covers the notation and the habits that prevent those errors.
This chapter assumes you are comfortable with the number line and with integers. It also assumes you know the sign rules from the previous chapter.
Endpoints: Included or Excluded
Every interval has two ends. For each end, you need to know whether that value belongs to the set.
- A closed endpoint is included. It comes from
<=or>=. On a number line it is drawn as a filled dot, and in notation it is written with a square bracket[or]. - An open endpoint is excluded. It comes from
<or>, from a denominator becoming zero, or from infinity. It is drawn as a hollow dot and written with a round bracket(or).
The left number is always the smaller one. (5, 2) is not a valid interval. If your work produces it, the set is empty or you made a sign error.
| Inequality | Interval notation | Number line picture |
|---|---|---|
| 2 < x < 7 | (2, 7) | hollow at 2, hollow at 7 |
| 2 <= x <= 7 | [2, 7] | filled at 2, filled at 7 |
| 2 <= x < 7 | [2, 7) | filled at 2, hollow at 7 |
| x > -3 | (-3, ∞) | hollow at -3, arrow right |
| x <= 4 | (-∞, 4] | arrow left, filled at 4 |
| any real x | (-∞, ∞) | whole line shaded |
| x = 5 only | {5} | single filled dot |
| no x | ∅ | nothing shaded |
Choosing the Bracket
The decision for each endpoint comes down to a short chain of questions. Ask them separately for the left end and the right end.
The denominator check takes priority over the inequality sign. In (x - 1)/(x - 3) >= 0, the value x = 3 is excluded even though the sign is >=. The rational inequalities chapter covers this case in detail.
Union and Intersection
Solution sets are often made of several pieces. You combine pieces in one of two ways, and the word in the question tells you which.
- Union (∪) means "or". A number is in A ∪ B if it lies in at least one of the sets. It comes from conditions like
x < 2 or x > 5, or from a sign chart with several positive regions. - Intersection (∩) means "and". A number is in A ∩ B only if it lies in both sets. It comes from systems of conditions, from the domain of an expression, and from double inequalities such as
-1 < 2x + 3 < 9.
Compare these two statements:
x < 2 or x > 5is (-∞, 2) ∪ (5, ∞). It is the outside of the gap.x > 2 and x < 5is (2, 5). It is the inside of the gap.
A common slip is to write 5 < x < 2 for the first one. That chain claims x is above 5 and below 2 at the same time, which describes the empty set. A chained inequality a < x < b always means intersection, so it only works for a single connected piece.
Intersecting Intervals by Hand
To intersect two intervals, take the larger of the two left ends and the smaller of the two right ends. At each end, the stricter bracket wins. An open bracket beats a closed one, because a point must be in both sets.
Example: [-3, 5) ∩ (1, 8].
- Left end: max(-3, 1) = 1. The 1 comes from (1, 8], so it is open.
- Right end: min(5, 8) = 5. The 5 comes from [-3, 5), so it is open.
- Result: (1, 5).
If the left end you compute exceeds the right end, the intersection is ∅. If they are equal and both brackets are closed, the intersection is a single point. For example, [1, 4] ∩ [4, 9] = {4}, while [1, 4) ∩ [4, 9] = ∅.
Writing "All Except a Point"
A condition like x ≠ 3 excludes one point from the line. Write it as a union of two open-ended pieces: (-∞, 3) ∪ (3, ∞). The same idea punches holes in a larger interval. For example, [-2, 6] with x ≠ 1 becomes [-2, 1) ∪ (1, 6].
Checking Membership in Code
When you are unsure about a boundary, test a few points, including the endpoints themselves. The script below encodes the set [-2, 1] ∪ (3, ∞) and checks sample values. It is the kind of answer you will get from the wavy curve method in a later chapter.
INF = float("inf")
def in_interval(x, lo, hi, lo_closed, hi_closed):
left_ok = x >= lo if lo_closed else x > lo
right_ok = x <= hi if hi_closed else x < hi
return left_ok and right_ok
def in_solution(x):
# [-2, 1] union (3, infinity)
return (in_interval(x, -2, 1, True, True)
or in_interval(x, 3, INF, False, False))
for x in [-2.5, -2, 0, 1, 2, 3, 3.01, 100]:
print(x, in_solution(x))
# -2.5 False, -2 True, 0 True, 1 True,
# 2 False, 3 False, 3.01 True, 100 TrueEach piece is a function call, and union becomes or. Intersection would become and. This one-to-one match between the logic and the notation is how you should think about solution sets on paper too.
Length and Integer Count
Two quantities are often asked about an interval from a to b.
- Length is b - a. Brackets do not affect it: (2, 7), [2, 7] and [2, 7) all have length 5. For a union of disjoint pieces, add the lengths.
- Integer count does depend on brackets. When a and b are integers, the counts are:
| Interval | Integers inside | Example with a = 2, b = 7 |
|---|---|---|
| [a, b] | b - a + 1 | 2 to 7: 6 integers |
| [a, b) or (a, b] | b - a | 5 integers |
| (a, b) | b - a - 1 | 3 to 6: 4 integers |
When an endpoint is not an integer, the bracket stops mattering for the count. The integers in (1.5, 6.2] are the same as those in [2, 6]: there are 5 of them. A later chapter covers counting in harder cases.
Common Errors
| Error | Why it is wrong | Correct form |
|---|---|---|
| [4, ∞] | ∞ cannot be included | [4, ∞) |
| (7, 3) | left end must be smaller | (3, 7), or ∅ if no values fit |
| 5 < x < 2 for "x < 2 or x > 5" | a chain means "and" | (-∞, 2) ∪ (5, ∞) |
| [1, 3] for (x-1)/(x-3) <= 0 | 3 makes the denominator zero | [1, 3) |
| (-∞, 3] ∪ [3, ∞) for x ≠ 3 | this includes 3 and is all of ℝ | (-∞, 3) ∪ (3, ∞) |
| Union written when the system says "and" | wrong combining rule | intersect the pieces |
Exercise
Find [-4, 6) ∩ (-1, 9] and state how many integers it contains.
Show answer
Left end is max(-4, -1) = -1, open because it comes from (-1, 9]. Right end is min(6, 9) = 6, open because it comes from [-4, 6). The result is (-1, 6), which contains the integers 0, 1, 2, 3, 4, 5: six integers, matching b - a - 1 = 6 - (-1) - 1 = 6.
Exercise
Write in interval notation: x lies in [-3, 5], x is not equal to 0, and x is not equal to 2. Then give the total length of the set.
Show answer
[-3, 0) ∪ (0, 2) ∪ (2, 5]. Removing single points does not change length, so the total length is 5 - (-3) = 8.
Exercise
A student writes the solution of "x <= -1 or x >= 4" as -1 >= x >= 4. Explain the error and give the correct set and the integers NOT in it.
Show answer
The chain -1 >= x >= 4 means x <= -1 and x >= 4 together, which is empty. The correct set is (-∞, -1] ∪ [4, ∞). The integers not in it lie strictly between -1 and 4: 0, 1, 2, 3.
Exercise
How many integers lie in (-2.7, 3.4] ∪ [5, 8)?
Show answer
(-2.7, 3.4] contains -2, -1, 0, 1, 2, 3, which is 6 integers. [5, 8) contains 5, 6, 7, which is 3 integers. The pieces do not overlap, so the total is 9.