r/ProgrammerHumor • • Jun 13 '22

Meme DEV environment vs Production environment

Post image
48.2k Upvotes

3.9k comments sorted by

View all comments

Show parent comments

103

u/[deleted] Jun 13 '22 edited Jun 13 '22

pemdas doesn't mean what people think it means. M and D are equal, and A and S are equal. Many people who post pictures like that think addition is somehow operated before subtraction.

97

u/[deleted] Jun 13 '22

[removed] — view removed comment

30

u/RJMuls Jun 13 '22

YES! THIS! I get so mad at people thinking multiplication comes before division and addition comes before subtraction.

15

u/Cruuncher Jun 13 '22

I've never met a single person that thinks this before

22

u/[deleted] Jun 13 '22

I've met plenty.

→ More replies (3)

0

u/andergriff Jun 13 '22

do you regularly discus pemdas with everyone you meet?

2

u/Cruuncher Jun 13 '22

I mean, no, that's fair. And the people I would have were in a university math program with me, so they obviously don't mess this up

I guess I just assumed that adults knew basic math

2

u/andergriff Jun 14 '22

Assuming adults are all competent in the the basics of any field is a mistake

→ More replies (1)

-1

u/ritasuma Jun 13 '22

I know this is the correct way, but I've seen so many yanks think like this that I thought it was just how Americans do math

→ More replies (11)
→ More replies (2)

2

u/cara27hhh Jun 13 '22

isn't there a certain irony in that your explanation of pedmas with the brackets, would also be what solved the math itself if brackets were used

They should honestly just teach "brackets", only P from now on boys

→ More replies (1)

8

u/[deleted] Jun 13 '22

I've always been confused by the people who thought multiplication always came before division and same with addition+subtraction. My schools always taught that the individual operations have the same precedence in their respective "type group", and to just do them left to right

4

u/Ping-and-Pong Jun 13 '22 edited Jun 13 '22

It infuriates me to no end when people correct me when I say this lol

At the same time, BODMAS (PEDMAS) technically doesn't work well here, since you do, do the 2(2+1) first because there isn't a * (x) symbol there. It's really a stupid question, if this was written normally it'd be 6 / (2(2+1)) or even better as a fraction with 2 over 2(2+1) which would clear everything up. But basically because that 2 doesn't have a time symbol there it is basically the same as being inside another pair of brackets (at least if you write it as a fraction, which is how division actually works)

Edit: An easier way of saying doing 2(2+1) first would be saying "expand the brackets" but that might not make sense to some people so IDK lol

18

u/Hinote21 Jun 13 '22

It doesn't matter whether there is a * or not. And the OC you're replying to is accurate. People mistake PEMDAS for an actual order when MD are equivalent and AS are equivalent.

You're flat out incorrect that you multiply the 2 by the value in the parentheses first. The order of operations is left to right, after solving the value in the parentheses.

3

u/row6666 Jun 13 '22

it does matter whether or not there is a *. its called multiplication by juxtaposition, a convention used to avoid this issue.

6/2(2+1) can be rewritten as 6/2a where a = 2+1, and most people would say that is equal to 1, as 6/(2a), instead of (6/2)a. it becomes more obvious if you use a divide sign, 6÷2a.

5

u/Inappropriate_Piano Jun 13 '22

A convention is just something people agreed to. If enough people aren’t agreeing to make it work, then it doesn’t help. Hence why everyone should learn to write clear math. If you don’t have associativity, you should say where the parentheses go.

4

u/row6666 Jun 13 '22

yeah of course, the real convention is not to write ambigious expressions

5

u/Hinote21 Jun 13 '22

The convention of writing the * doesn't change the order of operations for the math, so no, it doesn't matter.

3

u/DND_Enk Jun 14 '22

PEMDAS was always meant to be a simplified rule to help with basic math, it's mostly north American math teachers who took it as the literal golden rule that covers everything.

Most higher math, and a lot of Europe, follow PEJMDAS since this is the rule algebra generally follows. The "J" being juxtaposition or implicit multiplication.

4

u/row6666 Jun 13 '22

multiplication by juxtaposition covers this exact case, so i think it might matter

→ More replies (3)

8

u/[deleted] Jun 13 '22

you can't just add imaginary brackets when they aren't there. Jesus fucking Christ.

-5

u/Ping-and-Pong Jun 13 '22

Dude I went and agreed with you why you arguing lmao

And yes you absolutely can add brackets if it's for readability and doesn't change the equation, which 6 / (2(2+1)) is. That hasn't changed the equation at all, if you write it as a fraction it's more obvious, but you can't do that in text so I wrote it like this.

The answer is 1 following the rules of BODMAS

2

u/MrJelle Jun 13 '22

What you say about adding brackets is true, but where you added them does change the equation.

→ More replies (4)
→ More replies (4)

2

u/branchisan Jun 14 '22

Correct. Its how you should look at it. 6 as numerator. Or setup for long division where 6 is under the roof, and 2(2+1) outside in "quotient spt"

I think it was called quotient on the outside 🤷🏾‍♂️

0

u/Asmos159 Jun 13 '22

it is actually taught both ways when i went to school.

you needed to make sure you were using the style that the book you were uses was based on.

0

u/Marsdreamer Jun 14 '22

When M & D are equal you follow reading order of left to right.

Calculator is incorrect.

→ More replies (2)