# Do values attached to integers have implicit parentheses?

Given $5x/30x^2$ I was wondering which is the correct equivalent form.

According to BEDMAS this expression is equivalent to $5*\cfrac{x}{30}*x^2$ but, intuitively, I believe that it could also look like: $\cfrac{5x}{30x^2}$

I asked this question on MathOverflow (which was "Off-topic" and closed) and was told it was ambiguous. I was wondering what the convention was or if such a convention exists. According to Wikipedia the order of operations can be different based on the mnemonic used.

-
I think you misread the Wikipedia article. The bit about mnemonics is just a tangential paragraph pointing out that mnemonics can be misleading about the order of operation. The conventional order is correctly documented earlier in the article. It supports the BEDMAS parsing. – whuber Jan 5 '11 at 23:53
You were asking about the ambiguity, and it was closed as ambiguous? I sense potential irony. – Mateen Ulhaq Sep 25 '11 at 3:24

The programming languages I have used give equal priority to multiply and divide, and do them from left to right. This would support the $5*\cfrac{x}{30}*x^2$ assertion. As Wikipedia says, the acronym BEDMAS may be misleading as it implies that division precedes multiplication and addition precedes subtraction, while each pair is of equal priority. However, I suspect most people writing $5x/30x^2$ do mean $\cfrac{5x}{30x^2}$. I would say there is a tendency in people's minds to make the division slash lower priority than multiplication. But this is an excellent reason to put in parentheses when you are writing, and to check carefully what the author means when reading.

-
I think that the interpretation $5x/30x^2 = (5x)/(30x^2)$ would be giving division a lower priority than multiplication. I speculate on why this would be in my answer. – Niel de Beaudrap Jan 6 '11 at 9:40
If you assume left to right associativity I think this expression would be treated as $((5\times x)/30) \times x^2$. – VelvetThunder Jan 6 '11 at 12:57
@Debanjan: you are strictly correct, but the value is the same as shown. – Ross Millikan Jan 6 '11 at 13:50
I don't think you will find much programming languages that allow you to write $5x/30x^2$ without any sign for the multiplications, but those that do (I know MetaFont does when the left factor is an explicit number) should give higher priority to such implicit multiplications than to explicit multiplications or divisions. – Marc van Leeuwen Dec 11 '12 at 9:16
Why even use the parentheses? If we're actually writing math for human consumption, we can easily use LaTeX (or other solutions) in most environments anymore. We can avoid both potential ambiguity and the difficulty of reading many nested parentheses. – mach Mar 31 '14 at 6:03

I am going to play Devil's Advocate on this one, because I've given it a little bit of thought after a tangentially related question on MathOverflow about bad notation. There is a good lexical argument to be made for the "intuitive" reading of 5x/30x2 as (5x)/(30x2).

Disclaimer. The following argument is not intended to communicate why expressions such as a/bc are unambiguous. By definition, if there is no strong socially agreed upon convention, it is therefore ambiguous. However, I will argue for the hypothesis that almost anyone raised from an early age to read a European language, who quickly reads such an expression without reflecting too much, will probably understand a/bc = a/(bc). Therefore, there exists a reasonable opportunity to establish such a convention.

One of the responders to the question of bad notation complained about the usage of juxtaposition for multiplication: he thought it introduced too much ambiguitiy. (For instance, does f(x + y) refer to the product of a scalar f with x + y, or the value of a function f evaluated at x + y, or something else?) In the comments to that answer, I speculated that the reason for this convention is that it reduces the problem of parsing a mathematical expression such as  ax2 + bx + c  to the previously-solved problem (for Europeans, anyway) of parsing a written sentence in a European language, which breaks sentences into words. Juxtaposed variables form nice little cohesive "words". This hypothesis can even be extended to account for exponents and subscripts — more notation in which we don't use operator 'symbols' — to play the role of intra-word apostrophes or other diacritical marks.

Under this hypothesis, I can make a strong case for prefering the reading a/bc as a/(bc). Unlike multiplication or exponentiation, we introduce an actual symbol — a prominent punctuation mark, if you will, as intrusive as the + symbol — into the expression. This divides the expression into two "words", a and bc, upon which we perform the operation of division; thus leading to the reading a/(bc). This is especially likely in the case where a is effectively a place-holder, as in 1/2x, where for "fluent speakers of mathematics" the 1 is only there as a placeholder to allow the concept of multiplicative inverse to be expressed. Add to this the fact that it makes no sense at all to write a/bc if you wish to convey the meaning ac/b, and one can almost safely say that anyone who writes a/bc means a/(bc).

The above is meant as a descriptivist (as opposed to prescriptivist) argument for how people read and write mathematics. If this is going to happen anyway, and if (as appears to be the case) it doesn't entail any heavy modification of our existing conventions, why not accept it in order to allow more flexibility in our notational repertoire? We can cut down on parentheses, and get rid of this phony ambiguity between something which can be better expressed anyway and an expression which at present we can only confidently convey with parentheses or with extra vertical space.

Now, of course, there is no solid existing agreement about whether to read a/bc as a/(bc) or as (a/b)c, except to accept that latter because of BEDMAS or what-have-you. So if your job is to evaluate your student's ability to communicate, then you should conclude that they aren't doing such a good job. But if you are trying to evaluate what they mean — and if you believe that they learned to read a European language from a tender age — then chances that when they write 5x/30x2, they mean (5x)/(30x2).

-
Some related evidence: I searched for examples of $a/bc$ in actual mathematical literature, and found several that meant $a/(bc)$, and none that meant $(a/b)\cdot c$. math.stackexchange.com/a/213416 – MJD Mar 4 '14 at 15:03
@MJD: I agree with you that multiplication using an operator should read left-to-right with division using an in-line operator, but multiplication without an operator should be grouped tighter than anything else; of course, if division is written with the dividend above a line and divisor below, the line should establish the grouping. Whether (a / (b * c)) should be written as a/bc or a/(bc) may be a judgement call, but the interpretation of a/bc is not. – supercat Mar 4 '14 at 19:17
@MJD: Slight correction: it should group tighter than any other operators. Exponentiation written using a superscript should only grab the rightmost item. – supercat Mar 4 '14 at 19:47

It's just sloppy notation. You should never, ever write an expression like it, and you should complain to whoever gave it to you.

-
I don't have a choice, students might write it like that and I was wondering what they meant. – Joe Jan 6 '11 at 0:06
If a student wrote it I would assume (5x)/(30x^2) because the alternate would be less intuitive. But you should tell your students not to write expressions like this. – Qiaochu Yuan Jan 6 '11 at 0:08
I am a lowly programmer and the system allows for such shenanigans. – Joe Jan 6 '11 at 0:12
$\rm a/bc\$ is ambiguous. It could mean $\rm\ a/(bc)\$ or $\rm\ (a/b)c$ – Bill Dubuque Jan 6 '11 at 1:30
@Joe: the requirements of software and the requirements of education are different. Software has to be as flexible as possible, but education is supposed to prepare the student for either the real world or more education, so it's natural to emphasize teaching your students how to communicate clearly. And a/bc is not clear communication. – Qiaochu Yuan Jan 6 '11 at 11:43

The conventions that $a/bc$ means $a/(bc)$, that $\ln 2x$ means $\ln(2x)$, and so on were universally established and very useful. Unfortunately, the combined influence of computer-style notation and excessive safe-playing by mathematics examiners has led to the present clutter of parentheses. Just pick up any maths book printed before 1970 (and many more recent ones), and you will see that absolutely no ambiguity arises. We need conventions like these; otherwise we will find ourselves having to write $\sin(4x) = (2\sin(2x))\cos(2x)$ for $\sin 4x = 2 \sin 2x \cos 2x$, to prove that we don't mean $(\sin 4)x = 2 \sin((2x \cos2)x)$, etc.

-
Funny... contrary to what you say Principia Mathematica has ambiguity in it, and it got written long before computers. Also, you don't need any of these conventions or parentheses. Sin (4.x) could get written Sin .4x or Sin 4x. where "." indicates multiplication – Doug Spoonwood Apr 12 '12 at 4:17
I don't understand the downvotes to this answer. I am quite used to "/" not being the same as the binary division symbol from grade school. For example I would never read $1/2\pi$ as $\pi/2$, and I agree with John Bentin that computer parsing is a likely reason anyone would think those are identical. – Carl Mummert Jul 28 '12 at 2:32

In hand-written form, a horizontal line is a better delimiter for division. In type-set form, ditto: as in $\frac{5x}{30 x^2}$. Those of us of a certain age learned that a horizontal line was a grouping symbol. The slash creates the apparent ambiguity and should be avoided without parenthetical disambiguation. Observe that in $\TeX$, an over-use of braces is not harmful. The same is true with parentheses. Maturing math students should write mathematical expressions in correct form; otherwise, humans and machines will misinterpret the meaning.

-

I think it depends on what is meant by the symbol $/$.

If the symbol $/$ is solely an indication of the binary division operator, sometimes also written $\div$, then the rule that all multiplications and divisions are performed together, working left-to-right, applies (that is, $a/bc$ should be taken to mean $\frac{a}{b}c$). If, however, the symbol $/$ is a vinculum (and, despite what Wikipedia says there, I have heard people use "vinculum" in the non-horizontal case) indicating division and grouping simultaneously, then $a/bc$ should be taken to mean $\frac{a}{bc}$.

However, if the latter sense is intended, I would expect the vinculum to appear bigger than a standard slash (in fact, at least for me, MathJax typesets $/$ to appear slightly bigger than a standard /) and I would also expect the "numerator" to be offset higher and the "demoninator" to be offset lower, e.g. $^a/_{bc}$

I suspect that the predominant interpretation at the moment is the former, that $/$ is equivalent to $\div$. I also know that on some earlier-model graphing calculators from Texas Instruments (the TI-81, I believe; none from the TI-82 onward), the latter interpretation was used (e.g., the input 8/2*2 would return 2).

-

I think that the ambiguity originates, not from what is written, but from whom does the writing.

One who is completing her math assignment should write $\frac{a}{b}$ on her paper. One who is shingling your roof should write $1-1/2"\times 25 \div 7$ on a piece of plywood.

-