Sub topic 12
Graphing Modulus Expressions and Areas Such as |x| + |y| <= k
This chapter assumes you can solve modulus equations and inequalities by splitting at critical points (covered in the previous chapter). It also assumes you can plot straight lines on the xy-plane and find the area of a triangle or rhombus. Here you will turn modulus expressions into pictures. Many CAT questions become one-line calculations once you can see the graph.
The basic V: y = |x - a|
The graph of y = |x| has two straight pieces:
- For x >= 0, it is y = x, a line of slope 1.
- For x < 0, it is y = -x, a line of slope -1.
The two pieces meet at the origin and form a V shape. The point where they meet is the vertex. It sits where the expression inside the modulus is zero.
Shifts behave as they do for any graph:
| Expression | Vertex | Opens | Notes | Column | Column |
|---|---|---|---|---|---|
| y = \ | x\ | (0, 0) | up | slopes ±1 | |
| y = \ | x - a\ | (a, 0) | up | shifted right by a | |
| y = \ | x - a\ | + c | (a, c) | up | also shifted up by c |
| y = -\ | x - a\ | + c | (a, c) | down | inverted V, maximum c |
| y = m\ | x - a\ | (a, 0) | up if m > 0 | slopes ±m |
Sums of moduli: flat bottoms and corners
Every modulus term adds a corner at its critical point. Between consecutive critical points the graph is a straight segment. So a sketch only needs the function's values at the critical points plus one point beyond each end.
Take y = |x - 1| + |x - 3|:
- For x < 1, y = 4 - 2x (slope -2).
- For 1 <= x <= 3, y = (x - 1) + (3 - x) = 2 (flat).
- For x > 3, y = 2x - 4 (slope 2).
The flat segment explains why the minimum value is 2 and why it is reached at every x in [1, 3]. A later chapter generalises this into the median property.
A difference behaves differently. y = |x| - |x - 4| equals -4 for x <= 0, rises as 2x - 4 on [0, 4], and equals 4 for x >= 4. Its range is therefore [-4, 4]. This matches the triangle inequality, since ||x| - |x - 4|| <= 4.
Nested modulus: y = ||x| - 2|
Work from the inside out:
- Sketch y = |x| - 2. This is a V with its vertex at (0, -2), crossing the x-axis at x = ±2.
- Apply the outer modulus by reflecting every part below the x-axis upward.
The result is a W shape. It touches zero at x = -2 and x = 2 and has a local peak at (0, 2). So ||x| - 2| = 1 has four solutions (x = ±1, ±3), and ||x| - 2| = 2 has three (x = 0, ±4). CAT likes to ask how many solutions an equation like ||x| - 2| = k has. Draw a horizontal line at height k and count crossings. There are 4 crossings for 0 < k < 2, 3 for k = 2, and 2 for k > 2 or k = 0.
Regions in the plane: |x| + |y| <= k
With two variables, the modulus splits the plane into four quadrants. In each quadrant, |x| + |y| = k is a straight line:
| Quadrant | Equation becomes |
|---|---|
| x >= 0, y >= 0 | x + y = k |
| x < 0, y >= 0 | -x + y = k |
| x < 0, y < 0 | -x - y = k |
| x >= 0, y < 0 | x - y = k |
The four segments join at (k, 0), (0, k), (-k, 0) and (0, -k). Together they form a square rotated 45°, with the origin at its centre. The inequality |x| + |y| <= k covers the square and everything inside it.
Key measurements:
- Each diagonal has length 2k, so area = (1/2)(2k)(2k) = 2k².
- Each side has length k√2, so the perimeter is 4k√2.
- Shifting to |x - h| + |y - c| <= k moves the centre to (h, c). The area stays 2k².
Stretched versions: |ax| + |by| <= c
The intercepts are now (±c/a, 0) and (0, ±c/b), with a, b, c > 0. The shape is a rhombus with diagonals 2c/a and 2c/b:
Area = (1/2)(2c/a)(2c/b) = 2c²/(ab)
Related shapes you should recognise
| Condition | Shape | Area | Column | Column | Column | Column | Column | Column | Column | Column |
|---|---|---|---|---|---|---|---|---|---|---|
| \ | x\ | + \ | y\ | <= k | rotated square, vertices on the axes | 2k² | ||||
| \ | ax\ | + \ | by\ | <= c | rhombus | 2c²/(ab) | ||||
| max(\ | x\ | , \ | y\ | ) <= k, i.e. \ | x\ | <= k and \ | y\ | <= k | axis-aligned square of side 2k | 4k² |
| \ | x\ | - \ | y\ | <= k | unbounded region | no finite area | ||||
| \ | x\ | <= y <= k | triangle with vertices (0,0), (k,k), (-k,k) | k² |
Worked example
Find the area enclosed by y = |x| and y = 4 - |x|.
The upward V and the downward V meet where |x| = 4 - |x|, so |x| = 2. The region has vertices (0, 0), (2, 2), (0, 4) and (-2, 2). This is a square with both diagonals of length 4, so its area is (1/2)(4)(4) = 8.
Counting lattice points
A lattice point is a point whose coordinates are both integers. For |x| + |y| <= n, with n a positive integer, sum over the rows: row y = j contains 2(n - |j|) + 1 points. Adding these over j = -n to n gives
2n² + 2n + 1 lattice points.
Two related counts follow from this:
- On the boundary |x| + |y| = n there are exactly 4n points.
- Strictly inside (|x| + |y| < n) there are 2n² + 2n + 1 - 4n = 2n² - 2n + 1 points.
def count_region(n):
closed = sum(1 for x in range(-n, n + 1)
for y in range(-n, n + 1) if abs(x) + abs(y) <= n)
boundary = sum(1 for x in range(-n, n + 1)
for y in range(-n, n + 1) if abs(x) + abs(y) == n)
return closed, boundary
for n in [1, 2, 3, 5]:
closed, boundary = count_region(n)
print(n, closed, 2 * n * n + 2 * n + 1, boundary, 4 * n, "area =", 2 * n * n)
# 3 25 25 12 12 area = 18The output matches the formulas. For n = 3, the area is 18 but there are 25 lattice points. Area and lattice count are different quantities. Read the question carefully to see which one it asks for.
A general procedure for region questions
Symmetry saves time. If replacing x with -x leaves the condition unchanged, the region is symmetric about the y-axis. If replacing y with -y leaves it unchanged, the region is symmetric about the x-axis. When both hold, find the area in the first quadrant and multiply by 4.
Common errors
- Using the wrong diagonal. In |x| + |y| <= k, the diagonal is 2k, not k. Getting this wrong gives area k²/2 instead of 2k².
- Confusing |x| + |y| <= k with |x| <= k, |y| <= k. The first is the rotated square with area 2k². The second is the larger axis-aligned square with area 4k².
- Forgetting that a shift preserves area. The area of |x - 3| + |y + 5| <= 2 is still 8.
- Mishandling nested moduli. Apply the inner modulus first, then reflect the negative parts upward. Do not drop the inner modulus.
- Mixing up area and lattice count. Check whether the boundary counts (<= versus <).
Exercise
Find the area of the region |2x| + |3y| <= 12.
Show answer
The intercepts are x = ±6 and y = ±4, so the diagonals are 12 and 8. Area = (1/2)(12)(8) = 48. This agrees with 2c²/(ab) = 2(144)/6 = 48.
Exercise
How many lattice points satisfy |x| + |y| <= 5? How many of them lie strictly inside the boundary?
Show answer
Total = 2(25) + 2(5) + 1 = 61. The boundary has 4(5) = 20 points, so 61 - 20 = 41 lie strictly inside. This matches 2n² - 2n + 1 = 41.
Exercise
Find the area enclosed by y = |x - 2| and y = 4.
Show answer
The V has its vertex at (2, 0) and meets y = 4 at x = -2 and x = 6. The region is a triangle with base 8 and height 4, so its area is 16.
Exercise
For which values of k does ||x| - 3| = k have exactly four real solutions?
Show answer
The graph is a W with zeros at x = ±3 and a local peak of 3 at x = 0. A horizontal line meets it four times when 0 < k < 3.