I feel like I am getting trolled
Isn’t 17 the actual right answer?
Exactly
So it’s just an unfunny meme?
I think it’s meant to play with your expectations. Normally someone’s take being posted is to show them being confidently stupid, otherwise it isn’t as interesting and doesn’t go viral.However, because we’re primed to view it from that lens, we feel crazy to think we’re doing the math correctly and getting the “wrong answer” from what we assume is the “confident dipshit”.
There’s layers beyond the superficial.
I fell for it. It’s crazy to think how heavily I’ve been trained to believe everything I see is wrong in the most embarrassing and laughable way possible. That’s pretty depressing if you think about it.
As most memes are.
Not even a meme.
More like a sad realization of the state of (un)education in some parts of the so-called civilized world.
You laugh not to cry.
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.
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.
If you have a bunch of unparenthesized addition and subtraction, left to right is correct
If you have a bunch of unparenthesized addition and subtraction, left to right doesn’t matter.
1 + 2 + 3 = 3 + 2 + 1
True, but as with many things, something has to be the rule for processing it. For many teachers as I’ve heard, order of appearance is ‘the rule’ when commutative properties apply. … at least until algebra demands simplification, but that’s a different topic.
something has to be the rule for processing it
Well the rule is: any order goes. Summation is commutative.
No, you completely misunderstood my point. My point is not to describe all valid interpretations of the commutative property, but the one most slow kids will hear.
OFC the actual rule is the order doesn’t matter, but kids that don’t pick up on the nuance of the commutative property will still remember, “order of appearance is fine”.
Yes thank you! If you have a sum it is really great to order it in a way that makes it better to ad in your head and i think that lots of people do that without thinking about it. X=2+3+1+6+2+4+7+5 X=2+3+5+4+6+7+1+2 X=5+5 + 10 +7+1+2 X=10 + 10 + 7+3 X=10 + 10 + 10
If you have a bunch of unparenthesized addition and subtraction, left to right doesn’t matter.
Right, because 1-2-3=3-2-1.
Right, because 1-2-3=3-2-1
No, 1-2-3=-3-2+1. You changed the signs on the 1 and the 3.
You flipped the sign on the 3 and 1.
I did not flip any signs, merely reversed the order in which the operations are written out. If you read the right side from right to left, it has the same meaning as the left side from left to right.
Hell, the convention that the sign is on the left is also just a convention, as is the idea that the smallest digit is on the right (which should be a familiar issue to programmers, if you look up big endian vs little endian)
If that’s your idea of reversing the order, then you’re not talking about the same thing as SpaceCadet@feddit.nl. They’re talking about the order of operations and the associativity/commutativity property. You’re talking about the order of the symbols.
PE(MD)(AS)
Now just remember to account for those parentheses first…
PE(MD)(AS) Now just remember to account for those parentheses first
Those Brackets don’t matter. I don’t know why people insist it does
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 🙄
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?
Huh I just remembered the orders of arithmetic but parentheses trump all so do them first (I use them in even the calculator app). Mean I assume that’s that that says but never learned that acronym is all. Now figuring out categories of words;really does my noodle in sometimes. Cause some words can be either depending on context. Math when it’s written out has (mostly) the same answer. I say mostly because somewhere in the back of my brain there are some scenarios where something more complicated than straight arithmetic can come out oddly but written as such should come out the same.
I mean, arithmetic order is just convention, not a mathematical truth. But that convention works in the way we know, yes, because that’s what’s… well… convention
I mean, arithmetic order is just convention
Nope, rules arising from the definition of the operators in the first place.
not a mathematical truth
It most certainly is a mathematical truth!
But that convention works in the way we know, yes, because that’s what’s… well… convention
The mnemonics are conventions, the rules are rules
The rules are socially agreed upon. They are not a mathematical truth. There is nothing about the order of multiple different operators in the definition of the operators themselves. An operator is simply just a function or mapping, and you can order those however you like. All that matters is just what calculation it is that you’re after
The rules are socially agreed upon
Nope! Universal laws.
They are not a mathematical truth.
Yes they are! 😂
There is nothing about the order of multiple different operators in the definition of the operators themselves
That’s exactly where it is. 2x3 is defined as 2+2+2, therefore if you don’t do Multiplication before Addition you get wrong answers

you can order those however you like.
No you can’t! 😂 2+3x4=5x4=20, Oops! WRONG ANSWER 😂
All that matters is just what calculation it is that you’re after
And if you want the right answer then you have to obey the order of operations rules
That’s a very simplistic view of maths. It’s convention https://en.wikipedia.org/wiki/Order_of_operations
Just because a definition of an operator contains another operator, does not require that operator to take precedence. As you pointed out, 2+3*4 could just as well be calculated to 5*4 and thus 20. There’s no mathematical contradiction there. Nothing broke. You just get a different answer. This is all perfectly in line with how maths work.
You can think of operators as functions, in that case, you could rewrite 2+3*4 as add(2, mult(3, 4)), for typical convention. But it could just as well be mult(add(2, 3), 4), where addition takes precedence. Or, similarly, for 2*3+4, as add(mult(2, 3), 4) for typical convention, or mult(2, add(3, 4)), where addition takes precedence. And I hope you see how, in here, everything seems to work just fine, it just depends on how you rearrange things. This sort of functional breakdown of operators is much closer to mathematical reality, and our operators is just convention, to make it easier to read.
Something in between would be requiring parentheses around every operator, to enforce order. Such as (2+(3*4)) or ((2+3)*4)
That’s a very simplistic view of maths
The Distributive Law and Arithmetic is very simple.
It’s convention
Nope, a literal Law. See screenshot
Isn’t a Maths textbook, and has many mistakes in it
Just because a definition of an operator contains another operator, does not require that operator to take precedence
Yes it does 😂
2+3x4=2+3+3+3+3=14 by definition of Multiplication
2+3x4=5x4=20 Oops! WRONG ANSWER 😂
As you pointed out, 2+34 could just as well be calculated to 54 and thus 20
No, I pointed out that it can’t be calculated like that, you get a wrong answer, and you get a wrong answer because 3x4=3+3+3+3 by definition
There’s no mathematical contradiction there
Just a wrong answer and a right one. If I have 1 2 litre bottle of milk, and 4 3 litre bottles of milk, even young kids know how to count up how many litres I have. Go ahead and ask them what the correct answer is 🙄
Nothing broke
You got a wrong answer when you broke the rules of Maths. Spoiler alert: I don’t have 20 litres of milk
You just get a different answer
A provably wrong answer 😂
This is all perfectly in line with how maths work
2+3x4=20 is not in line with how Maths works. 2+3+3+3+3 does not equal 20 😂
add(2, mult(3, 4)), for typical
rule
But it could just as well be mult(add(2, 3), 4), where addition takes precedence
And it gives you a wrong answer 🙄 I still don’t have 20 litres of milk
And I hope you see how, in here, everything seems to work just fine
No, I see quite clearly that I have 14 litres of milk, not 20 litres of milk. Even a young kid can count up and tell you that
it just depends on how you rearrange things
Correctly or not
our operators is just convention
The notation is, the rules aren’t
Something in between would be requiring parentheses around every operator, to enforce order
No it wouldn’t. You know we’ve only been using brackets in Maths for 300 years, right? Order of operations is much older than that
Such as (2+(3*4))
Which is exactly how they did it before we started using Brackets in Maths 😂 2+3x4=2+3+3+3+3=14, not complicated.
Social conventions are real, well defined things. Some mathematicians like to pretend they aren’t, while using a truckload of them; that’s a hypocritical opinion.
That’s not to say you can’t change them. But all of basic arithmetic is a social convention, you can redefine the numbers and operations any time you want too.
Social conventions are real, well defined things
So are the laws of nature, that Maths arises from
Some mathematicians like to pretend they aren’t, while using a truckload of them; that’s a hypocritical opinion
No, you making false accusations against Mathematicians is a strawman
That’s not to say you can’t change them
You can change the conventions, you cannot change the rules
But all of basic arithmetic is a social convention
Nope, law of nature. Even several animals know how to count.
you can redefine the numbers and operations any time you want too
And you end up back where you started, since you can’t change the laws of nature
Well, this is just a writing standard that is globally agreed on,
The writing rules are defined by humans not by natural force
(That one thing and another thing are two things, is a rule from nature, as comparison)
There is no answer. Because there is no question.
That is a problem, tho
I know the solution
deleted by creator
Yeah I know that. But I was feeling confused as to why it was here. That’s why I was feeling trolled, because it made me doubt basic math for being posted in a memes community.
They did the joke wrong. To do it right you need to use the ÷ symbol. Because people never use that after they learn fractions, people treat things like a + b ÷ c + d as
a + b ----- c + dOr (a + b) ÷ (c + d) when they should be treating it as a + (b ÷ c) + d.
That’s the most common one of these “troll math” tricks. Because notating as
a + b + d - cIs much more common and useful. So people get used to grouping everything around the division operator as if they’re in parentheses.
Or
12 / 2(6)
And trying to argue this is 36.Now that’s a good troll math thing because it gets really deep into the weeds of mathematical notation. There isn’t one true order of operations that is objectively correct, and on top of that, that’s hardly the way most people would write that. As in, if you wrote that by hand, you wouldn’t use the
/symbol. You’d either use ÷ or a proper fraction.It’s a good candidate for nerd sniping.
Personally, I’d call that 36 as written given the context you’re saying it in, instead of calling it 1. But I’d say it’s ambiguous and you should notate in a way to avoid ambiguities. Especially if you’re in the camp of multiplication like
a(b)being different fromaband/ora × b.Well, now you might be running into syntax issues instead of PEMDAS issues depending on what they’re confused about. If it’s 12 over 2*6, it’s 1. If it’s 12 ÷ 2 x 6, it’s 36.
A lot of people try a bunch of funky stuff to represent fractions in text form (like mixing spaces and no spaces) when they should just be treating it like a programmer has to, and use parenthesis if it’s a complex fraction in basic text form.
The P in PEMDAS means to solve everything within parentheses first; there is no “distribution” step or rule that says multiplying without a visible operator other than parentheses comes first. So yes, 36 is valid here. It’s mostly because PEMDAS never shows up in the same context as this sort of multiplication or large fractions
Treat
a + b/c + dasa + b/(c + d)I can almost understand, I was guilty of doing that in school with multiplication, but auto-parenthesising the first part is really crazy take, imoThat’s a really odd way to parse it.
a + b ----- c + b
Alternatively, the poster calculated the wrong answer, thus assuming this guy was wrong.
Gotcha gotcha, sorry
Removed by mod
This shit take got deleted right in front of my eyes
The system works
Oh so just like me on !lemmyshitpost@lemmy.world
Presuming PEMDAS is our order of operations and the 5 next to the parentheses indicates multiplication…
2+5(8-5) -> 2+5(3) -> 2+15=17
Other than adding a multiplication indicator next to the left parentheses for clarification (I believe it’s * for programming and text chat purposes, a miniature “x” or dot for pen and paper/traditional calculators), this seems fine, yeah.
…I worry about how many people may not understand how to solve equations like these.
That’s not even an equation, just basic arithmetic
Technically not algebra, right? Algebra is where you move things around and solve for variables, and that kind of thing. This is just arithmetic.
You’re right, that’s what I meant. Fixed it, thanks!
Technically not algebra, right?
No, it actually is Algebra. The Distributive Law isn’t taught to students until they start on Algebra.
This is just arithmetic
There’s no a(b+c) in Arithmetic.
I don’t think you’re right. The wiki page literally uses a similar equation as an example of “elementary arithmetic.” It also uses a similar one, but with variables, as an example in “elementary algebra.” That implies that yes, this is arithmetic, and the introduction of variables is what makes it algebra.
It doesn’t matter what course finally teaches it to you. That could be just out of convenience, not by definition part of that domain. It’s been ages since I took it, though I could swear I learned this in pre-algebra (meaning before algebra), or earlier. I could be wrong on this though. Again, it’s been a very long time.
I don’t think you’re right
You don’t think Maths textbooks are right??
The wiki page
is full of disinformation. Note that they literally never cite any Maths textbooks
as an example of “elementary arithmetic.”
And whichever Joe Blow My Next Door Neighbour wrote that is wrong
as an example in “elementary algebra.”
Algebra isn’t taught until high school
That implies that yes, this is arithmetic,
No, anything with a(b+c) is Algebra, taught in Year 7
the introduction of variables is what makes it algebra
and the rules of Algebra, which includes a(b+c)=(ab+ac). There is no such rule in Arithmetic.
It doesn’t matter what course finally teaches it to you
It does if you’re going to argue over whether it’s Arithmetic or Algebra.
not by definition part of that domain
The Distributive Law is 100% part of Algebra. It’s one of the very first things taught (right after pronumerals and substitution).
It’s been ages since I took it
I teach it. We teach it to Year 7, at the start of Algebra
You’re very rude. Also, Ill informed, and you think you’re smarter than you are. For example, this:
as an example in “elementary algebra.”
Algebra isn’t taught until high school
Elementary doesn’t mean elementary school. Do you think elementary particles are the ones they teach you in elementary school? Lol. Elementary means fundamental or basic.
You’re very rude
What do you expect to happen when you call a Maths teacher wrong about Maths?
Ill informed
Maths teachers are ill informed about Maths?? 😂
Elementary means fundamental or basic
Which therefore contradicts your argument about it being part of Arithmetic, which is taught in elementary school, Algebra isn’t
Fair enough, I’ve heard “math problem” and “math equation” used interchangeably.
Also you would be surprised how many people do not know basic algebra, at least in the US rofl
You. You are one of them bc you do not know what an equation is.
There is no algebra here. This is arithmetic.
When I made my example, I used an algebraic expression, but yeah, the original question was arithmetic, sorry. Not very good at explaining things XD
the original question was arithmetic
No, it’s actually Algebra. There is no a(b+c) in Arithmetic
You are one of them bc you do not know what an equation is.
You are one of the people who doesn’t know what a(b+c) is
There is no algebra here
Yes there is, 5(8-5).
This is arithmetic
There’s no a(b+c) in Arithmetic
Algebra has horrible syntax. Way too much implications.
Implications or assignment? They didn’t specify notation.
That’s not even an equation, just basic arithmetic
Basic Algebra actually. Students aren’t taught the Distributive Law until they start on Algebra
While I never failed a math class, I also never went past high school. When would your presumptions NOT be true?
Some forms of programming syntax, although there are the fringe cases where an equation (or function in programming) is represented by a symbol in conjunction with a parentheses input.
For example:
y(x) = 2*x+3
5+y(1) = 10, as 1 is substituted in for x in the prior equation.
And in some languages a number can be used as a name of a variable or a function, so it can be anything really
Not in most programming languages, though. You cannot start names with a number. Unless you’re using some strange character that merely looks like a number, anyways. Programming with unicode can get weird but generally works without issue these days.
Wouldn’t we just assume function expressions are always “in parenthesis”? Then it’s just a substitution and no rules were changed.
Wouldn’t we just assume function expressions are always “in parenthesis”?
No, because factorised Terms also are, ab+ac=a(b+c).
But factorised terms are multiplications, so they’re still following the same rules: a(b+c) = a*(b+c)
Example: 2(3+5)=16, and also 2*3+2*5=16
But factorised terms are multiplications,
No, they’re Distribution done in the Brackets step, a(b+c)=(ab+ac), now solve (ab+ac)
a(b+c) = a*(b+c)
Nope! a(b+c)=(ab+ac). 1/a(b+c)=1/(ab+ac), but 1/ax(b+c)=(b+c)/a.
23+25=16
(2x3+2x5) actually, or you’ll get the wrong answer when it follows a Division sign. See previous point
1/a(b+c)=1/(ab+ac)
Nope, that’s wrong. See https://www.wolframalpha.com/input?i=10%2F2(2%2B3) for reference.
Multiplication sign is not required in situations like this. Same with unknowns - you don’t have to write
2*x, you just write2x.I prefer BM-DAS, no one’s out here doing exponents, and no one calls brackets “parentheses”…
The way I was taught growing up, brackets are [these]. Parenthesis are (these).
Yes, technically the latter are also brackets. But they can also be called parenthesis, whereas the former is exclusively a bracket. So we were taught to call them separate words to differentiate while doing equations.
I’m a theoretical physics grad student and a night school maths teacher, I have never heard this distinction. People in academia around me call them round and square brackets.
It’s a US vs UK (and probably others) distinction. The ( ) are almost never called brackets in the US, unless it’s a regional thing I’m not aware of. Also the [ ] didn’t get used in any math classes I was in the US up through calculus except for matrices.
Interesting! Nobody at my institute is a native English speaker. They’re from several European and some Asian and south American countries.
Yeah, but as an adult it depends entirely on whether you’re in an industry or hobby that requires that level of bracket nuance/exponents.
Most of us are just trying to remember the basics.
I learnt it as BODMAS (brackets, orders, division and multiplication, addition and subtraction).
Edit: I see we’re repeating points from the earlier posts down there 👇 (with default sort).
Pemdas, parenthesis first, for a total of 3. Then multiplication, 15, then addition. 17. What’s hard about this?
you go the other direction below the equator
Legit gave me pause for like half a second. Damnit lol
Isn’t the southern hemisphere above the equator if you live there
depends if you are normal or planar in ENU coordinates
What’s hard about it is people are fucking stupid.
No, it’s written poorly to drive engagement. People read left to right and try to do math that way too, but if you want to be mean to people who don’t remember things they learned in elementary school then never applied in real life you write it like OP.
(8-5)5+2
Far easier for most people, but then you don’t get the arguments…
I studied physics a bit and order of operations was always clear. Not sure why people are down voting this.
Yes, thank you! Sure, it’d be great if people remembered arithmetic rules, but just write it better and it won’t matter.
It’s written the same way literally thousands of math problems in thousands of textbooks have written the same type of math problem for the last 100 years. OP did not write it that way to be “mean.” He wrote it that way because it’s a legit way to write it.
The operational order is fucked, the way I rewrote is more readable, even if you remember the order. The only reason you’d write the equation like that is to be mean, there’s no reason to write it like that unless you’re trying to trip people up.
You got it wrong on your first try, didn’t you? Lol, it’s not “mean” to write a math problem. The whole point of memorizing the order of operations is so that you can solve it no matter what order the equation is written in. No one wrote this problem on purpose just to make you fail to understand it, that’s dumb.
This was literally written for twitter content…
I just fail to see how you come to the conclusion that it was written in a “mean” way. It’s math, there is no “nice” way to write an equation.
I fucking suck at math and totally just re-proved it to myself with this problem lmao.
It didn’t make sense to me to multiply the 3 & the 5 with zero consideration for the “2”. I have ALWAYS struggled with the steps to solve these types of equations.
So the answer I got was 21. Some of us are just bad with numbers, I s’pose.
The numbers in the equation and their totals are completely irrelevant to the order you perform the operations.
I don’t think it’s an issue of “being bad with numbers”, I think the issue is not understanding the logic or being able to understand the bottom up type of thinking or something.
This is absolutely not a problem of being bad with numbers. That’s like if I had trouble reading a Chinese sentence about gardening and said I’m just bad with plants. My issue is that I’m not familiar with the notation used to explain the concept - not a problem with the concept itself that the notation merely arbitrarily symbolizes.
Being good or bad at math is not really an inherent thing, aside from some geniuses and some people with disabilities. If you want to be good at math, you can be!
If you don’t remember pemdas, you can use the longer P.lease E.xcuse M.y D.ear A.unt S.ally.
That’s the answer I arrived at as well, don’t feel so bad. I’m more of a writer than a calculator, though.
Its order of operations, to get rid of brackets do the internal, then the 5 tells you there was 5 sets of the amount in brackets. Rather than 2+5 first.
Some other parent’s thesis.
Cruel Parent’s Thesis?
Pemdas, parenthesis first, for a total of 3
Nope, a total of 15.
Then multiplication
There isn’t any Multiplication, only Addition and Brackets (and Subtraction inside Brackets).

And what do you do with the number inside the when you want to get rid of it?
And what do you do with the number inside the when you want to get rid of it?
You literally must distribute the coefficient before you can do anything with what is inside to remove Brackets, as per The Distributive Law, a(b+c)=(ab+ac), now you can work on getting rid of what is inside.
And what do you do with and and the b and then the a and the c? If you want to simplify the equation?
And what do you do with and and the b and then the a and the c? If you want to simplify the equation?
Add them, obviously 🙄
Guess I’ve been trolled.
And what do you do with and and the b and then the a and the c?
BTW, there’s no “the a and the b” and “the a and the c”, there’s ab and ac, which need to be added. If a=2, b=3, and c=4, we have 2(3+4)=(6+8)=14
5 isn’t a valid function name, is obviously the right answer.
How can you be sure it’s not defined when we only see one line?
They didn’t say it’s not defined, they said it’s not a valid name. Most languages don’t allow function names to start with a number, so 5 literally cannot be a function if that’s the case.
But that’s assuming this isn’t some really obscure language.
It could be a Church Numeral
I’m pretty sure that’s a module operator…
Depends on the language.
I’m sorry but isn’t this elementary school math?
I got some people really angry at me when I suggested writing some math expression with parenthesis so it would be clearer. I think someone told me that order of operations is like a natural law and not a convention, and thus everyone should know it or be able to figure it out.
I sometimes like to add unnecessary parentheses or brackets to section things off and improve legibility, but I don’t do any math stuff collaboratively, so I have no idea whether others would find that disruptive or helpful.
I do this, sometimes it helps reveal a natural pattern when some parts of earlier terms have “disappeared” to simplification
I mean, there are very few ambiguous cases when you know how the order of operations works.
Using parenthesis can really help if you want to simplify a term or need to rewrite something. I do that all the time because a lot of times you then can just cross stuff out fast on equations or get a common term that just has some factor instead of having a convolutet equation.
I got really angry because the prettier code formatter insists on removing parentheses, making things less clear. Because it’s an “opinionated” formatter you can’t tell it not to do that without using ugly hacks.
Sure, logically there are times when you don’t need them. But, often it helps to explain what’s happening in the code when you can use parentheses to group certain things. It helps in particular when you want to use “&&” and “||” to say “do X only if Y fails”.
I think you can do
// prettier-ignore, because I remember facing that exact situation.I’ve done that, but that’s ugly.
deleted by creator
2 5 8 5 - × + for you RPN fans =)
Actually:
2 <enter> 5 <enter> 8 <enter> 5 - x +
10 keystrokes
I use RPN on my phone calculator for fun but it can also be annoying sometimes.
On my CASIO FX-260 Solar II calculator (super cheap, really nice and simple but also powerful) that would be:
2 + 5 ( 8 - 5 ) =
9 keystrokes
You could do
8 <enter> 5 - 5 × 2 +-> 8 keystrokes
8 5 - 5 * 2 + CR .
But that’s a specific optimization where you can no longer read the numbers left to right, the original intent of RPN.
Im terrible at math, what is this though?
RPN or Reverse Polish Notation is a notation for calculators to be less ambiguous. The last numbers use the operator to their right, repeat. So no need for parenthesis or PEMDAS.
- 2 5 8 5 - × +
- (8 - 5 = 3)
- 2 5 3 × +
- (5 × 3 = 15)
- 15 2 +
- (15 + 2 = 17)
- 17
This might actually help me thank you!
This might actually help me thank you!
Any PEMDAS enjoyers in chat?
PEMDAS bitches.
It’s interesting that you can somewhat tell where you are from based on this, I learned it as BODMAS
O - oxponent?
Orders.
Brackets, Orders (powers and roots), Division, Multiplication, Addition, and Subtraction
Division, Multiplication, Addition, and Subtraction
This is fucking so many people over… It should be limited - like Orders - to only Multiplication and Addition.
Because division is the same operation as multiplication, and subtraction is the same operation as addition, and they have the same “weight” in the order of operations (meaning, you do them left-to-right).
Another commenter mentioned something similar, how they’re interchangeable, but I’m not sure why you say it’s fucking people over.
Because the people who learn “DM” or “MD” then spend hours online arguing that you must do one before the other.
Did you mean MD and DM?
People do be arguing, lol
It should be limited - like Orders - to only Multiplication and Addition
Because you don’t want people to know when to do Division and Subtraction? 😂
Because division is the same operation as multiplication
No it isn’t, but they are both binary operators.
they have the same “weight” in the order of operations (meaning, you do them left-to-right)
And where are they going to do Division and Subtraction in the left to right if you’ve left them out? 🙄
Because you don’t want people to know when to do Division and Subtraction? 😂
Because division is multiplication, and subtraction is addition.
No it isn’t, but they are both binary operators.
2/2is the same as2*½2-2is the same as2+(-2)And where are they going to do Division and Subtraction in the left to right if you’ve left them out? 🙄
Well, as I already said multiple times: Division = Multiplication and Subtraction = Addition, therefore they would be doing them together, left to right. As in:
9-3+2would not confuse anyone who learned “Addition → Subtraction”, as it does right now.Because division is multiplication
No it isn’t.
and subtraction is addition
And you still have to do both
2/2 is the same as 2*½
They’re equal in value, they’re not the same
2-2 is the same as 2+(-2)
You got that the wrong way around. Brackets have only been used in Maths for a few centuries now
Well, as I already said multiple times: Division = Multiplication
And you were wrong every time you said it.
therefore they would be doing them together
Not if you left them out of the mnemonic and they didn’t know when to do them
I learned BODMAS too! It seems BIDMAS is another one (British I think), PEMDAS is the weird American one, BEDMAS is a thing too. You’re able to vary the first letter (parenthesis or brackets), second letter (indices/exponent/“order” or “operation”), and the order of multiplication/division (MS or SM) and addition/SUBTRACTION (AD or DA)
Very interesting indeed.
We need a super position of all of them.
Where are pemdas and bodmas users from?
Pemdas, USA. Bodmas, UK.
BEDMAS, Canada
I think most former British colonies use BODMAS
But the USA seems to use PEMDAS? I’m confused now…
They mean Commonwealth countries more precisely
Yeah, my bad
It talks about it here:
I never ran into PEMDAS while growing up, in Sweden I’ve always been taught of it as the following order of operations:
- P
- E & Roots
- M & D
- A & S
Technically roots are a form of exponent, just fractional (square root is power of 1/2, for instance). I can see how it could be easier to conceptualize when you break it down like that though. Neat to see the differences compared to the US breakdown :)
Technically we go for 2. Powers & Roots, I just didn’t want to break the PEMDAS when comparing. :)
That’s PEMDAS…
They aren’t using the same words so the shorthand (if they have one) is different. I don’t think we had a shorthand for it either, we just learned it.
And we learned them in groups numbered like the Swedes
Okay then, but, fun story, the BODMAS they’re talking about is also just PEMDAS using different words and a different listed order for multiplication/division, with the understanding that it’s more properly PE(MD)(AS)
The order of operations is the important bit and everyone learns it that way. What causes the arguments is when dummies online forget that M+D or A+S can theoretically be done properly in any order and that part is a matter of preference.
The disadvantage of a shorthand compared to just a numbered list might be that people think it’s strictly one after the another instead of groups

e: Wanted to see if this is a thing in English.

Please Excuse My Dear Aunt Sally… bitches.
Let’s not do engagement bait here 😭
Precedences are just made up social constructs, don’t let the system restrict you, you can evaluate this expression however you want. Go wild.
(* (+ 2 5) (- 8 5))Hope some LISP can clear this up
Edit:
( + 2 ( * 5 ( - 8 5 ) ) )I’m not seeing a single mention of My Dear Aunt Sally. The youth are lost…
Aunt Sally said some racist things at Thanksgiving, I’m tired of excusing her smh
Already saying racist things this early in the morning? (It’s Thanksgiving in the US today)
You’re drunk Sally, go to bedmas!
I’ll never understand these approaches to learning. They require remembering the phrase, and then require remembering how the phrase translates to the rules you need to remember.
I’ll just remember the rules in the first place. Less effort.
There’s just no way rote learning is easier than mnemonics unless you have a photographic memory.
Shit, I still remember the order of taxonomic ranks after seeing the phrase “King Phillip came over from Germany stoned” written in a used bio textbook 30 years ago when we never even made it to that chapter to officially study in class. I guarantee I never would’ve remembered the list “kingdom phylum class order family genus species”.
Don’t ask anyone over the age of 45 how they remember resistor color codes …
I’m going with this one: Batman blows Robin on yon Gotham bridge; Vows Gordon’s next.
But wiki has a list:
https://en.wikipedia.org/wiki/List_of_electronic_color_code_mnemonics#Offensive/outdated
Looks like it’s mostly in ROY G BIV order, although you’ve got black and brown up front, then they drop indigo and add gray and white at the end.
Warning: my music nerd’s about to come out.
I’m in my 40s, and have been playing music since single digits. I still remember the order of lines in the staffs with “Every Good Boy Deserves Fudge”, “FACE”, “Good Boys Deserve Fudge Always”, and “All Cows Eat Grass”. I did teach my kids “Good Burritos Don’t Fall Apart”, though, since they seem to like burritos.
My internal math nerd agrees with the grandparent though, for some reason I just remembered the order of operations and was confused when my kids came home with PEDMAS. But to be fair, I use the order of operations every day at work, so 🤷. I’m also one of those people who will insist on using parentheses everywhere there’s more than two terms, though, so take from that what you will.
Yeah, but there is more to remember. I remember BODMAS and if I forget the rules, I work it out and apply it.
Hrmm.
I read that as resulting in 21.
My education system did fail me.
I plugged that into ghci as 2+5*(8-5), and it says 17.
:(
I did (2+5)*(8-5).
Doh.
[Edit: (Double doh! Mistyped that here as 5+2. XD)]
You do parenthesis first and then multiplications and then sums, you did parenthesis, then sums, then multiplications, wich is wrong.
You don’t necessarily have to do parentheses first. What matters is that the things inside the parentheses are a group that you can’t break apart. If you have
10÷2+3-2*(2+1)you can do the division first5+3-2*(2+1)then the addition outside the parentheses8-2*(2+1)It’s just that before you do the multiplication of the term outside the parentheses, you have to handle the parentheses group, so you get8-2*3->8-6->2
plugged that into ghci as 5+2*(8-5), and it says 17.
You might want to report that error. Or, did you mean 2+5*(8-5)?
Oops! Typo. School failed me hard!
[Edit: Thanks. Corrected that.]
How far along in school are you btw?
over 20 years past giving up on school [in 2nd year of college], when they kept failing me.
Aha.
I did (2+5)*(8-5).
The problem is you can’t just add parenthesis willy nilly, that breaks the whole equation!
Well, it used to be a free country until common core and now this nonsense is the result. Numbers and punctuation mixed together. Pure chaos.
My education system didn’t fail me, I failed it.































