Sub topic 2
Triangle Inequality and Which Side Is Longest
This chapter assumes you know the angle sum of a triangle (180°) and the exterior angle property (an exterior angle equals the sum of the two opposite interior angles). It also assumes you can solve simple linear inequalities. The chapter gives you two tools: a test for whether three lengths can form a triangle, and a rule that matches the order of the sides to the order of the angles.
The triangle inequality
A straight line is the shortest path between two points. Going from B to C directly is never longer than going from B to A and then A to C. That is the triangle inequality.
For a triangle with sides a, b and c:
- a + b > c
- b + c > a
- a + c > b
Each inequality is strict. If a + b = c, the two shorter sides lie flat along the longest one. The "triangle" collapses into a line segment, which is called a degenerate triangle. CAT questions that ask whether a triangle exists treat this case as "no".
Why it is true
Take triangle ABC. Extend side BA beyond A to a point D so that AD = AC. Then triangle ACD is isosceles, so angle ACD = angle ADC. Angle BCD is larger than angle ACD, because point A lies inside angle BCD. So in triangle BCD, angle BCD is greater than angle BDC. The side opposite the larger angle is longer, so BD > BC. But BD = BA + AC, which gives AB + AC > BC. This proof uses the side-angle rule from the next section.
The quick test
You do not need to check all three inequalities. Only the largest side can fail, so check that the two shorter sides add up to more than the longest.
def is_triangle(a, b, c):
x, y, z = sorted((a, b, c))
return x + y > z
print(is_triangle(3, 4, 5)) # True
print(is_triangle(3, 4, 7)) # False (degenerate: 3 + 4 = 7)
print(is_triangle(2, 3, 8)) # FalseRange of the third side
If two sides are a and b, the third side x must satisfy both x < a + b and x > |a − b|. The second condition comes from rewriting a < b + x or b < a + x.
| Given sides | Range of third side x | Column | Column |
|---|---|---|---|
| 4 and 9 | 5 < x < 13 | ||
| 5 and 12 | 7 < x < 17 | ||
| 6 and 6 | 0 < x < 12 | ||
| a and b | \ | a − b\ | < x < a + b |
For integer sides, the number of valid integer values of x is 2·min(a, b) − 1. For 4 and 9 that is 2·4 − 1 = 7, namely 6, 7, 8, 9, 10, 11 and 12.
Worked example: perimeter bounds
Two sides of a triangle are 7 and 10. The third side x is an integer. Find the smallest and largest possible perimeter.
- The range is 3 < x < 17, so x runs from 4 to 16.
- The smallest perimeter is 7 + 10 + 4 = 21.
- The largest perimeter is 7 + 10 + 16 = 33.
The perimeter of such a triangle always lies strictly between 2·max(a, b) and 2(a + b). Here that gives 20 and 34, and the integer values are 21 to 33.
Worked example: the isosceles trap
An isosceles triangle has two sides of lengths 3 and 7. What is its perimeter?
There are two cases. The sides could be 3, 3, 7, but 3 + 3 = 6 is less than 7, so that fails. The sides could be 7, 7, 3, and 7 + 3 > 7 holds. The perimeter is 17. When an isosceles triangle has two given lengths, always test both cases.
Counting integer triangles
Brute force is a quick way to count triangles with a fixed perimeter. Sort the sides so that a ≤ b ≤ c, which avoids counting the same triangle twice.
def count_triangles(perimeter):
count = 0
for a in range(1, perimeter):
for b in range(a, perimeter):
c = perimeter - a - b
if c >= b and a + b > c:
count += 1
return count
print(count_triangles(12)) # 3: (2,5,5), (3,4,5), (4,4,4)Counting by hand uses the same idea. Because a + b > c and a + b + c = 12, we get c < 6. Also c ≥ 12/3 = 4. So c is 4 or 5, and you list the pairs for each.
Which side is longest
The triangle inequality tells you whether a triangle exists. The side-angle rule tells you how its sides and angles line up.
- The larger angle is opposite the longer side.
- Equal angles are opposite equal sides.
- The converse also holds: the longer side is opposite the larger angle.
So the largest angle faces the longest side, and the smallest angle faces the shortest side.
Why it is true
Suppose AB > AC. Mark D on AB so that AD = AC. Triangle ACD is isosceles, so angle ADC = angle ACD. Angle ADC is an exterior angle of triangle BDC, so it is greater than angle B. Therefore angle ACB > angle ACD = angle ADC > angle B. The longer side AB faces the larger angle C.
Worked example: ordering
In triangle ABC, AB = 9, BC = 7 and CA = 5. Order the angles.
- AB is the longest side and faces angle C.
- BC is the middle side and faces angle A.
- CA is the shortest side and faces angle B.
So angle C > angle A > angle B.
Now the reverse. If the angles are A = 50°, B = 60° and C = 70°, then a < b < c, where each lowercase letter is the side opposite that angle. The sides are not in proportion to the angles. The ratio of sides follows the sines of the angles (a : b : c = sin A : sin B : sin C), not the angles themselves.
Combining both rules
Many questions ask for the range of a side in a triangle with angle conditions. The method is the same each time: use the angles to decide which side is longest, then apply the triangle inequality to that side.
Example: in triangle ABC, angle B is greater than angle C, and AB = 8 and AC = ... is unknown. Here AC faces B and AB faces C, so angle B > angle C means AC > AB, so AC > 8. If BC = 5, then AC < AB + BC = 13. So 8 < AC < 13.
Related results worth knowing
- Right and obtuse triangles. If c is the longest side, then c² = a² + b² gives a right angle at C, c² > a² + b² gives an obtuse angle, and c² < a² + b² gives an acute angle. This follows from the side-angle rule, because the largest angle sits opposite c.
- Hypotenuse. In a right triangle the right angle is the largest angle, so the hypotenuse is the longest side.
- Perpendicular is shortest. Among all segments from a point to a line, the perpendicular is the shortest. In a right triangle, the hypotenuse is longer than either leg for the same reason.
- Point inside a triangle. If P is inside triangle ABC, then PB + PC < AB + AC. The detour through P is shorter than the path along two full sides.
- Cevians. If D is on BC, then AD is less than the larger of AB and AC. A segment from a vertex to the opposite side cannot be longer than both of the other sides.
Common errors
- Forgetting the lower bound |a − b| and using only 0 < x < a + b.
- Counting x = a + b or x = |a − b| as valid.
- Matching the largest angle with a side that is not the largest.
- Skipping the second case in isosceles problems.
- Assuming the sides are proportional to the angles. Only the order matches, and the ratio of sides is the ratio of sines.
Exercise
Two sides of a triangle are 5 and 12. The third side is an integer. How many different integer values can it take, and what is the largest possible perimeter?
Show answer
The third side x satisfies 7 < x < 17, so x = 8, 9, ..., 16. That is 9 values, which matches 2·5 − 1 = 9. The largest perimeter uses x = 16: 5 + 12 + 16 = 33.
Exercise
In triangle PQR, angle P = 80° and angle Q = 45°. Name the longest and shortest sides, and say whether a triangle with sides in the ratio 2 : 3 : 6 could exist.
Show answer
Angle R = 180° − 80° − 45° = 55°. The largest angle is P, so QR (opposite P) is the longest side. The smallest angle is Q, so PR (opposite Q) is the shortest side. For sides in the ratio 2 : 3 : 6, we have 2 + 3 = 5, which is less than 6, so no such triangle exists.
Exercise
An isosceles triangle has sides 5 and 11 given. Find its perimeter, and explain why the other case is rejected.
Show answer
Case 5, 5, 11 fails because 5 + 5 = 10 is less than 11. Case 11, 11, 5 works because 11 + 5 > 11. The perimeter is 11 + 11 + 5 = 27.