Of Notations and Assumptions: Every now an then some smart alack - TopicsExpress



          

Of Notations and Assumptions: Every now an then some smart alack will post an expression and ask for people to give the answer. The questions are usually designed such that those who remember standard algebraic order of operations rules will get one answer and those who evaluate the expression from right to left will get another. Below is the most resent example seen on facebook (via Kyle Huitt). 3 + 3 * 3 - 3 + 3 Yes, I agree that written expressions usually assume algebraic order of operations. In which the expression is equivalent to the following. (((3 + (3 * 3)) - 3) + 3 or without unnecessary parenthesis 3 + (3 * 3) - 3 + 3 Consider, however, that the standard algebraic order of operation is not necessarily the only possible notation. If a teacher were to verbally quiz a student "What is 3 + 3 * 3 - 3 + 3 ?", it would be assumed that they should evaluate the each operation should be evaluated in the order spoken. Thus, the simple in-order interpretation is correct in the context of this verbal notation. Lest you retort this is text based so there is no other option, please wait. I am not done. Standard algebra assumes a notation that is known as infix notation. Infix notation puts the operands on either side of an operator that has two operands. Infix format: operand1 operator operand2 When an infix expression includes more than one operation it can be ambiguous and, thus, requires an order of operations and parenthesis to understand the meaning. There are other notations. Prefix and postfix notations put the operator on the first or last, respectively. Prefix format: operator operand1 operand2 Postfix format: operand1 operand2 operator Both of these notations are unambiguous and, thus, do not require an order of operations or parenthesis. In exchange for this power, they are typically less readable. Below is an equivalent expression in three different notations. I will use distinct numbers as operands so as to avoid confusing them. Infix: 1 + (2 * 3) - 4 + 5 Prefix: + - + 1 * 2 3 4 5 Postfix: 1 2 3 * + 4 - 5 + Lest you think that this is useless dose of theory, I can testify that for computers, postfix notation is much easier to process than the standard infix notation. Conclusion: Communication requires an understood language. In the case of technical/mathematical communication a notation must be assumed. Please give some grace to those who do not assume standard algebraic infix notation, if the writer did not specify the intended notation. Likewise, I shall be gracious to those who choose to block me after reading this excessively nerdy post. (Congrats to those who read to the end!)
Posted on: Sat, 15 Jun 2013 19:55:27 +0000

Trending Topics



Recently Viewed Topics




© 2015