• marcos@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      5 months ago

      Some people insist there’s no “correct” order for the basic arithmetic operations. And worse, some people insist the correct order is parenthesis first, then left to right.

      Both of those sets of people are wrong.

      • MotoAsh@piefed.social
        link
        fedilink
        English
        arrow-up
        0
        ·
        5 months ago

        Hopefully you can see where their confusion might come from, though. PEMDAS is more P-E-MD-AS. If you have a bunch of unparenthesized addition and subtraction, left to right is correct. A lot of like, firstgrader math problems are just basic problems that are usually left to right (but should have some extras to highlight PEMDAS somewhere I’d hope).

        So they’re mostly telling you they only remember as much math as a small child that barely passed math exercizes.

            • Feathercrown@lemmy.world
              link
              fedilink
              English
              arrow-up
              0
              ·
              4 months ago

              They do, it’s grouping those operations to say that they have the same precedence. Without them it implies you always do addition before subtraction, for example.

              • They do, it’s grouping those operations to say that they have the same precedence

                They don’t. It’s irrelevant that they have the same priority. MD and DM are both correct, and AS and SA are both correct. 2+3-1=4 is correct, -1+3+2=4 is correct.

                Without them it implies you always do addition before subtraction, for example

                And there’s absolutely nothing wrong with doing that, for example. You still always get the correct answer 🙄

                • Feathercrown@lemmy.world
                  link
                  fedilink
                  English
                  arrow-up
                  0
                  ·
                  edit-2
                  4 months ago

                  Uh, no. I don’t think you’ve thought this through, or you’re just using (AS) without realizing it. Conversations around operator precedence can cause real differences in how expressions are evaluated and if you think everyone else is just being pedantic or is confused then you might not underatand it yourself.

                  Take for example the expression 3-2+1.

                  With (AS), 3-2+1 = (3-2)+1 = 1+1 = 2. This is what you would expect, since we do generally agree to evaluate addition and subtraction with the same precedence left-to-right.

                  With SA, the evaluation is the same, and you get the same answer. No issue there for this expression.

                  But with AS, 3-2+1 = 3-(2+1) = 3-3 = 0. So evaluating addition with higher precedence rather than equal precedence yields a different answer.

                  =====

                  Some other pedantic notes you may find interesting:

                  There is no “correct answer” to an expression without defining the order of operations on that expression. Addition, subtraction, etc. are mathematical necessities that must work the way they do. But PE(MD)(AS) is something we made up; there is no actual reason why that must be the operator precedence rule we use, and this is what causes issues with communicating about these things. People don’t realize that writing mathematical expressions out using operator symbols and applying PE(MD)(AS) to evaluate that expression is a choice, an arbitrary decision we made, rather than something fundamental like most everything else they were taught in math class. See also Reverse Polish Notation.

                  Your second example, -1+3+2=4, actually opens up an interesting can of worms. Is negation a different operation than subtraction? You can define it that way. Some people do this, with a smaller, slightly higher subtraction sign before a number indicating negation. Formal definitions sometimes do this too, because operators typically have a set number of arguments, so subtraction is a-b and negation is -c. This avoids issues with expressions starting with a negative number being technically invalid for a two-argument definition of subtraction. Alternatively, you can also define -1 as a single symbol that indicates negative one, not as a negation operation followed by a positive one. These distinctions are for the most part pedantic formalities, but without them you could argue that -1+3+2 evaluated with addition having a higher precedence than subtraction is -(1+3+2) = -6. Defining negation as a separate operation with higher precedence than addition or subtraction, or just saying it’s subtraction and all subtraction has higher prexedence than addition, or saying that -1 is a single symbol, all instead give you your expected answer of 4. Isn’t that interesting?

                  • you’re just using (AS) without realizing it

                    as per the textbooks 🙄

                    Conversations around operator precedence can cause real differences in how expressions are evaluated

                    No they can’t. The rules are universal

                    you might not underatand it yourself

                    says someone about to prove that they don’t understand it… 😂

                    With (AS), 3-2+1 = (3-2)+1 = 1+1 = 2

                    Nope! With AS 3-2+1=+(3+1)-(2)=4-2=2

                    This is what you would expect

                    Yes, I expected you to not understand what AS meant 😂

                    since we do generally agree to evaluate addition and subtraction with the same precedence left-to-right

                    It’s only a convention, not a rule, as just proven

                    With SA, the evaluation is the same

                    No it isn’t. With SA 3-2+1=-(2)+(3+1)=-2+4=2

                    you get the same answer

                    Yep, because order doesn’t matter 🙄 AS and SA both give the same answer

                    No issue there for this expression

                    Or any expression

                    But with AS, 3-2+1 = 3-(2+1)

                    You just violated the rules and changed the sign of the 1 from a + to a minus. 🙄 -(2+1)=-2-1, not -2+1. Welcome to how you got a wrong answer when you wrongly added brackets to it and mixed the different signs together

                    So evaluating addition with higher precedence rather than equal precedence yields a different answer

                    No it doesn’t., as already proven. 3-2+1=+(3+1)-(2)=+4-2=2, same answer 🙄

                  • Some other pedantic notes you may find interesting

                    It’s hilarious that you added in this in afterwards, hoping I wouldn’t see it so you could claim the last word 😂

                    There is no “correct answer” to an expression without defining the order of operations on that expression

                    There is only one order of operations, defined in many Maths textbooks.

                    Addition, subtraction, etc. are mathematical necessities that must work the way they do

                    Hence the order of operations rules, found in Maths textbooks

                    But PE(MD)(AS) is something we made up

                    PEMDAS actually, and yes, it’s only a convention, not the rules themselves

                    there is no actual reason why that must be the operator precedence rule we use

                    That’s why it’s only a convention, and not a rule.

                    this is what causes issues with communicating about these things.

                    Nope, doesn’t cause any issues - the rules themselves are the same everywhere, and all of the different mnemonics all work

                    Your second example, -1+3+2=4, actually opens up an interesting can of worms

                    No it doesn’t

                    so subtraction is a-b

                    Just -b actually

                    negation is -c

                    Which is still subtraction, from 0, because every operation on the numberline starts from 0, we just don’t bother writing the zero (just like we don’t bother writing the + sign when the expression starts with an addition).

                    a two-argument definition of subtraction

                    Subtraction is unary operator, not binary. If you’re subtracting from another number, then that number has it’s own operator that it’s associated with (and might be an unwritten +), it’s not associated with the subtraction at all.

                    you can also define -1 as a single symbol

                    No you can’t. You can put it in Brackets to make it joined to the minus sign though, like in (-1)²=1, as opposed to -1²=-1

                    not as a negation operation followed by a positive one

                    The 1 can’t be positive if it follows a minus sign - it’s the rule of Left Associativity 😂

                    These distinctions are for the most part pedantic formalities

                    No, they’re just you spouting more wrong stuff 😂

                    you could argue that -1+3+2 evaluated with addition having a higher precedence than subtraction is -(1+3+2) = -6

                    No, you can’t. Giving addition a higher priority is +(3+2)-1=+5-1=4, as per Maths textbooks…

                    Isn’t that interesting?

                    No, all of it was wrong, again 😂