From 450a25c764a2689f20b5a0165f0fea6f162f3e6f Mon Sep 17 00:00:00 2001 From: Durrell Chamorro Date: Sun, 11 Sep 2016 18:00:56 -0700 Subject: [PATCH 1/3] Correct the definition of triangle inequality to not include degenerate triangles. --- exercises/triangle/description.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/triangle/description.md b/exercises/triangle/description.md index 6de895b835..cc49db462e 100644 --- a/exercises/triangle/description.md +++ b/exercises/triangle/description.md @@ -2,6 +2,6 @@ The program should raise an error if the triangle cannot exist. ## Hint -The sum of the lengths of any two sides of a triangle always exceeds or -is equal to the length of the third side, a principle known as the _triangle +The sum of the lengths of any two sides of a triangle always exceeds +the length of the third side, a principle known as the _triangle inequality_. From ddc9cedcd6dd65f8f73f9295b4f294747b4a7151 Mon Sep 17 00:00:00 2001 From: Durrell Chamorro Date: Mon, 12 Sep 2016 19:43:47 -0700 Subject: [PATCH 2/3] Add clarity to the definition of triangle inequality. --- exercises/triangle/description.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/exercises/triangle/description.md b/exercises/triangle/description.md index cc49db462e..942e9fa46c 100644 --- a/exercises/triangle/description.md +++ b/exercises/triangle/description.md @@ -2,6 +2,16 @@ The program should raise an error if the triangle cannot exist. ## Hint -The sum of the lengths of any two sides of a triangle always exceeds -the length of the third side, a principle known as the _triangle +In mathematics, a degenerate case is a limiting case in which an element of a +class of objects is qualitatively different from the rest of the class and hence +belongs to another, usually simpler, class. + +1. If the sum of the lengths of any two sides of a triangle is equal to the + length of the third side, there exists a degenerate triangle. + +2. The sum of the lengths of any two sides of a triangle always exceeds or is + equal to the length of the third side, a principle known as the _triangle + inequality_. + +Therefore, a degenerate triangle does not violate the principle of _triangle inequality_. From e71f0261cd127c04a6aa03ea21d4d7d028b35729 Mon Sep 17 00:00:00 2001 From: Durrell Chamorro Date: Sat, 17 Sep 2016 20:00:34 -0700 Subject: [PATCH 3/3] Improve explanation of the triangle inequality theorem and add a Dig Deeper section. --- exercises/triangle/description.md | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/exercises/triangle/description.md b/exercises/triangle/description.md index 942e9fa46c..791e96c282 100644 --- a/exercises/triangle/description.md +++ b/exercises/triangle/description.md @@ -2,16 +2,27 @@ The program should raise an error if the triangle cannot exist. ## Hint -In mathematics, a degenerate case is a limiting case in which an element of a -class of objects is qualitatively different from the rest of the class and hence -belongs to another, usually simpler, class. +The triangle inequality theorem states: +z ≤ x + y +where x,y, and z are the lengths of the sides of a triangle. In other words, the +sum of the lengths of any two sides of a triangle always exceeds or is equal to +the length of the third side. -1. If the sum of the lengths of any two sides of a triangle is equal to the - length of the third side, there exists a degenerate triangle. +A corollary to the triangle inequality theorem is there are two classes of +triangles--degenerate and non-degenerate. If the sum of the lengths of any two +sides of a triangle is greater than the length of the third side, that triangle +is two dimensional, has area, and belongs to the non-degenerate class. In +mathematics, a degenerate case is a limiting case in which an element of a class +of objects is qualitatively different from the rest of the class and hence +belongs to another, usually simpler, class. The degenerate case of the triangle +inequality theorem is when the sum of the lengths of any two sides of a triangle +is equal to the length of the third side. A triangle with such qualities is +qualitatively different from all the triangles in the non-degenerate class since +it is one dimensional, looks like a straight line, and has no area. Such +triangles are called degenerate triangles and they belong to the degenerate +class. -2. The sum of the lengths of any two sides of a triangle always exceeds or is - equal to the length of the third side, a principle known as the _triangle - inequality_. +## Dig Deeper -Therefore, a degenerate triangle does not violate the principle of _triangle -inequality_. +This exercise does not test for degenerate triangles. Feel free to add your own +tests to check for degenerate triangles.