SmartmanApps
@SmartmanApps@programming.dev
- Comment on a very emphatic answer 4 weeks ago:
The rules and the acronyms describe different things.
No, they don’t.
If you have to make more rules to say M and D are the same,
I didn’t make more rules - that’s the existing rules. Here’s one of many graphics on the topic which are easy to find on the internet…
…that’s one of the two examples you used?
Yes. Did you try looking for one and ramping it up to the most difficult level? I’m guessing not.
IT IS AMBIGUOUS IN THIS POST
No, it isn’t. Division before subtraction, always.
ALL EXAMPLES I HAVE SHOWN
None of those have been ambiguous either, as I have pointed out.
That is the problem at hand.
The problem is people not obeying the rules of Maths.
There is no real problem solving in trying to decipher poorly written shit
It’s not poorly written. It’s written the exact way you’d find it in any Maths textbook.
- Comment on a very emphatic answer 4 weeks ago:
You are adding more rules
I’m stating the existing rules.
If all that matters is higher orders first
I don’t even know what you mean by that. We have the acronyms as a reminder of the rules, as I already said.
I know operators apply to the numbers to their right.
If you know that then how did you get 2-2+2=-2?
With 2/22, you don’t know if it is 22/2, or 2/(2*2)
Yes you do - left associativity. i.e. there’s no brackets.
When you are dividing by numbers, you put them all in the denominator
Only the first term following a division goes in the denominator - left associativity.
BY CONVENTION, as I said. You don’t have to repeat what I said a second time.
I didn’t. You said it was a convention, and I corrected you that it’s a rule.
It’s not like you could have tried in your head different orders to combine 3 numbers.
addition first
2-2+2=4-2=2
subtraction first
2-2+2=-2+2+2=-2+4=2
left to right
2-2+2=0+2=2
3 different orders, all the same answer
- Comment on a very emphatic answer 4 weeks ago:
Who’s on first? :-)
- Comment on a very emphatic answer 4 weeks ago:
Multiplication comes before division in some forms, like PEMDAS. In the example I use, this changes the answer
If you have both multiplication and division then you do them left to right. PEMDAS doesn’t mean multiplication first, nor does BEDMAS mean division first. It’s PE(MD)(AS) and BE(DM)(AS) where the bracketed parts are done left to right.
you should specify what it is operating on
Left associativity means it always operates on the following term. i.e. terms are associated with the sign on their left.
The minus sign only applies to the middle term, by convention
By the rule of left associativity.
But if you use one of these acronyms, you end with this expression evaluating to -2
No it doesn’t. How on Earth did you manage to get -2?
all these acronyms end up being useless waste of time
No they’re not, but I don’t know yet where you’re going wrong with them without seeing your working out.
- Comment on a very emphatic answer 4 weeks ago:
Even your “BODMAS” isn’t universal, lots of people learn “PEMDAS” or “BEDMAS”
The rules are universal, only the mnemonics used to remember the rules are different
except for facebook and twitter
… and high school Maths textbooks, and order of operations worksheet generators, and…
2/2*2 It is 0.5 or 2 depending on order.
It’s always 2. #MathsIsNeverAmbiguous
- Comment on a very emphatic answer 4 weeks ago:
No, it isn’t. Division before subtraction.
- Comment on a very emphatic answer 4 weeks ago:
1/2x is also unambiguous. 2a=(2xa) by definition. Has done for at least 180 years. Terms
- Comment on a very emphatic answer 4 weeks ago:
Nothing wrong with the way it’s written - division before subtraction.
- Comment on Daily discussion thread: 🥔💎 Sunday, May 19, 2024 5 weeks ago:
Just make sure you don’t use an e-calculator, nor a Texas Instruments calculator.
- Comment on Daily discussion thread: 🥔💎 Sunday, May 19, 2024 5 weeks ago:
Within those three groups it doesn’t really matter which ones you do first
It absolutely does matter. You must do exponents after brackets and before multiplication and division, for the precise reason you said that exponents are shorthand for multiplication. In other words, there’s 4 groups, not three.
- Comment on Daily discussion thread: 🥔💎 Sunday, May 19, 2024 5 weeks ago:
They’re all correct, since the mnemonics are just ways to remember the actual rules
- Comment on ))<>(( 2 months ago:
The syntax is arbitrary in some edge cases
Such as?
- Comment on ))<>(( 2 months ago:
I’m taking about physical, non-graphic scientific calculators from the 1990s.
Yep, exact same as the calculator in the linked thread. The expression entered was 6/2(1+2).
- Comment on ))<>(( 2 months ago:
- Comment on ))<>(( 2 months ago:
Order of magnitude?
It’s actually short for “to the order of”, as in 2 squared is 2 to the order of 2. i.e. same thing as Exponent or Index.
- Comment on ))<>(( 2 months ago:
order?
It’s actually short for “to the order of”, as in 2 squared is 2 to the order of 2. i.e. same thing as Exponent or Index.
- Comment on ))<>(( 2 months ago:
AFAIK, this is correct to the point that I have understanding of. I’m not a mathematician
I’m a Maths teacher/tutor. The actual rules are Terms and The Distributive Law. There is no such thing as “implicit multiplication” (which is usually people lumping the 2 separate rules together as one and ending up with wrong answers).
- Comment on ))<>(( 2 months ago:
My calculator says -2² = -4
That’s correct
- Comment on ))<>(( 2 months ago:
It is also frustrating when different calculators have different orders of operations and dont tell you.
Yeah, but to be fair most of them do tell you the order of operations they use, they just bury it in a million lines of text about it. If they could all just check with some Maths teachers/textbooks first then it wouldn’t be necessary. Instead we’re left trying to work out which ones are right and which ones aren’t. Any calculator that gives you an option to switch on/off “implicit multiplication”, then just run as fast as you can the other way! :-)
- Comment on ))<>(( 2 months ago:
Unfortunately some calculators, such as Google’s will ignore your brackets and put in their own anyway. You just gotta find a decent calculator in the first place.
- Comment on ))<>(( 2 months ago:
Either ‐(n²) or (-n)². Order of operations shouldn’t be some sort of gotcha to trick people into misinterpreting you
It isn’t. With ‐(n²), n² is already a single term, so the brackets aren’t needed.
- Comment on ))<>(( 2 months ago:
I think it was something like : -2 is a diminutive for -1x2
Correct. Things that are usually left out of Maths expressions are plus signs, ones as multipliers/indices, and un-needed brackets. e.g. I could more fully write this as -1(4)², but that just simplifies to -4²
- Comment on ))<>(( 2 months ago:
it’s just a squaring a number
The number being squared is 4, unless you put (-4)², otherwise it’s 4² with a minus sign.
- Comment on ))<>(( 2 months ago:
I think I learned powers take priority over the “-”
Yes, Exponents is the 2nd-highest precedence (after Brackets) - BEDMAS.
- Comment on ))<>(( 2 months ago:
A typical scientific calculator didn’t have juxtaposition, so you’d have to enter 6÷2(1+2) as 6÷2×(1+2)
That’s not true
you’d get 9 as the answer because ÷ and × have equal precedence and just go left to right
Well, more precisely you broke up the single term 2(1+2) into 2 terms - 2 and (1+2) - when you inserted the multiplication symbol, which sends the (1+2) from being in the denominator to being in the numerator. Terms are separated by operators and joined by grouping symbols.
- Comment on ))<>(( 2 months ago:
There’s no pemdas paradox, just people who have forgotten the order of operations rules
Even two casios won’t give you the same answer:
The one on the right is an old model. As far as I’m aware Casio no longer make any models that still give the wrong answer.
- Comment on ))<>(( 2 months ago:
I’ve never seen a calculator that had bracket keys but didn’t implement the conventional order of operations.
I’ve seen plenty
- Comment on ))<>(( 2 months ago:
This is why every calculator should be a RPN calculator
No, this is why programmers should (re)learn the order of operations rules before writing a calculator.
- Comment on ))<>(( 2 months ago:
I just used the calc on window… it cannot respect order of operation
Yeah, I’ve tried several times to get Microsoft to fix their calculators. I’ve given up trying now - eventually you have to stop banging your head against the wall.
- Comment on ))<>(( 2 months ago:
Math should be just as deterministic as programming, but it’s not in some situations
Maths is 100% deterministic for order of operations. The issue is people not following all of the rules. Order of operations thread index