Welcome back to Solving Compound Inequalities! Over the course of this final lesson, we bring together everything we have built so far. We started by understanding the difference between "and" and "or," moved on to solving both types of compound inequalities (including three-part chains), and then explored how to graph compound solutions on a number line. Now it is time for the last piece of the puzzle: writing compound solutions in interval notation.
Interval notation gives us a compact, precise way to express solution sets without relying on a graph or inequality symbols. By the end of this lesson, you will be able to write any compound solution — whether it is a single bounded segment, a pair of separate rays, or even one of the special cases where the answer is "nothing" or "everything."
Revisiting Interval Notation Basics
"And" Solutions as Bounded Intervals
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal
Earlier in this learning path, we practiced writing simple inequalities in interval notation. Since that skill is the foundation for everything in this lesson, here is a quick refresher of the conventions we need:
Parentheses() indicate that an endpoint is not included (used with < or >).
Brackets[] indicate that an endpoint is included (used with ≤ or ≥).
The symbols −∞ and ∞ always get parentheses, because infinity is not a reachable value.
For example, x>5 becomes (5,∞), and x≤3 becomes (−∞,3]. These single-inequality intervals are the building blocks we will combine throughout this lesson.
An "and" compound inequality produces the overlap (intersection) of two conditions. When that overlap exists, it forms a single bounded segment with two finite endpoints, so we can express it as one interval.
Consider the solved compound inequality:
−1<x≤4
The left boundary −1 is strict (<), so it gets a parenthesis. The right boundary 4 is inclusive (≤), so it gets a bracket. The result is:
(−1,4]
On a number line, this is one continuous segment:
The process is always the same: identify the two boundary values, then match each inequality symbol to the correct punctuation.
Inequality symbol
Endpoint type
Notation symbol
< or >
Not included
Parenthesis
≤ or ≥
Included
Bracket
So 2≤x≤7 becomes [2,7], and 0<x<3 becomes (0,3). One interval, two finite endpoints, and the brackets or parentheses match the inequality symbols exactly. To make this more concrete, think of a thermostat programmed to activate cooling when the room temperature t is between 68 and 76 degrees, inclusive: 68≤t≤76 translates neatly to [68,76].
"Or" Solutions with the Union Symbol
Same-Direction Solutions: A Single Unbounded Interval
An "or" compound inequality combines two conditions where at least one must be true. The resulting solution is the union of the two individual sets. Because these sets often occupy separate regions of the number line, we cannot fit them into a single interval. Instead, we join them with the union symbol∪.
Let's work through an example. Suppose we have:
x≤−2orx>3
We write each piece as its own interval. The first part, x≤−2, becomes (−∞,−2]. The second part, x>3, becomes (3,∞). Then we connect them:
(−∞,−2]∪(3,∞)
On a number line, the solution appears in two separate pieces:
The ∪ symbol simply means "or," telling us the full solution includes both intervals. By convention, we list the intervals from left to right on the number line so the smaller values come first.
Here is a real-world way to picture this. Imagine a factory machine that triggers a safety alert when the pressure p drops below 10 psi or rises above 50 psi. The alert condition is p<10 or p>50, which we would write as (−∞,10)∪(50,∞). The "safe zone" sits in between, and everything outside it belongs to the union.
When both parts of a compound inequality point the same direction, the solution simplifies to one ray, and in interval notation that ray is a single unbounded interval — no union symbol needed.
For an "and" statement, keep the more restrictive condition. For example, x>2 and x>5 simplifies to x>5, written as (5,∞). For an "or" statement, keep the more inclusive condition. For example, x<2 or x<5 simplifies to x<5, written as (−∞,5).
The key is to simplify before writing the notation. If you jump straight to a union, you might mistakenly write (2,∞)∪(5,∞) when the correct, simplified answer for the "or" case is just (2,∞).
Not every compound inequality lands on a bounded interval or a union of rays. Two edge cases deserve special attention.
Empty set (no solution). An "and" inequality can have no overlap at all. For example, x<1andx>5 asks for a number that is simultaneously less than 1 and greater than 5. No such number exists, so we write:
∅
The symbol ∅ simply means "no solutions." You might also see this written as {}, but ∅ is the standard choice in interval-notation contexts.
All real numbers. An "or" inequality can cover the entire number line. For instance, x≤4orx>1 is satisfied by every real number, because every number meets at least one of the two conditions. We write:
(−∞,∞)
A handy way to remember these outcomes: "and" can narrow the solution all the way down to nothing (∅), while "or" can expand it all the way up to everything (−∞,∞).
Here is a concise table that ties each compound type to its interval notation form:
Compound type
What happens
Interval notation
And with overlap
Single bounded interval
e.g., [2,5)
And same direction
Single unbounded interval (tighter bound)
e.g., (5,∞)
And with no overlap
Empty set
∅
Or with disjoint parts
Union of two intervals
e.g., (−∞,−3)∪[1,∞)
Or same direction
Single unbounded interval (looser bound)
e.g., (−∞,5)
Or with full coverage
All real numbers
(−∞,∞)
Whenever you write a compound solution, double-check two things: first, whether each endpoint should be a parenthesis or a bracket; and second, whether the compound type calls for a single interval, a union, or a simplified single ray.
You have now completed the final lesson of Solving Compound Inequalities — congratulations! From distinguishing "and" from "or," to solving each type, graphing the results, and expressing every solution in clean interval notation, you have built a complete toolkit. Whether the answer is a bounded interval like [−1,4), a union like (−∞,0)∪(3,∞), a single unbounded interval like (5,∞), the empty set ∅, or all real numbers (−∞,∞), you now know exactly how to write it.
Up next are practice exercises designed to cement these skills. You will match compound solutions to the correct notation structure, fill in missing pieces of interval expressions, and write full solutions on your own — including those tricky edge cases.