14

Let's say i have 4/1/5. or 4 divided by 1 divided by 5. Are there any rules that i am allowed to use to stop any mistakes?, for example this has 2 solutions, 4/5 , and 20.

Edit: Thanks for your responses. It seems the rule of thumb is to start from the beginning and follow through the numbers, while any brackets should be dealt with beforehand.

In which case something like 1/2/3/4 is in fact 1/24.

Edit2: There's a small bounty for whoever can prove that there solution is always the case, and any misuse of it always fails

  • 31
    Compare with $4-1-5$ which by convention means $(4-1)-5$, not $4-(1-5)$ – Hagen von Eitzen Oct 21 '14 at 10:22
  • 10
    This is why schoolchildren should learn math operations with set theory, because it is much easier to understand the abstract concepts. Fractions are only hard because people don't understand what a multiplicative inverse is. – MrDosu Oct 21 '14 at 16:04
  • 2
    @MrDosu I think the problem there is that set theory is like Greek for the people that are actually overseeing the schools. Hopefully one day this will change – Steven Lu Oct 21 '14 at 16:56
  • By calculator logic, we evaluate it from left to right: $$4 \div 1 \div 5 := ((4 \div 1) \div 5) \equiv \frac{4/1}{5}$$ – Nick Oct 21 '14 at 16:59
  • 7
    Aunt Sally would like to have a word with you. – corsiKa Oct 21 '14 at 18:43
  • @iamnotmaynard touche – OutFall Oct 21 '14 at 21:30
  • Is "4-1-5 means (4-1)-5" this way by convention or by definition? – Greenstone Walker Oct 21 '14 at 22:55
  • 1
    Subtraction is defined the same way as division as addition of the additive inverse [e.g.: 4+(-1)+(-5)] so the - operator needs to be left associative also to have that behaviour. Math is beautiful because the core rules upon which all other rules are build are incredibly simplistic. – MrDosu Oct 21 '14 at 23:43
  • If you want to get fancy, you can divide the first number by the subsequent ones multiplied together... 4/(1*5), etc. – Brian Knoblauch Oct 22 '14 at 11:42
  • 1
    @MrDosu By convention $4-1-5=(4-1)-5$ and $4/1/5=(4/1)/5$ but also by convention $4^{1^5}=4^{(1^5)}$ rather than $(4^1)^5$, so convention is not totally consistent – Henry Oct 22 '14 at 13:02
  • @corsiKa "My dear Aunt Sally" won't help in this case, and is wrong if pushed to the extreme. – Teepeemm Oct 22 '14 at 16:54
  • Order of operations includes the fact that anything in the same family is simply read from left to right. This is something someone would have learned at the same time they learned the Aunt Sally mnemonic. – corsiKa Oct 22 '14 at 16:58

11 Answers11

33

In the USA and Canada, perhaps other places too, we use the BEDMAS system for interpreting expressions. First, we calculate the result of bracketed sub-expressions. Then exponentiation. Then from left to right, resolving divisions or multiplications as they show up. Then from left to right, resolving additions and subtractions as they show up.

So in the BEDMAS convention, we would deal with your 4/1/5 by doing the divisions left-to-right. 4/5.

Edit:

As the comments point out, some use PEDMAS instead. P for parenthesis instead of brackets ;)

Lan
  • 472
  • 4
    The first sensible answer I've seen yet. And the only one that's fully correct. This is also the convention used in ALL programming languages. – Clearer Oct 21 '14 at 17:45
  • 2
    Agree. Note also that "resolving . . . as they show up" is important. An amazing amount of people I've encountered in the USA believe multiplication always precedes division (and that addition always precedes subtraction), due to a misinterpretation/poor-teaching-of the similar "PEMDAS" rule. – geometrian Oct 21 '14 at 18:21
  • 3
    Took me a minute. For others: B is "Brackets" for the US's "Parentheses" in PEMDAS. (Also flipping the M and D made it different enough I was wondering if this was an entirely different rule) – Izkata Oct 21 '14 at 21:05
  • 6
    Please don't use "equation" when there is no equal-sign in there. Maybe you mean "expression"? – Paŭlo Ebermann Oct 21 '14 at 21:13
  • 6
    @Clearer: That's not true: Forth, Lisp, APL, and Smalltalk are all exceptions to that. – Michael Shaw Oct 22 '14 at 01:38
  • 1
    While sums and moltiplications associate on the left, it is a good convention that powers associate to the right: A^B^C = A^(B^C). This because $(A^B)^C$ can be written anyway without parenthesis as $A^{BC}$. Python (and maybe other programming languages) agrees with this convention. – Emanuele Paolini Oct 22 '14 at 10:38
  • 1
    Lisp is not an except as it is not an infix language. – DanielV Oct 22 '14 at 12:05
  • Apart from the use of "equation" this answer is correct. But note that by the same rules $2\times3/4\times5$ means $(2\times3/4)\times5$ and evaluates to $15/2$, not to $3/10$. If you want to write $(2\times3)/(4\times5)$ without any parentheses, you must go for $2\times3/4/5$. Those are the rules. But my guess is that these cases would confuse even more people than the example from the question. Especially if done with variables and without explicit $\times$ as in $ab/cd$. – Marc van Leeuwen Oct 22 '14 at 13:48
  • @EmanuelePaolini: Actually in Python ^ means bitwise exclusive-or (as in C), not exponentiation; for exponentiation ** is used. But yes, the latter does associate to the right. – Marc van Leeuwen Oct 22 '14 at 13:53
  • Note however that the claim in this post is at odds with command mathematical usage, where for example “$1/2\pi$” is understood as $1/(2\pi)$ and it is neither the case that the division is done before the multiplication, nor that the divisions and multiplications are taken in left-to-right order. – MJD Oct 22 '14 at 15:42
  • @MJD $1/2\pi$ is indeed understood as $1/(2\pi)$, but $1/2\times\pi$ or even $1/2\cdot\pi$ isn't. It's more like $2\pi$ is taken as a single unit, only split into a multiplication after the explicit operators are resolved. – hvd Oct 23 '14 at 11:38
  • @DanielV: He said "ALL programming languages", not "ALL programming languages that use infix for some things", so it is still an exception. – Michael Shaw Oct 23 '14 at 12:15
  • @MichaelShaw I'm surprised. I have no experience with any of those languages (which is true for most languages). Mea culpa. I stand corrected. I should have written all sane programming languages instead (which, by my definition excludes languages where this is not true). (To everybody else, don't turn this into a fight.) – Clearer Oct 29 '14 at 21:54
  • @Clearer: I can't see any reason to declare a programming language design decision that surprises you to be insane. – Michael Shaw Oct 30 '14 at 01:27
  • @MichaelShaw Neither can I. It appear I wasn't clear enough, but it was a joke. – Clearer Oct 31 '14 at 18:37
23

The double fraction $a/b/c$ should not be allowed because it does not make sense : which operation should we do first ? To make sense, you must add parenthesis (this way, you specify which operation is done first). There are two ways to do it :

$$\frac{\Big( \displaystyle \frac{a}{b} \Big)}{c} = \frac{a}{bc} = (a/b)/c $$

and

$$\frac{a}{\Big( \displaystyle \frac{b}{c} \Big)} = \frac{ac}{b} = a/(b/c). $$

Therefore, $\displaystyle \frac{\Big( \displaystyle \frac{a}{b} \Big)}{c} \neq \frac{a}{\Big( \displaystyle \frac{b}{c} \Big)}$ in general. Be careful to the way you put parenthesis. In general :

$$\frac{\Big( \displaystyle \frac{a}{b} \Big)}{\Big( \displaystyle \color{red}{\frac{c}{d}} \Big)} = \frac{a}{b} \times \color{\red}{\frac{d}{c}} = \frac{ad}{bc}.$$

pitchounet
  • 6,576
  • You haven't answered the question, which was: which one of these does $a/b/c$ mean? – TonyK Oct 21 '14 at 11:30
  • @TonyK : You're right. I edited my post accordingly. – pitchounet Oct 21 '14 at 12:24
  • 14
    IMHO a/b/c is definitely (a/b)/c and never a/(b/c). Similarly a-b-c is (a-b)-c and not a-(b-c). – TrueY Oct 21 '14 at 13:45
  • @TrueY : $a/b/c$ is ambiguous. I do not see why it should be $(a/b)/c$ and not $a/(b/c)$. – pitchounet Oct 21 '14 at 13:50
  • 8
    @jibounet: IMHO a/b/c is as ambiguous as a-b-c. I can be considered ambiguous only if it is written in vertical form (with horizontal divider sings). But rewritten as a÷b÷c or a:b:c looks definite again. – TrueY Oct 21 '14 at 14:19
  • 5
    @TrueY: The fact alone that jibounet thinks it's ambiguous makes it ambiguous. – gnasher729 Oct 21 '14 at 14:41
  • @TrueY : OK, let $a/b/c$ be $(a/b)/c$. Why not, after all! We read from left to right so it is natural to do $(a/b)$ first and then, divide $(a/b)$ by $c$.... – pitchounet Oct 21 '14 at 14:56
  • 2
    -1. Quoting wikipedia: "For example, subtraction and division, as used in conventional math notation, are inherently left-associative.". The notation 4/1/5 is clear and well-defined. – Clément Oct 21 '14 at 23:36
  • 5
    It is in no way ambiguous because algebra isn't imho, it is axiomatic. – MrDosu Oct 22 '14 at 00:01
  • 5
    A more accurate description is $x/y/z$ is unfamiliar -- it's not written very often and people don't see it very often, so they don't have an instinctive response to read it as left-associative. In fact, they may well have never seen or considered such an expression before! –  Oct 22 '14 at 08:56
  • @MrDosu The fact that algebra is unambigous does not mean that our representation of algebraic operations are. (However the fact that division is left associative makes a/b/c unambigous) – Taemyr Oct 22 '14 at 08:59
  • The expression a/b/c is common, and means a / (b * c). The most common use of a/b/c is in the units of acceleration: feet per second per second, or meters per second per second. – Jasper Oct 23 '14 at 06:03
17

Operator Associativity is a core concept of mathematical standard notation. This is a very well defined domain and not the kind of "convention voodoo" implied in many of the answers given here. It is a property of a defined operator that needs to be learned alongside its other properties and cannot be deduced.

Edit:

Most of the confusion here stems from the fact that division is really defined as the multiplicative inverse of a given algebra (which is associcative). Because this abstraction is too hard to grasp for most people the division operator is introduced (non-associative). This needed the inclusion of operator associativity (division is left-associative in school algebra [other systems can define it differently, but its always defined]). Using multiplicative inverse we get:

4 * (1/1) * (1/5)

where order doesnt matter (remember, multiplication is associative).

Edit2:

The multiplicative inverse is defined as that element in a ring that when you multiply the inverse with the original that the result must be the neutral element regarding multiplication. The neutral element is that element that satisfies that being multiplied with anything will result in the same thing. The neutral element of the ring of rational numbers is 1.

So given an element of any ring q, its multiplicative inverse i and the neutral element regarding multiplication e the following must hold:

q * i = e

q * e = q

From this simple rule we define the division operator and it must follow the same behaviour.

MrDosu
  • 279
  • Nice explanation about division being the inverse of multiplication. – Clearer Oct 21 '14 at 17:50
  • Thanks, it's cut a bit short though as it's not clear why the multiplicative inverse of x is 1/x. I personally find this very hard to grasp on a fundamental level when you do it with (real) numbers. – MrDosu Oct 21 '14 at 19:44
  • I loved it when studying math in university when they start to explain it in the way of: "This is how we say what a number actually is. Now we make some rules concerning this symbol called +. Now lets see what we can do with it." Instead of the good ole "1 plus 1 is 2, 1 plus 2 is 3...". Math really is very interesting in a non geek way when you build the rules from the ground up. Its kinda like the universes minecraft. – MrDosu Oct 21 '14 at 19:47
  • 1
    Isn't $1/x$ just notation for the multiplicative inverse of $x$, in which case it is just a tautology that the multiplicative inverse of $x$ is $1/x$? Perhaps I haven't thought about it enough, but doesn't that apply to the reals too? – Joel Bosveld Oct 22 '14 at 02:08
  • @JoelBosveld Yes it applies to every structure that conforms to being a ring. As a thought experiment: Polynomials also form a ring, whats it their multiplicative inverse? It starts getting a bit 'more' then 1/x then. – MrDosu Oct 22 '14 at 02:14
  • Fill disclosure: Im not a mathematician. I am a programmer, so my formalisms might be a bit off while the general logic should be sound (we just hit compile a lot and then append --force to certain commands). – MrDosu Oct 22 '14 at 02:18
  • 2
    There is an interesting alternative notation that $/z$ is used for the reciprocal of $z$, so $x/y$ means $x$ multiplied by $/y$ –  Oct 22 '14 at 08:53
  • When you go from 4/1/5 to 4(1/1)(1/5) you are assuming left associativity, because you are dividing the result of 4/1 with 5. You it would not affect the definition of division as the inverse of multiplication to go by right associativity to 4(1/(1(1/5)) - Dividing 4 with the result of 1/5. – Taemyr Oct 22 '14 at 09:05
  • 1
    @Taemyr I think Hurkyl's comment suggests one way to interpret $4/1/5$ into $4(1/1)(1/5)$ without explicitly assuming left- or right-associativity, by assuming that $/$ is a prefix operator with higher precedence than multiplication (represented by adjacency here and both left- and right-associative, since it's already an associative operator). – Mario Carneiro Oct 22 '14 at 23:57
  • 2
    +1 for "convention voodoo" to describe the fabrications "educators" think they need to come up with to avoid teaching real concepts (like multiplicative inverse). – orome Oct 23 '14 at 02:03
  • @MarioCarneiro interpreting / as a prefix operator of arity two makes the expression ill formed. It would then be interpreted as 4 then the division of 1 and the result of the division of 5 by something unspecified. It's clearly a infix operator, and as such left- or right associativity matters. 4/(1/5) in prefix notation would be /4/1 5 – Taemyr Oct 23 '14 at 07:13
  • @Taemyr $/$ would be a prefix operator of arity one in that interpretation. – Daniel Fischer Oct 23 '14 at 14:02
  • On a sidenote this topic is a great example why democracy doesnt work. – MrDosu Oct 23 '14 at 19:01
  • @DanielFisher Not according to my understanding. Prefix means that the operator comes before the arguments. – Taemyr Oct 24 '14 at 07:37
  • 1
    @Taemyr Daniel has correctly interpreted my statement. I mean that $/x$ is to be interpreted as a function of one argument, where the slash comes before the argument, and with value $\frac1x$. Indeed the operator comes before the argument, but since it is arity one there is only one argument after the slash. – Mario Carneiro Oct 24 '14 at 18:31
11

This isn't really a question of mathematics, but of communication. Some people here are quite sure how to interpret $4/1/5$ correctly, but they don't all agree. Importantly, if I read this expression, even if I know how to interpret it correctly, I don't know if the person writing it knew.

In other words, this kind of expression should be avoided. Either $(4/1)/5$ and $4/(1/5)$ are one hundred percent clear.

gnasher729
  • 10,113
  • 6
    It is not true that "Some people here are quite sure how to interpret 4/1/5 correctly, but they don't all agree", unless some statements arguing that it means --- and must mean --- 4/(1/5) have been deleted. All extant arguments that it has a single meaning also agree on the (4/1)/5 meaning. – Jonathan Cast Oct 21 '14 at 15:48
  • Mathematica is quite sure what it means and disagrees. – gnasher729 Oct 21 '14 at 17:56
  • 4
    Also, we have conventions about this literally to prevent disagreement and confusion. The fact that people still think it means different things only means that some of them are wrong. – geometrian Oct 21 '14 at 18:23
  • @gnasher729 have a source on that? I would bet big money that Mathematica either interprets 4/1/5 as (4/1)/5, or refuses to evaluate because some people find it confusing. http://mathworld.wolfram.com/Precedence.html the makers of Mathematica have this site that says they use PEMDAS. – Mooing Duck Oct 21 '14 at 23:06
  • 2
    @MooingDuck It evaluates it as (4/1)/5 = 4/5. It's not ambiguous at all, multiplication and division are left-to-right associative. Period. If people find it confusing they need to either get comfortable with it or, preferably, use brackets to specify precedence manually. When we say 'ambiguous' we don't mean it's ambiguous with respect to the precedence rules (it is not in this case), just that we are not sure this is what the OP had in mind (we are humans, and humans will err) and don't want to provide help just to be told "oh, yeah, actually I meant " – Thomas Oct 22 '14 at 00:21
9

The notation should not be allowed. You should always write $(4/1)/5$ or $4/(1/5)$ (or better, write the fraction vertically).

That being said, at least the way I was taught in school in the US, with no parentheses, you should perform divisions in the order written, so the answer is $4/5$.

hunter
  • 29,847
1

Generally speaking, a slash '/' is used to state a denominator. So, by convention a/b/c/d/e... should in most cases be interpreted as a/(b*c*d*e...). However, the statement is inherently ambiguous and ill-advised. The reader will, in almost all cases (be they living or machine) be the ultimate decider as to what it means. Therefore, never use such an expression if its interpretation may not be clear (especially if you know a better way) unless correctly understanding is not important.

Andrew
  • 11
  • 2
    I'm not sure that such a convention actually exists. There's a very strong convention that $a-b-c$ means $(a-b)-c$ but, in mathematics, I've never come across such a convention for division. $a/b/c$ is avoided precisely because it has no conventional meaning. (The syntax of any given programming language will specify what such an expression means but, still, a sensible programmer would insert parentheses to make the meaning of the code clear.) – David Richerby Oct 21 '14 at 12:43
  • Mathematica uses $a/b/c=a/(bc)$, for example. – Hans Lundmark Oct 21 '14 at 14:23
  • 2
    Just want to point out that '/' is not a backslash but rather it is just a slash. '' is a backslash. – BeaumontTaz Oct 21 '14 at 15:17
1

It is a matter of notation convention. / is not really much of mathematical notation as it is a typewriter shorthand for a fraction.

But shorthands are not formalized as much as proper mathematical notation. As one interesting data point, see what the METAFONT program designed by none other than Donald Knuth does:

mf
This is METAFONT, Version 2.718281 (TeX Live 2013/Debian)
**\relax

*show 1/2/3/4;
>> 0.66667
*end
Transcript written on mfput.log.

So METAFONT indeed interprets this as (1/2)/(3/4). However, this high affinity for / only works for literal integers: x/y/w/t is interpreted as (((x/y)/w)/t) even when x=1, y=2, w=3, t=4.

Now this is a program written by a renowned mathematician. Morale? Don't rely on any specific interpretation by the reader when using / but rather parenthesize.

  • 1
    What the hell? Who at Metafont thought that it would be a good idea to interpret $a/b/c/d$ as $(a/b)/(c/d)$? If anyone has info on why this is, I would really like to know how this happens. I'm not even sure how you could write a parser with this semantics - maybe $n/m$ where $n,m$ are integers is a native datatype? – Mario Carneiro Oct 23 '14 at 00:06
1

According to the international standard ISO 80000,

(…) a solidus (/) shall not be followed by a multiplication sign or a division sign on the same line unless parentheses are inserted to avoid any ambiguity.

$\frac{a/b}{c} = \frac{a}{bc} = ({a/b})/c = a/({bc})$, not $a/b/c$

$\frac{a}{bc} = a/({b \cdot c})$, not $a/b \cdot c$

1

$4\div1\div5=\dfrac45$, because division (using the division sign) is done from left to right.

$4/1/5$ is more ambiguous and confusing, and should never be written. But if I had to give it a value, I'd go with the above rule and say $\dfrac45$, too.

But writing (4/1)/5 or 4/(1/5) (depending on what you mean) is always preferable to 4/1/5 (unless you don't actually mean fractions—like, if you mean the date or something).

0

First you have to notice that you are dealing with notation. The problem is not about the meaning of the $/$ symbol. Nor about how to evaluate expressions. Here you are at the step when a sequence of symbols is given and should be interpreted to form a meaningful expression. Notice that while the commutative, distributive and associate laws are mathematical properties of the operations, the evaluation order has nothing to do with the operations involved.

You have three possibilities when parsing the string A/B/C:

  1. the string should be interpreted as the expression $(A/B)/C$;
  2. the string should be interpreted as the expression $A/(B/C)$;
  3. the string is not well formed and should be left undefined.

The correct answer is 1. It is a natural convention to associate simbols on the left, following the order in which they are written. So this was recognized as the correct way to interpret this notation. As @hagenvonheitzen as pointed out, this is very natural if you replace division with subtraction... the use of the / symbol is a little bit less natural because we were used to other symbols when we were first taught division. Maybe A:B:C would be more natural. In the era of computers, the / symbol has been choosen for division in every programming language I know, like * has replaced $\times$. In every programming language the string 'A/B/C' is correctly interpreted from left to right. The shift from mathematics to informatics makes sense, since we are speaking of parsing which is a problem largely studied in this field.

About 2. To my knowledge there is nobody who has deliberately made this choice. This would be against intuition, against other convention and against the vast majority of people who as choosen the first interpretation. No way.

We can speak about 3. One could decide that A/B/C cannot be interpreted as a valid notation. Something like AB/C/. It seems that many people here agree with this answer. However think a bit about how to make it precise. If you make this choice, please tell me: what is the rule to follow to decide when the expression is valid and when it is not? Is such a rule easier to grasp than the rule of left associativity? Do you think that it would be good to teach such a rule at school? If you have common sense the answer should be: no.

Because here the point is not if you should or shouldn't use that expression. We all agree that whenever possible: you should'nt use it! The reason being that some people could interpret that notation in a wrong way. However if you are asked to give your interpretation, the answer is: associate from left to right.

addendum. A different story would be about the notation $A^{B^C}$ where most people agree that the better choice is to associate on the right: $A^{(B^C)}$. But also in this case it is good to make a choice and not let the notation be undefined.

addendum 2. A different story would also be the notation: $$ \frac{A}{\frac{B}{C}}. $$ In this case the interpretation is $A/(B/C)$ because the lower bar is shorter than the upper one. For this notation it makes sense to decide that the bar should always be longer than the expressions to which it applies because it cost nothing (non parenthesis are needed) and gives no ambiguity. As a consequence an expression where the two bars have equal length should be rejected as undefined.

-3

YouTube: The Order of Operations is Wrong

Take 8-2+1 for example. In reality, it actually equals (8/1)+(-2/1)+(1/1).

Applying the same logic to 4/1/5 you get:

 (4/1)/(1/1)/(5/1)
=(4/1)x(1/1)x(1/5)
=(4x1x1)/(1x1x5)
=4/5

With (P|B)EDMAS, 6/3/3 could be:

 6/(3/3)
=6/1
=6

or

 (6/3)/3
=2/3

whereas 6/3/3 actually equals

 (6/1)/(3/1)/(3/1)
=(6/1)x(1/3)x(1/3)
=(6x1x1)/(1x3x3)
=6/9
=2/3
Isaac
  • 145
  • 2
    +0 This answer contributes nothing not already mentioned. As pointed out in John's answer, PEMDAS includes the specification that operations at the same level are left-associative, so 6/(3/3) is not a correct interpretation under those rules. – Mario Carneiro Oct 23 '14 at 00:10
  • You won the bounty sir!! – It'sRainingMen Oct 30 '14 at 14:08
  • @MarioCarneiro after looking through the other answers I a.) cannot see John's answer and b.) don't see where PEMDAS "includes the specification that operations ... are left associative". If anything, it separates multiplication from division (MD), and addition from subtraction (AS). If it were PEMDASL (L = left-associative) then you'd be correct, but it's not. PEMDAS provides no explanation why MD before AS, whereas if equations were represented as a combination of all 4 components as described in my answer (PEMA) then left-associativeness wouldn't be necessary – Isaac Oct 17 '16 at 22:02
  • It's been so long since I wrote that that I'm not sure who John could be either. I don't see any deleted posts by a John, so he probably changed his username. Perhaps I meant @Lan? Regarding (b): I use the term PEMDAS to refer to the standard of order of operations for arithmetic, of which the acronym PEMDAS itself is only a mnemonic. The full specification will clarify that (MD) and (AS) are each on the same precedence level, left-assoc, while E is right-assoc (and P has no assoc). "There's no explanation" - it's a standard, not a justification. – Mario Carneiro Oct 18 '16 at 04:31
  • this bandwagon is insane on math stack exchange – Isaac Nov 10 '16 at 23:10