3

I've been in a lengthy discussion today about how to interpret the division symbol. There seem to be two views on what it means.

• Everything on the left hand symbol is divided by everything on the right hand of the symbol.
or
• The operator only deals with the term to its immediate left and right.

Which is correct? I tried to find a specific definition for the usage of the division operator but I couldn't find it.

  • 1
    the $\div$ is a horrible piece of notation and should be forever banned. Use brackets and parentheses to make it clear what is dividing what. Or use fractional notation. If there is nothing to guide you then only the terms immediately left and right of the division symbol, are acting on one another. – Doug M Jun 15 '17 at 02:28

4 Answers4

3

The division slash should bind at the same level as multiplication and before addition and subtraction. Within multiplication and division it should be left to right. The computer languages I have used have respected this, so $a+b/cd$ would be parsed as $a+((b/c)d)$. I have used calculators that just apply operators left to right, so $a+b/cd$ would be $((a+b)/c)d,$ which is clearly wrong compared to the mathematical standard. Scientific calculators I have had respected the order of operations. We get many posts that do not do it properly, but you can usually guess what is intended. If you see $1/x^2+1$ it is most likely $1/(x^2+1)$ that is wanted.

Ross Millikan
  • 383,099
2

Everything to the immediate left and right will be affected by the division symbol, everything else wont. This is how it is on most calculators and how order of operations PEMDAS defines the usage.

1

The standard is that multiplication and division have the same level of precedence, and precede addition and subtraction, which have the same precedence. Within a precedence level, they are left associative, meaning you perform operations from left to right.

This means that in $1 + 2 \div 3 \times 4 - 5$ gets computed as

$$ (1 + ((2 \div 3) \times 4)) - 5 $$

Whether $\div$ or $/$ is used for division doesn't matter. Similarly, both $\times$ and $\cdot$ have the same meaning for representing multiplication, as does leaving the operation implicit, such as the product in $2a$.

Handwritten formulas usually have visual cues that indicate how terms should be grouped, such as ${}^2\!/\!{}_3 + 4$.

Unfortunately, errors where people accidentally write something they don't mean, or even people who outright violate the standard convention and use something else entirely are common enough that you can't really rely on the intended meaning of a formula to be what is written.

Because of this, typeset formulas tend to be written in a way that can't be interpreted wrongly, such as $(1/2)x$ rather than $1/2x$ which risks being misinterpreted as $1/(2x)$. If you encounter a formula that could be interpreted either way, you're better off trying to infer the correct meaning from context rather than applying the standard rule.

Ultimately, (in my opinion) the driving force that cements this particular convention is programming languages, and the convention described above is nearly universal.

The only exception I have ever seen is that wolfram alpha interprets $1/xy$ as $1/(xy)$. And it isn't even consistent in this; wolfram alpha interprets $1/2x$ as $(1/2)x$ instead.

0

• Everything on the left hand symbol is divided by everything on the right hand of the symbol. or
• The operator only deals with the term to its immediate left and right.

Which is correct? I tried to find a specific definition for the usage of the division operator but I couldn't find it.

Direct answer

There is no syntactic definition of what is a mathematical expression, and how to interpret it. For more you can read Syntactic theory of mathematical expressions.

Still the basic convention is the operands of arithmetic operators ($\small + - \times \div$) are limited to the closest term on each side.

  • Term: Terms are separated by a + or - sign in an overall expression

If you need to include more, then parentheses must be used to group several parts into a single operand. Examples:

  • $\small 2 + 4/2 + 6 = 10$ (standard rule)
  • $\small (2+4) / 2 + 6 = 9$ (altering interpretation using parentheses)

Note a term can include functions. Function themselves apply to the next term only: $\small \sin 2 \pi / 3 + 2$ means $\small \sin (\frac 2 3 \pi) + 2$.

This closest term rule makes the use of any precedence order unnecessary in math, contrary to programming languages which heavily rely on it.

I'm providing additional elements in case you're interested.


Lack of syntactic rules for mathematical expressions

Unfortunately math conventions, contrary to what is often assumed, are not so strict, due to history, with discoveries in different countries and mathematicians inventing symbolic representations matching their own cultural environment. Sometimes multiple conventions coexist (e.g. Lagrange vs. Leibniz for differential calculus)

In math there are a lot of details which are not defined, how an expression is interpreted is one, but think of something very simple, the multiplication of two numbers. The formal definition of multiplication in base 10 involves polynomials and convolution, the product of 123 by 345 in base 10 is something like:

  • $p_1(10) = 1 \times 10^2 + 2 \times 10^1 + 3 \times 10^0$
  • $p_2(10) = 3 \times 10^2 + 4 \times 10^1 + 5 \times 10^0$
  • $p_1(10) \times p_2(10) = (p_1 \ast p_2) (10)$

Performing a regular multiplication of the coefficients with single digit products, row indentation and column summation is just a convolution of the two polynomials expressing numbers in base 10.

Order of precedence in programming languages

Some confusion can be introduced by the similarity with programming language operators where operands are distributed to neighboring operators using precedence rules. So even if this is not part of your question, let's provide some details for comparison.

In math, conventions often rely on typography:

  • $\small 2^{2+1} + 5 = 13$

In most programming languages the possibility of using superscripts like above doesn't exist, an explicit exponentiation symbol, which can be ^ or ** according to the language syntax, is used, but this prevents to identify where the exponent ends, and only the first value (not even the first term) is used unless parentheses are used:

  • $\small 2^{1+6/2} + 1$ is coded 2**(1+6/2) + 1 in Python

There are many cases like this one, the constant use of parentheses is not practical. Syntactic rules, which have no equivalent in math, have been set to associate values to operators by default. Each operator has a precedence level associated to it, and an operands feeds either the left or right neighboring operators according to which has the highest precedence.

Order of precedence in Python:

  • Level 0: highest precedence allowing to group simple expressions into complex expressions before further parsing takes place.

  • Level 3: Exponentiation. Higher precedence than arithmetic operators, so 2 ** 1+2 gives 4, not 8.

  • Level 4: unary minus used to create negative quantities (the binary minus, the subtraction operator, uses the same symbol, but is totally separate).

  • Level 6: Multiplication and division.

  • Level 7: Addition and subtraction.

With the rules above 3*(2+4)/-3**2 gives -2.

mins
  • 485