Pages: [1] 2
|
 |
|
Author
|
Topic: 48÷2(9+3) (Read 8653 times)
|
|
|
Merusk
Terracotta Army
Posts: 27449
Badge Whore
|
Yeah, two.
|
The past cannot be changed. The future is yet within your power.
|
|
|
Ingmar
Terracotta Army
Posts: 19280
Auto Assault Affectionado
|
Either that or 288. I want to say due to order of operations you end up doing 48 divided by 2 multipled by 12. It has been like 25 years since I had to care about that sort of thing, though.
|
The Transcendent One: AH... THE ROGUE CONSTRUCT. Nordom: Sense of closure: imminent.
|
|
|
Druzil
Terracotta Army
Posts: 550
|
288
|
|
|
|
Merusk
Terracotta Army
Posts: 27449
Badge Whore
|
Excel says 288. I always forget to go left to right and multiply x() setups before they should be. It's wrong but it just makes sense to me since there's no visual * sign there. I never remember until someone points it out.. then I forget again a few days later. My fail.
|
The past cannot be changed. The future is yet within your power.
|
|
|
Trippy
Administrator
Posts: 23657
|
|
|
|
|
MuffinMan
Terracotta Army
Posts: 1789
|
Cheeseburger.
|
I'm very mysterious when I'm inside you.
|
|
|
Merusk
Terracotta Army
Posts: 27449
Badge Whore
|
Ok Barth. What's in that Cheeseburger, anyway?
|
The past cannot be changed. The future is yet within your power.
|
|
|
Morat20
Terracotta Army
Posts: 18529
|
It's 48 / 2 * 12 -- since multiplication and division are the same order you parse left to right, so it's 24 * 12. The tricky bit is, I suppose, realizing 2(9+13) is really 2* (9+3).
It's a badly written problem designed to fool people, though. (48/2) * (9+3) is more readable.
|
|
|
|
MahrinSkel
Terracotta Army
Posts: 10859
When she crossed over, she was just a ship. But when she came back... she was bullshit!
|
Which is why I trained myself to use extra parenthesis in my code so that there was no doubt at all about order, so that I didn't get weird parsing order bugs in my math.
--Dave
|
--Signature Unclear
|
|
|
|
Teleku
Terracotta Army
Posts: 10516
https://i.imgur.com/mcj5kz7.png
|
Arg, yeah. Please Excuse My Dear Aunt Sally being drilled into my brain as a youth always makes me forgot that Multiplication and Division are equal, and so you go left to right in those cases. I thought it was 2 as well.
|
"My great-grandfather did not travel across four thousand miles of the Atlantic Ocean to see this nation overrun by immigrants. He did it because he killed a man back in Ireland. That's the rumor." -Stephen Colbert
|
|
|
Morat20
Terracotta Army
Posts: 18529
|
Which is why I trained myself to use extra parenthesis in my code so that there was no doubt at all about order, so that I didn't get weird parsing order bugs in my math.
--Dave
lol. Me too. You should see my boolean expressions. Lots of white space and () so I can CLEARLY see what the fuck I'm doing. I hate guys with the mashed together shit, math or boolean, that depends on order and not readability.
|
|
|
|
ghost
|
You should do the stuff in parenthesis first, then take care of the rest. So two would be correct using non-Excel math.
|
|
|
|
Ingmar
Terracotta Army
Posts: 19280
Auto Assault Affectionado
|
You should do the stuff in parenthesis first, then take care of the rest. So two would be correct using non-Excel math.
No it wouldn't. The 2 is outside the parentheses. Once you do the stuff inside the parentheses, which you correctly say goes first, you are left with 48/2*12, and you do that from left to right. EDIT: To end up with 2, you'd need it to look like this: 48 / (2(9+3)) or something similar. Also... why are we even HAVING this conversation? [fry.gif aimed at samprimary]
|
|
« Last Edit: April 08, 2011, 06:50:29 PM by Ingmar »
|
|
The Transcendent One: AH... THE ROGUE CONSTRUCT. Nordom: Sense of closure: imminent.
|
|
|
Sjofn
Terracotta Army
Posts: 8286
Truckasaurus Hands
|
He wanted to give people the opportunity to do some algebra. What other reason is needed?
|
God Save the Horn Players
|
|
|
MuffinMan
Terracotta Army
Posts: 1789
|
I've been patiently waiting all day for the next one but it better not be a goddamn story problem.
|
I'm very mysterious when I'm inside you.
|
|
|
Fordel
Terracotta Army
Posts: 8306
|
Arg, yeah. Please Excuse My Dear Aunt Sally being drilled into my brain as a youth always makes me forgot that Multiplication and Division are equal, and so you go left to right in those cases. I thought it was 2 as well.
I was Taught using "BODMAS": Brackets and Exponents, Order of Appearance, Division, Multiplication, Addition, Subtraction. I don't think it has a clever saying to go with it.
|
and the gate is like I TOO AM CAPABLE OF SPEECH
|
|
|
Morat20
Terracotta Army
Posts: 18529
|
He wanted to give people the opportunity to do some algebra. What other reason is needed?
That's not algebra. It's order of operations, something they teach in elementary school. As I said, it's written trickily because the multiplicative operator isn't obvious, and honestly I feel it's bad practice not to use () when doing that sort of thing anyways. Then again, I'm used to doing those problems as a / (b * (c+d)).
|
|
|
|
Jeff Kelly
Terracotta Army
Posts: 6921
I'm an apathetic, hedonistic, utilitarian, nihilistic existentialist.
|
Ambiguities like that are the reason that fractions are never notated like that in the real world anyway.
|
|
|
|
Strazos
Greetings from the Slave Coast
Posts: 15542
The World's Worst Game: Curry or Covid
|
PEMDAS, bitches. 
|
Fear the Backstab! "Plato said the virtuous man is at all times ready for a grammar snake attack." - we are lesion "Hell is other people." -Sartre
|
|
|
Morat20
Terracotta Army
Posts: 18529
|
PEMDAS, bitches.  My father -- and this had to be back when I was 16 or 17 -- had to learn a lot of math very quickly. Company offered him a huge promotion, and while he'd had a solid grounding in math (up to trig, IIRC) he hadn't had to use much of it. What he did use (mostly trig, strangely) was mostly done through tables. Anyways, he was moving from foreman -- oil refineries, he was in charge of a few major, multi-million dollar projects and got a good rep -- to basically some sort of complex safety thing. Pressurized vessel inspector or god knows what. It required him to do a lot of math for the calculations (he had to be able to do them, although even back then they had computers to run them) and part of the program that got him up to speed before he went through a year+ cert process involved a bunch of remedial math -- dusting off all that trig and algebra he hadn't had to use in forever. So I recall him sitting at the table, running through some equations, and bitterly complaining that he kept running the numbers and they were wrong. He finally waves me and my brother over -- I was in Calculus and my brother was in Algebra II, I think -- to ask us. We look at his work, and the problem jumps out -- order of operations issue. I don't recall the specifics, but I remember it taking me a few moments to reason out the correct order so it wasn't easy. (I think he'd screwed up an exponent somewhere). My brother agrees, so we tell him "You're doing it in the wrong order. This first, then this, then this" and he asks "Why? How do you know?" so we explain the whole order of operations and finish with "And you can remember it with the mnemonic 'Please Excuse My Dear Aunt Sally'". He responds "GODDAMN FUCKING BOB!". Turns out he'd asked an engineer at work, who looked at it and just said "Please Excuse My Dear Aunt Sally" and then walked off. He'd been banging his head on a handful of problems all day, off and on, when he'd been given the answer around nine that morning by a guy who hadn't bothered to follow up.
|
|
|
|
MahrinSkel
Terracotta Army
Posts: 10859
When she crossed over, she was just a ship. But when she came back... she was bullshit!
|
Which is why I trained myself to use extra parenthesis in my code so that there was no doubt at all about order, so that I didn't get weird parsing order bugs in my math.
--Dave
lol. Me too. You should see my boolean expressions. Lots of white space and () so I can CLEARLY see what the fuck I'm doing. I hate guys with the mashed together shit, math or boolean, that depends on order and not readability. Yeah, and then some pedantic twit bitches about the redundancy and you have to prove that the compiler strips it all out, anyway. Like we're still counting bytes or clock cycles, you silly twits. --Dave
|
--Signature Unclear
|
|
|
Sjofn
Terracotta Army
Posts: 8286
Truckasaurus Hands
|
It's totally algebra! Order of operations is algebra! You might not have ALGEBRA 1 on the cover of your textbook when you learn it, but it's still algebra. :P
|
God Save the Horn Players
|
|
|
Chimpy
Terracotta Army
Posts: 10633
|
Son of a...I had totally forgotten about the whole left to right thing and how it matters when you have division and multiplication mixed. I kept thinking "division is just a form of multiplication, the answer will be the same" like addition/subtraction.
Now I think I know where I missed that one question on the civil service exam I took last week must have been.
|
'Reality' is the only word in the language that should always be used in quotes.
|
|
|
Nerf
Terracotta Army
Posts: 2421
The Presence of Your Vehicle Has Been Documented
|
|
|
|
|
|
apocrypha
Terracotta Army
Posts: 6711
Planes? Shit, I'm terrified to get in my car now!
|
Meh, I just think it's written wrong.
It should be (48÷2)(9+3) or 48÷(2(9+3)).
|
"Bourgeois society stands at the crossroads, either transition to socialism or regression into barbarism" - Rosa Luxemburg, 1915.
|
|
|
ghost
|
Meh, I just think it's written wrong.
It should be (48÷2)(9+3) or 48÷(2(9+3)).
Yeah. This is probably the right answer.
|
|
|
|
proudft
Terracotta Army
Posts: 1228
|
Which is why I trained myself to use extra parenthesis in my code so that there was no doubt at all about order, so that I didn't get weird parsing order bugs in my math.
--Dave
lol. Me too. You should see my boolean expressions. Lots of white space and () so I can CLEARLY see what the fuck I'm doing. I hate guys with the mashed together shit, math or boolean, that depends on order and not readability. Yeah, and then some pedantic twit bitches about the redundancy and you have to prove that the compiler strips it all out, anyway. Like we're still counting bytes or clock cycles, you silly twits. --Dave The worst is when they do that crap as a job interview question. My answer to "how does 1>>3*2+7*2<<4^2++ evaluate" was always a heavy sigh and, 'I have no idea. Use parentheses', but that never went over real well. I really became a parenthesis whore after some hours of headscratching over a bitshift that, somehow, had precedence over a comparison. Or the other way around. It was something completely bizarre and it's been so long and I have converted to the One True Path of Parentheses for long enough that I'm not 100% sure anymore what it was, but, you know what, I don't have to care about it anymore with the magic of parentheses. Imagine that!
|
|
« Last Edit: April 09, 2011, 11:19:29 AM by proudft »
|
|
|
|
|
Samwise
Moderator
Posts: 19324
sentient yeast infection
|
The worst is when they do that crap as a job interview question. My answer to "how does 1>>3*2+7*2<<4^2++ evaluate" was always a heavy sigh and, 'I have no idea. Use parentheses', but that never went over real well.
The more complete answer would be "find out from the SCM system who wrote that line of code, then hit them with your keyboard until they fix it." I really became a parenthesis whore after some hours of headscratching over a bitshift that, somehow, had precedence over a comparison. Or the other way around. I think the rule for relative precedence of bitwise and boolean operators is that it's whatever is least useful and most likely to cause bugs.
|
|
|
|
Morat20
Terracotta Army
Posts: 18529
|
I never use bitshifts. EVER. I dread getting asked questions about them because, well, I used them on a school assignment a few times and they've never come up in my professional life. Ever.
Well, maybe back in 2001. I *think* they might have come up then. Once. I frankly can barely recall what they do, much less evaulate them.
|
|
|
|
Samwise
Moderator
Posts: 19324
sentient yeast infection
|
You use bitwise operators a lot if you're writing code that needs to pack maximum information into minimum space -- e.g. if you have an object with ten different members that really only account for about twenty bits of information between them, and you're going to have a billion different instances of that object stashed away somewhere, you can save a lot of memory by cramming those ten things into a single 32-bit int rather than allocating a full int or even char for each one.
|
|
|
|
Morat20
Terracotta Army
Posts: 18529
|
I know what they're used for. I've just, with one exception, never had code running to the specs where it was necessary. I've had a few coders use it on projects, mostly to show off -- the fucking assholes. It just made their code a hell of a lot more unreadable for a non-existant performance gain. (The system wasn't stressed without them. Any improvement from using them was utterly lost in the noise).
The one exception was my first job out of college, and I was doing an interface end (some auto-generating code stuff. Fun, but didn't have the size and timing constraints the rest of it did) and some automated testing tools. The bitwise stuff came up in code reviews (only job I ever had those too), but only in a handful of people's stuff. THere was some low-down, ultra-fast, big shit where size and algorithmic complexity issues dominated and swapped back and forth.
Half the test tools I designed were built to test their code under projected conditions to see what needed to be optimized, either for memory size or speed.
|
|
|
|
|
Pages: [1] 2
|
|
|
 |