• cerement@slrpnk.net
      link
      fedilink
      arrow-up
      42
      ·
      11 months ago
      • 16 is the right answer if you use PEMDAS only: (8 ÷ 2) × (2 + 2)
      • 1 is the right answer if you use implicit/explicit with PEMDAS: 8 ÷ (2 × (2 + 2))
      • both are correct answers (as in if you don’t put in extra parentheses to reduce ambiguity, you should expect expect either answer)
      • this is also one of the reasons why postfix and prefix notations have an advantage over infix notation
        • postfix (HP, RPN, Forth): 2 2 + 8 2 ÷ × .
        • prefix (Lisp): (× (÷ 8 2) (+ 2 2))
      • brian@programming.dev
        link
        fedilink
        arrow-up
        3
        ·
        11 months ago

        prefix notation doesn’t need parentheses either though, at least in this case. lisp uses them for readability and to get multiple arity operators. infix doesn’t have any ambiguity either if you parenthesize all operations like that.

      • fruitSnackSupreme@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        11 months ago

        How is PEMDAS 16? Multiply is before divide, so it’s 1. I was taught BEDMAS, divide before multiply, which makes it 16. I don’t know what is correct, just asking.

        • synae[he/him]@lemmy.sdf.org
          link
          fedilink
          English
          arrow-up
          2
          ·
          edit-2
          11 months ago

          PEMDAS is actually (PE)(MD)(AS). Those that are grouped together have equal precedence and are evaluated left to right.

          8 / 2 * (2+2)

          8 / 2 * 4

          4 * 4

          16

          Edit to fix formatting, maybe?

          • Zagorath@aussie.zone
            link
            fedilink
            arrow-up
            12
            ·
            11 months ago

            No, because implicit multiplication binds more tightly than explicit. a/b© becomes a/(bש)

              • Zagorath@aussie.zone
                link
                fedilink
                arrow-up
                7
                ·
                11 months ago

                Most maths textbooks written by mathematicians.

                I don’t mean when they’re explaining “here’s how the order of operations works”. I mean in the basic way that they write more advanced problems and the answers they give for them.

                This video, and the prequel to it linked in the description, go into some detail showing who uses what convention and why.

                • Nihilore@lemmy.world
                  link
                  fedilink
                  arrow-up
                  5
                  ·
                  11 months ago

                  Interestingly I’ve wondered if this is regional, as a fellow Aussie I learned the same as you but it seems in other places they learn the other way

                  • Zagorath@aussie.zone
                    link
                    fedilink
                    English
                    arrow-up
                    6
                    ·
                    11 months ago

                    FWIW I went to school in Asia, using an internationally-focused curriculum, rather than going through the Australian curriculum here in Aus.

                    The video I linked includes some discussion with a calculator manufacturer who apparently is under the impression that teachers in North America are asking for strict BIDMAS, so the calculator manufacturer actually switched their calculators to doing that. Until they then got blowback from the rest of the world’s teachers, so they switched back to BIDMAS with juxtaposition being prioritised over division. The video also presents the case that outside of teachers—among actual maths and physics academics—prioritising juxtaposition is always preferred, even in North America.

            • 0ops@lemm.ee
              link
              fedilink
              arrow-up
              3
              ·
              11 months ago

              That’s exactly where the calculators in the op differ. For more examples, Casio calculators do implicit multiplication first, while ti’s treat it the same as explicit multiplication and division. I think that the latter is more predictable personally, but really you just need to know your calculator.

    • Th0rgue@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      11 months ago

      Depends on the system you use. Most common system worldwide and in the academic circles (the oldest of the two) has 1 as the answer.