1
$\begingroup$

Possible Duplicate:
Do values attached to integers have implicit parentheses?
What is 48÷2(9+3)?
What is “multiplication by juxtaposition”?

What is the precedence of the concatention operator when used for multiplication?

If it's the same as multiplication, 5/7y would mean (5/7)*y.

However, it also seems reasonable to see it as 5/(7*y).

I realize I can avoid the issue by writing "5y/7" or using explicit parentheses, but am curious about the "correct" answer.

Googling was surprisingly unhelpful: most results were about the precedence of string concatention in programming languages.

$\endgroup$
  • 1
    $\begingroup$ Duplicates: here, here, and here $\endgroup$ – process91 Aug 26 '12 at 15:48
  • 1
    $\begingroup$ You are right that it is confusing and should therefore be avoided. I suspect that most people who write it are thinking $5/(7y)$. $\endgroup$ – Ross Millikan Aug 26 '12 at 15:48
  • 1
    $\begingroup$ "When there's doubt on how it's seen in others' eyes\always remember to parenthesize!" $\endgroup$ – J. M. is a poor mathematician Aug 26 '12 at 15:50
  • 2
    $\begingroup$ PARI interprets 5/7*x as (5/7)x, just as a point of reference. I personally think the notation without parentheses is ambiguous and should be avoided. $\endgroup$ – KCd Aug 26 '12 at 15:51
  • 1
    $\begingroup$ @Thomas: If you don't know how to get a symbol in LaTeX, Detexify is of great help. Assuming you meant the symbol $\div$, I've just used it to find that it is generated by the macro \div. $\endgroup$ – celtschk Aug 26 '12 at 16:00
2
$\begingroup$

I think that you almost answered your own question:

I realize I can avoid the issue by writing "5y/7" or using explicit parentheses.

I don't know of any "correct" way to interpret $5/7y$, and I don't believe that there is any. There are lots of notations in math that are not that clear, and the only answer is to make them clear. So I would never write $5/7y$ on a blackboard if I meant $5/(7y)$.

If you by $5/7y$ mean $5/7*y$, then from what I understand, when programming a compiler would interpret this as $5*y/7$.

$\endgroup$
  • $\begingroup$ Actually in the vast majority of programming languages, 5/7y would simply be a syntax error, because multiplication needs generally be explicitly written with *. In C++11 it could, however, denote the division of the standard integer 5 by a user-defined numeric literal 7y (which most likely will be the number 7 represented by an user-defined numeric type). Indeed, the only programming language I know where juxtaposition is interpreted as multiplication is Mathematica's; here indeed 5/7y means $(5/7)y$. $\endgroup$ – celtschk Aug 26 '12 at 15:56
  • $\begingroup$ @celtschk: You are right! I will edit $\endgroup$ – Thomas Aug 26 '12 at 15:58
  • $\begingroup$ Speaking of Mathematica, IIRC Singular also interprets juxtaposition as multiplication. $\endgroup$ – user2468 Aug 26 '12 at 16:09
1
$\begingroup$

I believe concatenation strictly applies to the joining of two strings together. I would imagine that extending this to mathematical operations there would be parenthesis around the objects in order to avoid ambiguity, ie $$ 5/7 * y/x $$ would yield $$\dfrac{5}{7}\cdot\dfrac{y}{x}$$

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.