Submitted by TheManNamedPeterPan t3_z8c5vf in explainlikeimfive
DecentChanceOfLousy t1_iyc04yn wrote
Reply to comment by orangezeroalpha in ELI5 why we first multiply, then add by TheManNamedPeterPan
Parentheses very quickly become unreadable when you have too many of them.
3(5x^3+2)^2 becomes 3*(((5*(x^3))+2)^2) without order of operations to do the implicit grouping for you. It's not incomprehensible, but it's much harder to read. Longer equations would be awful.
Cypher1388 t1_iyc76hc wrote
I live in excel for work... Color coded parentheses ftw
... Seriously though, I probably use more than I need to, but they reduce ambiguity to a point that any loss of immediate readability is a sacrifice worth making imo
the_running_stache t1_iyc8r0r wrote
As a financial engineer, I write a lot of mathematical code. I, too, use more parentheses than I need to, but they reduce ambiguity to the next person reading the code. Long love parentheses!
DecentChanceOfLousy t1_iydvi3w wrote
Yup. Programming languages or technical formulas end up having so many parenthesis that most editors support color coding or matched pair highlighting so you can sort out which is which. And you'd need more if every operation had to have parenthesis around it to clarify which order it's supposed to be done in. If you kept the left-to-right convention (despite throwing other conventions which are no more arbitrary away), you could reorder some things to remove a bit of the confusion. But it wouldn't help nearly as much as every symbol having an order of operations so you skip as many parenthesis as possible while remaining unambiguous.
[deleted] t1_iyc7x79 wrote
[removed]
PobreCositaFea_ t1_iyc9ded wrote
In maths you use this: [ ] and this: { } as second and third parentheses. It´s not so confusing then.
MoobooMagoo t1_iyc0zud wrote
You're not wrong, but most of the confusion with order of operations happens at the multiplication -> addition level. At least in my experience. Like 5x^2 is really obvious what it's supposed to be to most people (if you're using actual super script, anyway).
Although that said, I understand that this very well may be because once you start doing more complicated math that actually requires a lot of parentheses and exponents and stuff you've already used the order of operations so many times it starts to become second nature, so it might just be that those are more obvious because the people that are encountering them are already well practiced.
SirX86 t1_iyc20rc wrote
>Like 5x^2 is really obvious what it's supposed to be to most people
In the spirit of the original question, you could argue: why is it obvious that 5x² means 5*(x²) and not (5*x)²?
Indeed people often get confused over -x²: is that (-1)(x²) or (-1x)²?
SupaFugDup t1_iyc6y57 wrote
Just to be sure, it is -1(x²) right?
-Revelation- t1_iyc9brh wrote
it is
Kalirren t1_iycayo7 wrote
And the answer to the "why" is because exponentiation distributes over multiplication, and not the other way around, just like multiplication distributes over addition.
xy^(2) = x*(y^2) = x*y^2 != (x*y)^2 = (xy)^(2) = x^(2)y^(2)
x*(y^2) != (x*y) ^ (x*2)
No-Eggplant-5396 t1_iyed1g0 wrote
Convention. It's like the alphabet. The alphabet isn't required to be in ABC ordering by a fundamental force of nature but rather just some particular ordering for better communication.
DecentChanceOfLousy t1_iyc1nqo wrote
That is, indeed, the whole point. You practice them so that they become second nature when you do more complicated math.
Viewing a single comment thread. View all comments