|Re: Entry Methods|
Message #8 Posted by C.Ret on 29 Mar 2012, 4:28 p.m.,
in response to message #6 by fhub
I don't see any ambiguity in both expressions - there are clearly defined rules of precedence:
1) expressions in parentheses (...) first
2) operations with higher priority first (i.e. ^ before *,/ before +,-)
3) operations with the same priority from left to right (with one exception: ^ from right to left,
i.e. a^b^c = a^(b^c))
So 10^(-2)^2 is definitely 10^((-2)^2)=10^4=10000 and 3/2(1+3)=(3/2)*(1+3)=1.5*4=6
I am sorry not to agree with you. But, this will not prove you are wrong. Au contraire !
By following your rules I have understand why you don't see any ambiguity. Especially rule 3) is of great help to resolve the ambiguity I saw.
But, I am no computer scientist. The rules I use in algebra expression are a bit older than yours. There is no general direction in case of operator of the same priority.
In the rule I was instructed to follow, the sentences only specify that, in the case of equal priority operators, a vinculum have to be used in order to dissolve any ambiguity.
Priority rules I was instructed to follow in publications are:
1. The calculations contained in parentheses (or brackets) take precedence over the calculations outside of the parentheses. The fraction bar or the square root bar act as a pair of parenthesis;
2. The exponent takes priority over multiplication, division, addition and subtraction;
3. The multiplication and division take priority over addition and subtraction;
4. Any ambiguity has to be removed by the use of a delimiter (the vinculum, the point or parenthesis) and a spatial organization of the expression.
As more and more algebra are type in computer and calculator, these old style rules of algebra and mathematics’ publications have been supplanted by ‘Data Processing Rules’ style or fashion.
But having a specific direction of evaluating expression from right to left (or inversely from left to right), or from inside – out (or inversely from outside – in) has never been a commonly accepted or applied universal convention. In contrary, the purpose of the most universally followed rules in paper publications is that, whatever are the way (the direction) the reader process, he will get the same result or expression.
Oppositely it is a really common, quite universal, in most of programming languages to have a rule indicating in which way (direction)the expression have to be process or evaluated.
In conclusion, I am not surprise that today well computer educated peoples from this actual millennium encounter or see no ambiguity at all in the abscond and badly delimited expressions such a as the above 10^(-2)^2 or 5/2(3+1).
Whereas an old fashion XXth century scientist will find these expression ambiguous and badly formatted.