Why Is the Area Calculation of a Triangle Using Given Algorithms Unstable?

MtX
Messages
9
Reaction score
0
Consider the following algorithm for computing the area of a triangle with sides of length A, B, and C:

S = (A+B+C) / 2
Area1(A,B,C) = sqrt(S(S-C)(S-B)(S-A)).

A) Explain why this approach is unstable, and illustrate with an example.

B) A student proposes the following less efficient, but more stable, approach:

Area2(A,B,C) = sqrt((A+B+C)(A+B-C)(A-B+C)(-A+B+C)) / 4

Explain why this approach is still unstable and illustrate with an example.

C) Reaarange the formula to produce a more stable version. Explain why it is more stable.


I really have no clue on how to start off but for parts A) and B), I plan to insert arbitrary values of A, B and C, compare the area of the triangle using sides A, B, and C, versus the value of the area after using the Area1 and Area2 equations as examples. I am guessing the compared values will differ greatly and as a result makes this "approach" unstable.

For Part C) however, I have no clue how to begin. Am I suppose to create my own formula? Or modify theirs? What should I do?

Thanks.
 
Physics news on Phys.org
I am not sure what "stability" is supposed to mean. I'll assume that it means expression without minus signs. With very little difficulty I got:

area=sqrt(S(S3+AB(A+B)+AC(A+C)+BC(B+C)+ABC)/2)
 
Namaste & G'day Postulate: A strongly-knit team wins on average over a less knit one Fundamentals: - Two teams face off with 4 players each - A polo team consists of players that each have assigned to them a measure of their ability (called a "Handicap" - 10 is highest, -2 lowest) I attempted to measure close-knitness of a team in terms of standard deviation (SD) of handicaps of the players. Failure: It turns out that, more often than, a team with a higher SD wins. In my language, that...
Hi all, I've been a roulette player for more than 10 years (although I took time off here and there) and it's only now that I'm trying to understand the physics of the game. Basically my strategy in roulette is to divide the wheel roughly into two halves (let's call them A and B). My theory is that in roulette there will invariably be variance. In other words, if A comes up 5 times in a row, B will be due to come up soon. However I have been proven wrong many times, and I have seen some...

Similar threads

Back
Top