-1
$\begingroup$

I'd like to get comprehensive cost-benefit analysis of using infix notation and postfix/Polish notation in arithmetic for functions (I consider equality differently, since it maps to truth values, instead of numbers, and qualifies as a predicate). What else would it behoove me to consider? I have this much so far:

Infix notation:

Advantages:

  1. Commonality of expression.
  2. We don't need separation symbols for numbers, since symbols for functions effectively do this.
  3. We'd don't have to have a clear idea about the arity of functional symbols before using them.

Disadvantages:

  1. Lack of ability to use the rule of replacement mechanically.
  2. Possible, and arguably actual, ambiguous expressions.
  3. We need an "order of operations", or something similar, to prevent ambiguity.
  4. It takes time and effort to learn about the infinity of arithmetical expressions, in the sense that seeing that from any arithmetical expression and closure, we can have arithmetical expressions beyond that of any given length.

Posfix notation:

Advantages:

  1. Can mechanically use the rule of replacement.
  2. So far as I can tell, it comes as consonant with how we practically use mathematics in everyday life, e. g. when we buy something with say x dollars which costs y dollars, we then figure out how much x and y differ by. Or if we start off walking at time j and finish walking at time i without a stopwatch, then we figure out how long we've walked for by figuring out how much j and i differ by.
  3. We can quickly learn about the infinity of arithmetical expressions.

Disadvantages:

  1. For clarity, we require separation symbols or spaces using Hindu-Arabic numerals.
  2. Not often used by mathematical and logical writers at present.
  3. To keep things clear, it comes as important to recognize the arity of functional symbols before we use them.

What advantages and disadvantages have I missed?

  • 0
    There is the lambda-calculus notation, which views "+" as a function of one number, which returns a function of one variable. So roughly, in normal functional notation, $+\,3\,4$ would be interpreted as $(+(3))(4)$. That is, "plus" is applied to $3$ and we get a function returned, and then that function is applied to $4$. Lambda calculus looks like infix notation, but it is a little deeper - the idea that all functions have one parameter, but can return another function...2013-03-20

2 Answers 2

4

I disagree with much of your analysis, but I think you are missing by far the most important aspect: the ease by which a human can look at a formula and understand what it says.

For example, compare

$ 2 x^2 + 3 x + 1 $

with

$ 2 x 2 \hat{\ } \cdot 3 x \cdot 1 + +$

There are many aspects to standard notation for arithmetic that help make reading easy for humans. The spatial proximity of an operator to what it operates on helps link them together. The visual grouping between terms helps pick out components. To get an idea of the importance of spacing, look at

$ 2 x + 3 y + 4 z $ $ 2\,\; x +\;\! 3\,\;y\;\!+\;\!4\,z$ $ 2 \cdot x + 3 \cdot y + 4 \cdot z $ $2 \times x + 3 \times y + 4 \times z $

In the first of these, it is easy to visually pick out the individual terms ($2x$, $3y$, and $4z$) and recognize they are being added together. This becomes progressively more difficult as you go down the line. And if we used postfix notation

$ 2\: x \times 3\: y \times 4 \:z \times ++ $

maybe with some training one can pick out the three terms quickly, but one cannot recognize how they are be combined without scanning all the way to the end of the expression. A task that is much more difficult if this is part of a larger expression.

  • 0
    Maybe infix is easier to read for human because it requires less stack space? A solution to quadratic equation: `(-b + (b^2 - 4ac)^1/2) / 2a` would looks like: `((b -) (((b 2 ^) 4ac -) (1 2 /) ^) +) (2a) /` in post-fix notation. Or without braces for 2-arity operation: `(b -) b 2 ^ 4ac - 1 2 / ^ + 2a /` . I find myself tracing the post-fix equation slowly to know what are argument for the + operation, either counting the parentheses when provided or creating a 'stack' when no parentheses are provided.2015-07-30
0

I think the biggest issue would be association of the mathematical operation to be executed on any two numbers or variables. As the equation becomes much larger it will be more difficult to relate the operand to the variables. As you will need to scan back and forth, plus you would need to keep track of each operand as it is used. I think spatial relation becomes and important thing here. Disambiguation of the equations in either notation have their drawbacks. But if you natively read and speak a language that is read from left to right it is easier to interpret infix notation, and use an order of operations.