# Simple Algebra Problem

1. Feb 27, 2014

1. The problem statement, all variables and given/known data
a/b/c=?

3. The attempt at a solution
I think it's $\frac{a}{bc}$.However,that sometimes gives incorrect results.
I never learned that 3 divisions.(I was lazy in gr.8)

2. Feb 27, 2014

### pasmith

The notation is ambiguous. It can be interpreted either as
$$(a/b)/c = \frac{a}{bc}$$
or as
$$a/(b/c) = \frac{ac}{b}$$
and this is a point on which reasonable people may differ.

In short: don't ever write a/b/c; write either (a/b)/c or a/(b/c).

3. Feb 27, 2014

No.
For example:
Make t the subject(isolate t)
$\frac{3}{s+4}=3t$
What will you do here?

4. Feb 27, 2014

### Staff: Mentor

To the best of my knowledge, the behavior of expressions such as a/b/c is better understood in programming than in the mathematics we are taught. In C (and other languages based on C) and Fortran, a/b/c is exactly the same as if it were written (a/b)/c.

I remember being taught a mnemonic device in 9th grade - "my dear aunt sally" - to help remind us that multiplication and division take precedence over addition and subtraction. Since that time a new mnemonic has appeared - PEMDAS - parentheses, exponents, multiplication, division, addition, subtraction - but that wasn't around when I was in junior high and high school.

Besides listing the precedences of all operators, the C programming language defines the order in which some operations will be performed. This is called the associativity of an operation. For example, the associativity of the addition operator (+) is left to right, so the expression a + b + c is evaluated as if it were written (a + b) + c. Likewise, the associativity of the multiplication and division operators (* and /) is left to right, so as already mentioned, a/b/c is the same as (a/b)/c.

With regard to 3/(s + 4) = 3t, divide both sides by 3 to get 1/(s + 4) = t.

Note that before simplification, the left side could be written as 3/(s + 4)/3. As long as mathematics abides by the same associativity that C and other programming languages specify, then the above is understood to mean 1/(s + 4). Not all mathematicians are C programmers though, so my assumption might not be valid.

5. Feb 27, 2014

Shouldn't it be PEDMAS?

btw,voko gave a very nice way to deal with these kind of problems in post 22.
So Is that the best way?
According to you a/b/c is (a/b)/c
But according to voko,it is (ac)/b

6. Feb 27, 2014

### Staff: Mentor

It doesn't matter. Multiplication and division are at the same precedence level. Likewise, addition and subtraction are at the same level
Post 22? There aren't that many posts in this thread.
Apparently voko is interpreting a/b/c as a/(b/c) = a * 1/(b/c) = a * (c/b) = (ac)/b. As an expression in one of the programming languages I cited, that would not be correct. As far as I know, the rules in mathematics aren't as clearcut.

7. Feb 27, 2014

### PeroK

I believe the rules of mathematics are clear. If * is a non-associative operation, then
a*b*c is not well-defined. There's no convention on where to put the brackets.

8. Feb 27, 2014

9. Feb 27, 2014

### BruceW

yeah, mathematically I agree with pasmith and PeroK. the expression a/b/c is not mathematically meaningful, since (as far as I know) the convention a/b/c = (a/b)/c is just a programmer's convention, not a mathematician's convention.

edit: or whatever the programmer's convention is, be it a/b/c=(a/b)/c or a/b/c=a/(b/c) either way, I don't think this is a mathematician's convention.

second edit: also, in your other thread with voko, you have simply been lazy to not write in the brackets. You should put the brackets in the correct place, otherwise the equation you were writing is meaningless.

10. Feb 27, 2014

### Staff: Mentor

Well, that's exactly the problem, the lack of defined-ness of some expressions. Mathematically, division and subtraction aren't associative, but for one reason or another, the programming languages I cited have defined how all of the operators associate (which is left to right for the arithmetic operators +, -, *, and /). It seems a lot more satisfying to me that there aren't as many expressions that aren't well-defined.

IMO, the math folks should adopt the same conventions...

11. Feb 27, 2014

### BruceW

It is just notation really. It has no mathematical importance. (Is what I'd guess a mathematician would say). we could universally adopt the notation a/b/c=(a/b)/c and this would not change anything mathematically. It would just mean we could avoid using the brackets. In truth, I think it reads nicer with the brackets. I'd rather have less convention and more brackets.

edit: unless I was writing a really long program with a lot of (a/b)/c. In this case, I'd rather have the convention than the brackets. So I can see why programmers adopt a convention.

12. Feb 27, 2014

### Ray Vickson

If you parse from left to right it is unambiguous: a/b/c = (a/b)/c. However, parsing from left to right is not always done. It can even be done differently in the same type of software. For example, in Maple the Classic worksheet interprets a/bX as (a/b)X, so a/b+c = (a/b)+c, a/b*c = (a/b)c and a/b/c = a/(bc); this can be handy when we want a/(b1*b2*b3* ... *bn), which is entered as a/b1/b2/b3/.../bn. However, in the newer "standard" worksheet, a/bX is interpreted as a/(bX. When we start by typing a/b we immediately (on screen and in memory) get a solidus with 'a' in the numerator and with a denominator that starts with 'b'. So a/b+c would be a/(b+c (and would be open-ended until we enter a right-arrow), a/b*c would be a/(b*c (open-ended) and a/b/c would be a/(b/(c (both open-ended).

13. Feb 27, 2014

### Staff: Mentor

It might help to reduce confusion, so I'd say it's important that way.
As far as I know, the associativity rules in C (and C++, C#, Java, etc.) make it possible for the compiler to generate code to evaluate an expression. The fewer expressions whose behavior is undefined, the better.

I agree that parentheses are important. Although compilers can parse a complicated expression, human readers have a much more difficult time, so adding parentheses can help people.

BTW, as I learned it, these -- [] -- are brackets, these -- () -- are parentheses, and these -- {} -- are braces (also called curly braces). It might be a Britishism to call () brackets.

14. Feb 28, 2014

What do I use then?Programming or mathematics?

15. Feb 28, 2014

a/b/c/d

a=1 , b=2 , c=3 , d=4
Writing this directly into calculator gives
1/24

by voko's method:
(1*4)/(2*3)
=4/6

I don't know.

Yes I agree that parentheses are important.But in a problem like this:
a/b=cd
,
you have no choice than to write a/b/c
It can be written as (a/b)/c but what if the question asked for simplifying the whole ?

16. Feb 28, 2014

### PeroK

I've always said: [] -- are square brackets, () -- are round brackets, and {} -- are curly brackets!

It's probably a US/UK difference.

17. Feb 28, 2014

### BruceW

If you're just doing mathematics, then use the brackets (or parentheses, if that's the right word for it). So then, you don't even need to think about left-to-right or right-to-left parsing. The parentheses will make it explicitly clear what you mean. If I had a step in a calculation that was like a/b/c then I would not be surprised if my teacher gave me a minus mark for that. (although it would be a bit mean).

If you're programming, then feel free to use a/b/c to mean (a/b)/c. But keep in mind that not every programming language will necessarily adhere to this convention. (although it seems like most of them do, by what others have been saying in this thread).

Last edited: Feb 28, 2014
18. Feb 28, 2014

### BruceW

haha, yeah, I've always said: [] -- are square brackets, {} -- are curly brackets, and () -- are round brackets, or parentheses. And I've always just said 'brackets' if I don't care which one. I don't know if my language is 'correct' or not though.

19. Feb 28, 2014

### BruceW

Interesting, an example of right-to-left parsing for a/b/c. So, in the new Maple worksheet, it gives a/b/c = a/(b/(c)) = a/(b/c) ? I'll try to remember that, if I ever need to use Maple.

edit: well, I guess I don't need to remember anything, since it draws the solidus on-screen as you're typing.

20. Feb 28, 2014