Sub topic 12
Graphing Modulus Expressions and Areas Such as |x| + |y| <= k
This chapter assumes you can split a modulus expression at its critical points (previous chapter) and plot straight lines on the xy-plane. Here we turn those pieces into pictures. Once you have the picture, CAT area and lattice-point questions take seconds.
The basic V shape
The graph of y = |x - a| is a V with its vertex at (a, 0). For x >= a it follows y = x - a, and for x < a it follows y = a - x. Both arms have slope magnitude 1.
Common shifts and stretches:
| Expression | Effect on y = abs(x) |
|---|---|
| abs(x - a) + b | Vertex moves to (a, b) |
| k·abs(x) | Arms get steeper (slope ±k) |
| -abs(x) | V opens downward |
| abs(x - a) + abs(x - b) | Flat floor of height abs(a - b) between a and b |
For a sum of several modulus terms, the graph is made of straight segments, and it bends only at the critical points. To sketch it, compute y at each critical point and join the points with straight lines.
The region |x| + |y| <= k
Split the plane by the signs of x and y. In the first quadrant the condition is x + y <= k, which is a triangle. The other three quadrants mirror it. Together they form a square rotated 45°, with vertices (k, 0), (0, k), (-k, 0) and (0, -k).
- Each diagonal is 2k, so area = (2k · 2k)/2 = 2k².
- Each side is k√2, which also gives (k√2)² = 2k².
- The boundary |x| + |y| = k is just the four edges, and it encloses that same area.
Generalisations
- |x - a| + |y - b| <= k is the same diamond centred at (a, b). The area is still 2k².
- |px| + |qy| <= k has diagonals 2k/p and 2k/q, so its area is 2k²/(pq).
- |x| <= a together with |y| <= b gives an axis-aligned rectangle of area 4ab.
Lattice points
For an integer n, the number of integer points (x, y) with |x| + |y| <= n is 2n² + 2n + 1. The code below checks this by counting directly.
n = 3
lattice = sum(1 for x in range(-n, n + 1) for y in range(-n, n + 1) if abs(x) + abs(y) <= n)
print(lattice, 2 * n * n + 2 * n + 1) # 25 25
print('area =', 2 * n * n) # area of the square |x| + |y| <= n is 18Only the points on the boundary |x| + |y| = n count 4n.
Exercise
Find the area enclosed by |x - 1| + |y + 2| <= 4.
Show answer
Shifting the centre does not change the area, so it is 2 · 4² = 32 square units.
Exercise
Find the area of the region |2x| + |3y| <= 12.
Show answer
The x-intercepts are ±6 and the y-intercepts are ±4, so the diagonals are 12 and 8. The area is (12 · 8)/2 = 48, which matches 2k²/(pq) = 2 · 144/6 = 48.
Exercise
How many integer pairs (x, y) satisfy |x| + |y| <= 4?
Show answer
2(16) + 2(4) + 1 = 41.