ExamSaathi learning library · Government exams · SSC CGL quantitative foundations; published syllabus labelled 2024 · Quantitative aptitude

The triangle inequality: which lengths can make a triangle

Decide whether three lengths can make a triangle, find the range for a missing side, count triangles with whole-number sides, and use the rule that the longest side faces the largest angle.

Status: original pilot lesson. Teacher review is pending. It is not a complete course or official exam material.

You will learn to

Before you start

A triangle needs three corners that do not all lie on one straight line. Its sides are lengths, so each is a positive number. Unknown lengths are written a, b, c or k, because x stands for multiplication. A side is named by its two ends, and it faces the corner that is not on it: in triangle ABC, side BC faces angle A, side CA faces angle B, and side AB faces angle C. Two triangles with the same three side lengths count as one triangle, in whatever order the lengths are listed. You will use the angle sum of 180 degrees and the fact that equal sides face equal angles.

The rule: any two sides together are longer than the third

Walking straight from one corner to another is shorter than walking round through the third corner. So in every triangle each side is less than the sum of the other two: a + b > c, b + c > a and c + a > b. Rearranged, the same facts say that each side is greater than the difference of the other two. For three positive lengths one test is enough: sort them, and check that the two shorter ones add up to more than the longest. The other two conditions then hold on their own, because the longest length plus anything positive is more than either shorter one. So 5, 9 and 13 make a triangle, since 5 + 9 = 14 is more than 13. But 4, 7 and 11 do not: 4 + 7 is exactly 11, so the three corners would sit on one straight line and give a flat figure, not a triangle.

The range for a missing side

When two sides are known, the third lies strictly between their difference and their sum: (longer - shorter) < third side < (longer + shorter). With sides of 5 cm and 9 cm the third side is more than 4 cm and less than 14 cm, so its whole-number values run from 5 to 13, which is 9 values. Both end values are left out, because each would make the figure flat. For whole-number sides a and b, the number of whole-number choices is 2 x (smaller side) - 1, here 2 x 5 - 1 = 9. The perimeter has a range too: it is more than twice the longer known side and less than twice the sum of the two known sides, so with 5 cm and 9 cm it lies strictly between 18 cm and 28 cm.

Counting triangles with whole-number sides

To count the triangles with whole-number sides and a fixed perimeter p, write each one with its sides in order, shortest first, and go through the possible longest sides. The longest side must be less than p/2, since it is shorter than the other two together, and it is at least p/3, since it is at least as long as the average side. For p = 12 this leaves 4 and 5. A longest side of 4 gives 4, 4, 4, and a longest side of 5 gives 2, 5, 5 and 3, 4, 5, so there are 3 triangles in all. To count triangles made from a set of sticks, list every group of three sticks, sort each group, and keep it only if its two shorter sticks add up to more than the longest one.

The longest side faces the largest angle

In any triangle, the longer of two sides faces the larger angle, and the larger of two angles faces the longer side. Sort the sides and the angles fall into the same order, each angle matched with the side opposite it. In triangle ABC with BC = 8 cm, CA = 6 cm and AB = 11 cm, the longest side AB faces angle C, the largest angle, and the shortest side CA faces angle B, the smallest. The rule gives the order of the angles, not their sizes; angle C is not 11/25 of 180 degrees. In a right triangle the right angle is the largest angle, so the hypotenuse is the longest side. If one angle is larger than each of the other two, the side facing it is longer than each of the other two sides.

Common mistakes

Adding a pair that contains the longest side: 3 + 12 > 4 is true, yet 3, 4 and 12 cannot make a triangle, because 3 + 4 is less than 12. Accepting a set in which the two shorter lengths add up exactly to the longest; that is a straight line, not a triangle. Keeping the end values when listing a missing side: with 5 cm and 9 cm, neither 4 cm nor 14 cm works. Counting 3, 4, 5 and 5, 3, 4 as two different triangles. Giving two answers for an isosceles triangle with sides of 5 cm and 12 cm: 5, 5, 12 fails the test, so the sides must be 12, 12, 5. Placing the largest angle at a corner on the longest side instead of at the corner facing it.

A short routine for side-length questions

1. Sort the given lengths, shortest first. 2. Add the two shorter ones; a triangle exists only when this sum is greater than the longest. 3. For a missing side, write difference < third side < sum, and leave out both ends. 4. For a fixed perimeter p, try each whole-number longest side from the first one that is at least p/3 up to the last one below p/2, and list the pairs that complete the perimeter. 5. To order the angles, sort the sides; each angle takes the place of the side it faces. 6. End by testing one listed triangle to confirm that it passes.

Worked examples

  1. Two sides of a triangular plot of land are 8 m and 13 m, and the third side is a whole number of metres. Find the shortest and the longest possible third side, and how many lengths are possible.

    1. The third side must be more than 13 - 8 = 5 m and less than 13 + 8 = 21 m.
    2. Both ends are left out, so the whole-number lengths run from 6 m to 20 m.
    3. Number of lengths = 20 - 6 + 1 = 15, which matches 2 x 8 - 1 = 15.
    4. Check the extremes: 6 + 8 = 14 is more than 13, and 8 + 13 = 21 is more than 20.

    Answer: The third side can be any whole number from 6 m to 20 m, so 15 lengths are possible.

  2. How many different triangles have whole-number sides and a perimeter of 15 cm? List them.

    1. Write the sides shortest first. The longest side is less than 15 / 2 = 7.5 and at least 15 / 3 = 5, so it is 5, 6 or 7.
    2. Longest side 5: the other two add up to 10 and neither is more than 5, so the only triangle is 5, 5, 5.
    3. Longest side 6: the other two add up to 9, giving 3, 6, 6 and 4, 5, 6.
    4. Longest side 7: the other two add up to 8, giving 1, 7, 7; 2, 6, 7; 3, 5, 7 and 4, 4, 7.
    5. Total = 1 + 2 + 4 = 7. In each one the two shorter sides add up to more than the longest, as they must.

    Answer: There are 7 such triangles.

  3. In triangle PQR, PQ = 7 cm and QR = 12 cm, and angle Q is larger than each of the other two angles. PR is a whole number of centimetres. How many values can PR take?

    1. Q is the corner that is not on side PR, so PR faces angle Q.
    2. Angle Q is the largest angle, so PR must be longer than each of the other two sides: PR > 12 cm.
    3. The triangle rule gives PR < 7 + 12 = 19 cm, so PR is a whole number from 13 to 18.
    4. Number of values = 18 - 13 + 1 = 6. Without the angle condition, PR could have been any whole number from 6 to 18.

    Answer: PR can take 6 values, from 13 cm to 18 cm.

Practice checks

  1. Which of these sets of lengths can be the three sides of a triangle?
  2. Two sides of a triangle are 6 cm and 15 cm. If the third side is a whole number of centimetres, how many lengths are possible for it?
  3. How many different triangles have whole-number sides and a perimeter of 20 cm?
  4. In triangle PQR, PQ = 10 cm and QR = 7 cm. Angle R is larger than angle P, and angle P is larger than angle Q. If PR is a whole number of centimetres, how many values can PR take?
  5. Two of the sides of an isosceles triangle are 6 cm and 14 cm long. What is its perimeter?

Sources checked