In the instructions of the Triangle exercise, the triangle inequality is given by
a + b ≥ c
b + c ≥ a
c + a ≥ b
When we talk about triangles in the Euclidean geometry sense, the weak inequalities in the formul should be replaced with strong ones, i.e.,
a + b > c
b + c > a
c + a > b
(In fact, the wikipedia article cited in the instructions has a section on the Euclidean geometry, which shows the strong form of the triangle inequality.) I think that the instructions should replace the weaker inequalities with the stronger ones.
Further, the stronger triangle inequalities imply that
We’ve gone back and forth over this a number of times. A triangle with sides 0, 0, 0 is a degenerate triangle. Whether that is or isn’t a triangle is somewhat just a matter of semantics and not important to the exercise.
Is there value in changing the exercise? If not, it’s probably best to just leave it as is.
I haven’t thought about geometry in close to twenty years. What exactly is the difference between weak and strong inequalities? Would the proposed change have a positive effect on students’ understanding? How so? Also, would that require us to deprecate any existing tests?
None of the existing canonical tests would need to change.
" Pursuant to discussion in #202, we have decided NOT to test triangles ",
" where all side lengths are positive but a + b = c. e.g: ",
" (2, 4, 2, Isosceles), (1, 3, 4, Scalene). ",
I like the suggestion. The current instructions imply that if any of the sides are 0, that is not a triangle, but if one of the points lies on the interval between the other two points, such that the height and area are 0, that is a triangle. That seems odd to me.
Just by quickly looking at it, I don’t see any glaring issue with the instructions.
The only problem is with the comment on the canonical-data posted by @keiraville . The 3rd line states that (2, 4, 2, Isosceles), (1, 3, 4, Scalene), but these aren’t valid triangles. They are lines.
That said, the instructions do state:
For a shape to be a triangle at all, all sides have to be of length > 0,
and the sum of the lengths of any two sides must be greater than
or equal to the length of the third side.
This is theoretically correct, but it will certainly mislead those unfamiliar with math terminology, since the “equal” part of the statement is never actually satisfied by valid triangles. As a result, there’s little value in including it, and it can be safely removed from the instructions without changing the tests. The comment on the canonical-data should also be modified to accommodate the change by completely removing lines 4-10.
The problem now is how each track has chosen to handle the tests. Some tracks may have deviated from the existing tests for various reasons, so updating the instructions and the comment on the canonical-data may not be as straightforward as it initially seems.
So I’m not in favor of making changes at this point, unless there’s something that’s clearly incorrect.
Edit: Also i’m not opposed to changes if the other maintainers believe there’s nothing to worry about.
Yes, points and line segments can be taken as degenerate triangles. What looks unnatural to me is that the instructions require that each side must have a (strictly) positive length. If we allow for the degeneracy, it is more natural to require that each side has a nonnegative length.
P. S. When we have a degenerate triangle, we cannot identify three vertices from the shape itself. Suppose that a = 1, b = 1, and c = 2. If it is a triangle, it must be degenerate. But the lengths a and b are rather arbitrary. We can “declare” for the same triangle that a = 0.5 and b = 1.5, because only the end points of the line segment are identified.
The weak inequalities allow three vertices of a triangle to be on a single straight line, while the strong ones rule out this possibility. I feel that the strong inequalities go along with the common use of the word, “triangle”. If you take the exercise as a simple coding task, however, the distinction may not be important.
Thanks for your careful analysis. I am naturally in favor of the change if it has no adverse effects on many tracks. Unfortunately, I know no easy way to assess its effects on so many tracks.
I read the problem description of the triangle exercise again. The main section of it says,
Determine if a triangle is equilateral, isosceles, or scalene.
Then it explains what equilateral, isosceles, and scalene means in terms of the lengths of the three sides of a triangle. My point is that the main part apparently assumes that the data to be given are of an triangle, not a general geometric object.
On the other hand, the Note section of the description says,
For a shape to be a triangle at all, all sides have to be of length > 0, and the sum o f the lengths of any two sides must be greater than or equal to the length of the third side.
The set of conditions mentioned here is a necessary but not sufficient condition for the shape to be a triangle. For example, suppose that we have three distinct line segments of length one parallell to each other. This “shape” satisfies the condition of the Note section, but it is certainly not a triangle. That is, the condition cannot be used for judging wheather or not the given shape is a triangle.
In my honest opinion, the Note section is only useful for data error detection (i.e., If the condition is violated, the data must be in error). But it is probably better to remove the Note section and remove all related tests.