Sub topic 4
Compound Inequalities with 'And'
This chapter assumes you can solve a one-variable linear inequality, including flipping the sign when you multiply or divide by a negative number. It also assumes you can read inequality symbols, number lines, and interval notation. Those topics come from the earlier chapters.
What an 'and' compound inequality means
A compound inequality joins two or more inequalities. With "and", a value of x is a solution only if it satisfies every piece at the same time. The solution set is the intersection of the pieces' solution sets. The intersection is the set of values that appear in all of them.
For example, "x > 2 and x <= 7" asks for numbers that are greater than 2 and also at most 7. The number 5 qualifies. The number 1 fails the first piece. The number 9 fails the second.
On the number line, shade each piece separately. The answer is where the shading overlaps. In interval notation, this answer is (2, 7].
Two ways to write the same thing
An "and" compound inequality can appear in two forms.
- Separate form: x > 2 and x <= 7.
- Chained form: 2 < x <= 7.
The chained form is shorthand for the separate form. It only makes sense when the middle expression is greater than the left end and less than or equal to the right end. Both signs must point the same direction, so that the lower bound is written first.
| In words | Chained form | Interval notation |
|---|---|---|
| x is between 2 and 7, excluding both | 2 < x < 7 | (2, 7) |
| x is at least 2 and less than 7 | 2 <= x < 7 | [2, 7) |
| x is greater than 2 and at most 7 | 2 < x <= 7 | (2, 7] |
| x is at least 2 and at most 7 | 2 <= x <= 7 | [2, 7] |
The words "between" and "from ... to ..." are ambiguous on the GRE about whether the endpoints count. Look for "inclusive", "at least", "at most", or "strictly" to decide. If the problem gives no signal, the endpoints are not included.
Solving a chained inequality
Treat a chain as three parts: left, middle, right. Whatever you do to the middle, you must do to all three parts. This keeps each of the two hidden inequalities true.
Solve -3 < 2x - 1 <= 7.
- Add 1 to all three parts: -2 < 2x <= 8.
- Divide all three parts by 2: -1 < x <= 4.
The solution is (-1, 4]. The following check tests values at and around each boundary:
# Solve -3 < 2x - 1 <= 7 -> -2 < 2x <= 8 -> -1 < x <= 4
for x in [-1, 0, 4, 5]:
print(x, -3 < 2 * x - 1 <= 7)
# -1 False
# 0 True
# 4 True
# 5 FalsePython accepts chained comparisons with the same meaning as in mathematics. The value -1 fails because the left inequality is strict. The value 4 passes because the right inequality allows equality.
Chains with a negative multiplier
If you multiply or divide all three parts by a negative number, every sign flips. The order of the parts reverses as well, so that the smaller value still comes first.
Solve 5 > 3 - 2x >= -7.
- Subtract 3 from all parts: 2 > -2x >= -10.
- Divide all parts by -2. Each sign flips: -1 < x <= 5.
Check this with x = 0: 3 - 0 = 3, and 5 > 3 >= -7 is true. Check x = 5: 3 - 10 = -7, and the right piece allows equality, so it passes. Check x = -1: 3 + 2 = 5, and 5 > 5 is false, so -1 is excluded.
A common error is to flip the signs but leave the numbers in their original positions. That produces -10 / -2 on the left and 2 / -2 on the right, which reads "5 < x < -1" and is meaningless. After dividing by a negative, rewrite the chain so the smaller number is on the left.
Solving two separate inequalities
When the pieces contain different expressions, solve each one on its own. Then intersect the results.
Solve 3x + 1 > 10 and 2x - 5 <= 9.
- First piece: 3x > 9, so x > 3.
- Second piece: 2x <= 14, so x <= 7.
- Intersect: x > 3 and x <= 7, which is 3 < x <= 7, or (3, 7].
You cannot combine the pieces into one chain until each is solved for x. Chaining before solving usually gives a form that cannot be simplified.
Finding the intersection of two intervals
An intersection follows two rules:
- The lower end of the answer is the larger of the two lower ends.
- The upper end of the answer is the smaller of the two upper ends.
When two ends are equal, the endpoint is included only if both pieces include it. If the lower end ends up larger than the upper end, the intersection is empty.
The following function applies these rules. Each interval is written as (low, lowclosed, high, highclosed), where "closed" means the endpoint is included.
inf = float("inf")
def intersect(a, b):
lo1, lc1, hi1, hc1 = a
lo2, lc2, hi2, hc2 = b
if lo1 > lo2:
lo, lc = lo1, lc1
elif lo2 > lo1:
lo, lc = lo2, lc2
else:
lo, lc = lo1, lc1 and lc2
if hi1 < hi2:
hi, hc = hi1, hc1
elif hi2 < hi1:
hi, hc = hi2, hc2
else:
hi, hc = hi1, hc1 and hc2
if lo > hi or (lo == hi and not (lc and hc)):
return None
return (lo, lc, hi, hc)
print(intersect((3, False, inf, False), (-inf, False, 7, True)))
# (3, False, 7, True) x > 3 and x <= 7
print(intersect((-inf, False, 1, False), (3, True, inf, False)))
# None x < 1 and x >= 3
print(intersect((4, True, inf, False), (-inf, False, 4, True)))
# (4, True, 4, True) x >= 4 and x <= 4
print(intersect((5, True, inf, False), (-inf, False, 5, False)))
# None x >= 5 and x < 5The first result is the (3, 7] from the previous section. The other three show the special cases covered next.
Special outcomes
An 'and' compound inequality can have three kinds of solution sets.
- An interval. This is the usual case, such as 3 < x <= 7.
- No solution. The pieces do not overlap. For example, x + 2 < 1 and 3x >= 6 give x < -1 and x >= 2. No number is both below -1 and at least 2.
- A single value. The pieces touch at one point and both include it. For example, x - 1 >= 3 and 2x <= 8 give x >= 4 and x <= 4. The only solution is x = 4.
The last case is the one that GRE writers use most. If the pieces touch at a point but one of them is strict, as in x >= 5 and x < 5, there is no solution. Whether the endpoint is included decides between "one solution" and "none".
A chain written with both ends in the wrong order, such as 5 < x < 1, describes the empty set. You will not usually see it written that way. You will see it as two separate inequalities that turn out not to overlap.
The solving procedure
Connection to absolute value
An absolute value inequality of the form |expression| < k, or |expression| <= k, is an 'and' compound inequality in disguise. Absolute value measures distance from zero, so |x - 3| <= 2 means that x is within 2 units of 3. That is the same as -2 <= x - 3 <= 2, and adding 3 to all parts gives 1 <= x <= 5.
# |x - 3| <= 2 is equivalent to 1 <= x <= 5
for x in [0, 1, 3, 5, 6]:
print(x, abs(x - 3) <= 2)
# 0 False
# 1 True
# 3 True
# 5 True
# 6 FalseThe next chapters develop this fully. The point here is that "less than" absolute value inequalities produce 'and' answers, which are a single interval. "Greater than" absolute value inequalities produce 'or' answers, which are two separate pieces.
GRE applications
Counting integers
Numeric Entry questions often ask how many integers satisfy a compound inequality. Suppose -2 < x <= 3 and x is an integer. The integers are -1, 0, 1, 2, and 3, which is 5 values. The most common error is counting the excluded endpoint -2. Another is using subtraction, since 3 - (-2) = 5 happens to work here only because one end is excluded and one is included. For 2 <= x <= 7 the subtraction gives 5, but there are 6 integers.
For integer endpoints, a count of integers in a range is the upper end minus the lower end, plus 1 if both ends are included, or minus 1 if neither is included. If only one end is included, the count is the plain difference.
Quantitative Comparison
A Quantitative Comparison question may give "x > 2 and x <= 7" and then compare x with 7. You can conclude x is at most 7, so Quantity B is at least as large as Quantity A. You cannot say it is strictly larger, because x = 7 is allowed. Boundary inclusion often decides whether the answer is "Quantity B is greater" or "the two quantities are equal in some cases and unequal in others".
Hidden compound conditions
Phrases such as "x is a positive integer less than 6" or "x is nonnegative and at most 10" contain an 'and' compound inequality. Translate each phrase into a piece, then intersect them. "Positive" gives x > 0. "Integer less than 6" gives x < 6 with x a whole number. Together the values are 1, 2, 3, 4, 5.
Common errors
- Flipping only some signs. In a chain with a negative divisor, all signs flip, not just one.
- Leaving the chain in reverse order. Always write the smaller bound on the left.
- Treating strict and non-strict ends alike. Open and closed endpoints change the answer when counting integers or deciding equality in a comparison.
- Chaining pieces that do not belong together. You can write a chain only when it describes one middle expression between two bounds.
- Confusing 'and' with 'or'. For 'and', take the overlap. For 'or', take everything covered by either piece. If you shade your number lines, 'and' gives a smaller set than either piece alone, and 'or' gives a larger one.
Practice
Exercise
Solve 4 > 1 - 3x >= -8 and write the answer in interval notation.
Show answer
Subtract 1 from all parts: 3 > -3x >= -9. Divide all parts by -3 and flip each sign: -1 < x <= 3. In interval notation this is (-1, 3]. Check x = 3: 1 - 9 = -8, which satisfies >= -8. Check x = -1: 1 + 3 = 4, and 4 > 4 is false, so -1 is excluded.
Exercise
How many integers x satisfy both 2x + 3 > 1 and x - 4 <= 3?
Show answer
The first piece gives 2x > -2, so x > -1. The second gives x <= 7. The intersection is -1 < x <= 7. The integers are 0, 1, 2, 3, 4, 5, 6, 7, which is 8 values. The lower end is excluded and the upper end is included, so the count is 7 - (-1) = 8.
Exercise
For which values of x are both x + 5 <= 2 and 4x >= -8 true? Is there a solution?
Show answer
The first piece gives x <= -3. The second gives x >= -2. No number is both at most -3 and at least -2, because the lower bound -2 is larger than the upper bound -3. There is no solution.