This is topic 48÷2(9+3) in forum Books, Films, Food and Culture at Hatrack River Forum.


To visit this topic, use this URL:
http://www.hatrack.com/ubb/main/ultimatebb.php?ubb=get_topic;f=2;t=058122

Posted by Samprimary (Member # 8561) on :
 
what's the answer
 
Posted by Misha McBride (Member # 6578) on :
 
288
 
Posted by Xavier (Member # 405) on :
 
I haven't seen ÷ in a math problem since elementary school, but my answer seems to match Misha's.
 
Posted by King of Men (Member # 6684) on :
 
Two your own homework.
 
Posted by PSI Teleport (Member # 5545) on :
 
2.
 
Posted by PSI Teleport (Member # 5545) on :
 
You know, I'm not positive whether the 2 multiplied by the contents of the parentheses takes precedence over the division problem that comes before it.

edit: I also totally missed KoM's "Two."
 
Posted by scholarette (Member # 11540) on :
 
PEMDAS! But remember M and D are tied as are A and S so do them in order from left to right (tied cause you can make a D an M and a S an A)
 
Posted by Magson (Member # 2300) on :
 
2
 
Posted by kmbboots (Member # 8576) on :
 
I thought 2 as well but I don't do math.
 
Posted by scholarette (Member # 11540) on :
 
2 is wrong. Unless it was written as a fraction originally and everything after the division sign was written in the denominator. If that was true though, an error was made in typing it out.
 
Posted by Xavier (Member # 405) on :
 
48÷2(9+3)

First is parentheses, so:

48÷2(12)

Now the ambiguity is whether this is:

48 / (2*12) or 48 / 2 * 12

If it was the first, then it would be 2. If it was the second, it'd be 288.

I'm not familiar enough with the ÷ operator to say which, but the second makes more sense to me, in which case it'd be left to right like scholarette says. Is there some property of ÷ which takes the entire right hand side as the divisor?
 
Posted by Samprimary (Member # 8561) on :
 
quote:
Originally posted by King of Men:
Two your own homework.

two you say
 
Posted by Lisa (Member # 8384) on :
 
Order of operations says that if the equation read 48÷2×12, you'd just go from left to right, which would give you 288. The question is whether 2(12) is identical to 2×12. Is that just a convenient alternative representation, or does it have a different significance that might advance it in the order of operations. Personally, I think it's identical to 2×12.
 
Posted by PSI Teleport (Member # 5545) on :
 
I don't believe that it is.

[I have no evidence to back this up, however, I think of 2(12) as one term and treat it individually.]
 
Posted by Xavier (Member # 405) on :
 
I've never seen it not be identical. Its just a short-hand notation.
 
Posted by scholarette (Member # 11540) on :
 
When you divide, you could instead multiply by the reciprocal if if make you happy. So 48/2 is the same as 48*1/2 or 48*0.5 to eliminate all signs of division. So if you were to convert 48/2*12 to all multiplication it would be 48*.5*12.
 
Posted by MattP (Member # 10495) on :
 
I would treat 2(12) as identical to 2×12.
 
Posted by fugu13 (Member # 2859) on :
 
Juxtaposition means multiplication, yes.
 
Posted by Glenn Arnold (Member # 3192) on :
 
I see the ambiguity, but I see 2 as a coefficient of 12. The problem here isn't really order of operations, it is that the problem is one of pure arithmetic for arithmetic's sake.

So I have to ask: Is this question designed to demonstrate a flaw in the order of operations rules, or is there a real problem to be solved?
 
Posted by PSI Teleport (Member # 5545) on :
 
Step outside of "math" for a second and look at this realistically. If 12 is the number of eggs in a carton, and you want to know what 48 would be if you divided it by two cartons of eggs, you would write it:

48 divided by 2(12) = 2

Or, to put it a clearer way, if B = the number of eggs in a carton, you would use

48 / 2(b) or 48 / 2b

Does 48/2 take precedence is this instance? I find that hard to believe.
 
Posted by Xavier (Member # 405) on :
 
Its a pretty banal order of operations question. Stepping outside of formal "order of operations" conventions to answer it seems like a square peg in a round hole.
 
Posted by scholarette (Member # 11540) on :
 
There is no ambiguity. 2 is wrong. 288 is right.
 
Posted by PSI Teleport (Member # 5545) on :
 
Except that math exists for a reason, Xavier.
 
Posted by MattP (Member # 10495) on :
 
Wolfram Alpha and Google both agree: 288
 
Posted by MattP (Member # 10495) on :
 
quote:
Originally posted by PSI Teleport:
Except that math exists for a reason, Xavier.

It also has rigorous rules. You can't look at an expression and intuit exceptions to those rules.
 
Posted by Xavier (Member # 405) on :
 
quote:
48 / 2b

Does 48/2 take precedence is this instance? I find that hard to believe.

Yes, it absolutely does.

48 / 2(12) = 48 / 2 * 12 = 288

You can't just choose to ignore math conventions when it suits you. Or at least you can't if you want to actually pass a math class.

Just write it as 48 / (2 * 12) if you want to represent the english egg problem you have above in math notation.
 
Posted by PSI Teleport (Member # 5545) on :
 
I'm not "intuiting exceptions." I'm trying to show that there's a reason why so many mathematicians argue that juxtaposition takes precedence.
 
Posted by scifibum (Member # 7625) on :
 
PEMAL would be more useful than PEMDAS, IMO.

M = {M,D}
and
A = {A,S}

L = Left-to-right

Or, if we must, PEMDASL
 
Posted by Xavier (Member # 405) on :
 
By the way, this is apparently a meme now:

http://www.youtube.com/watch?v=wv19iAncrrQ&feature=player_embedded#at=47

Added:

Which seems dumb to me that this is even a controversy. You can argue that it shouldn't be 288, but I don't see how you can argue that it actually isn't 288 by current mathematical conventions.

If you want to change it, I won't argue, but it's clearly the current standard.

Sources that give 288:

Google
WolphramAlpha
Matlab
Python
My TI-89 calculator

I haven't seen anything that gives 2 besides random people on the internet.
 
Posted by rivka (Member # 4859) on :
 
quote:
Originally posted by Xavier:
By the way, this is apparently a meme now

I knew THAT as soon as I saw who had posted the thread.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
Bah. Whether in math or programming, if your expression is dependent on remembering whether operations are handled from left to right or right to left, it should probably be re-written to be clearer.

unambiguous != clear
 
Posted by PSI Teleport (Member # 5545) on :
 
Yeah, I think that video sums up my feelings pretty well. Namely that one answer is probably correct, but the fact that so many intelligent people have had such long, involved arguments about it makes me think that the silliest position one can take is "There's only one possibility, stupid."

Which, by the way, is not the position I'm taking. I lean toward 2, but I'm not arrogant enough to say that that's definitely, absolutely right.
 
Posted by Xavier (Member # 405) on :
 
Teach the controversy!
 
Posted by PSI Teleport (Member # 5545) on :
 
That doesn't mean that everyone agrees on what that is.

[Oh, now you're just trying to make me look crazy. [Smile] ]
 
Posted by Xavier (Member # 405) on :
 
I put it in an edit, so maybe you didn't see it:

Sources that say 288:

Where is the controversy exactly?

Edit: Yeah, sorry, I am edit crazy today.
 
Posted by PSI Teleport (Member # 5545) on :
 
quote:
Originally posted by Xavier:
quote:
48 / 2b

Does 48/2 take precedence is this instance? I find that hard to believe.

Yes, it absolutely does.

48 / 2(12) = 48 / 2 * 12 = 288

You can't just choose to ignore math conventions when it suits you. Or at least you can't if you want to actually pass a math class.

Just write it as 48 / (2 * 12) if you want to represent the english egg problem you have above in math notation.

Just to be clear, you're taking the position that 48 / 2b is the same as 24b?

BTW, I'm not ignoring the calculator references you've given. Everything I've read on this issue so far says that different software computes this problem differently. I'm interested in which software gives the answer as "2." Not that you know. I'm just musing.
 
Posted by rivka (Member # 4859) on :
 
quote:
Originally posted by mr_porteiro_head:
Whether in math or programming, if your expression is dependent on remembering whether operations are handled from left to right or right to left, it should probably be re-written to be clearer.

unambiguous != clear

Agreed.
 
Posted by Xavier (Member # 405) on :
 
quote:
BTW, I'm not ignoring the calculator references you've given. Everything I've read on this issue so far says that different software computes this problem differently. I'm interested in which software gives the answer as "2." Not that you know. I'm just musing.
I'm interested in that as well, since so far I haven't heard of any software that says anything other than 288. If such exists (and is in wide use), then I will admit that a controversy exists and back away slowly [Wink] .

As something to get flustered over on the internet, its somewhat more fun than politics (as that depresses me more often than not) but still not something that will hold my interest for long.

For the record, I agree with Porter. When I am writing software, I always use parentheses when my order of operations isn't 100% clear at a casual glance.
 
Posted by King of Men (Member # 6684) on :
 
Yeah, ok, 288. But whoever wrote the expression that way should be shot for lack of clarity.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
quote:
Everything I've read on this issue so far says that different software computes this problem differently.
It is language-dependent.

C/C++, for example, explicitly specify that the order of operations is from left to right. Python (which is written in C) does the same.

I cannot name any popular programming languages that go from right to left, but I know that obscure ones exist.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
Just to be annoying to myself, here's an example of code that I would write and which is dependent on the order of operations:

code:
if(pointer && pointer->IsHappy())
{
.....
}


 
Posted by PSI Teleport (Member # 5545) on :
 
I wasn't referring to a language that performs the operations from right to left, but rather one that simplifies by applying the distributive property first.

If 2(a + b) = 2a + 2b, then it stands to reason that 2(9 + 3) should equal 2(9) + 2(3), or 24.

But, yes, in the end it seems like the problem was written in order to get one answer, but done so poorly that it got another.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
I can't imagine why a programming languages would by default take 2*(3+4) and solve it by first converting it to 2*3+2*4 instead of 2*7. It's more work for the computer, more work for the person writing the language, and it ends up giving you the same answer.

[ April 08, 2011, 08:34 PM: Message edited by: mr_porteiro_head ]
 
Posted by Glenn Arnold (Member # 3192) on :
 
quote:
You can't just choose to ignore math conventions when it suits you.
Really? What's "i" then?

How about Tau vs. Pi?

Or assuming that parallel lines will cross eventually?

If following mathematical conventions is just a lock step habit, then we might as well just accept that pi is 3.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
What? I really don't understand your post, Glenn.
 
Posted by xtownaga (Member # 7187) on :
 
quote:
Originally posted by mr_porteiro_head:
[QUOTE]
C/C++, for example, explicitly specify that the order of operations is from left to right. Python (which is written in C) does the same.

Well, for operations with the same precedence level this is true (which multiplication and division are, of course, so for this case yes I'll grant that this objection is something of a side note). The precedence levels are set up such that multiplication and division are equal, with addition and subtraction equal to each other but lower precedence (just like these operations are handled in math done outside a computer).

Wikipedia tells me that APL and Smalltalk have no precedence levels, and that operators in these languages are evaluated strictly right to left and left to right, respectively.

I would love to move to a postfix (or, I suppose, prefix) system for writing math to get rid of the need for an explicit order of operations, but I really never see it happening.

ETA: I don't mean to imply that you didn't know about precedence levels and whatnot, just including this as a note to people who aren't familiar with programming languages.


Edited also to add in responce to Glenn:

Except this is completely different than the topic at hand. We can prove that pi =/= 3. Proving that something previously thought to be correct is not correct will cause mathematical conventions to change, but that's not ignoring something "when it suits you", it's ignoring something because it's wrong. You can't prove that the arbitrary ordering of operations generally agreed upon is somehow incorrect, it's really no more correct or incorrect than any other ordering would be.

It is, however, standardized. Sure you can reject the standard, but that would be pretty similar to saying 288 is not the correct value of the expression in the subject because you're choosing to disregard the fact that + commonly means addition and instead think it should mean subtraction. Sure there's no provable reason that '+' is a better symbol for addition than subtraction, but if you want to throw that out whenever you feel like without specifically noting that you're doing so math is going to get a lot harder for you to communicate.

[ April 08, 2011, 08:58 PM: Message edited by: xtownaga ]
 
Posted by Samprimary (Member # 8561) on :
 
quote:
Originally posted by Xavier:
I put it in an edit, so maybe you didn't see it:

Sources that say 288:


Where is the controversy exactly?

it is a weird controversy to be sure, but it's neat to me. How it gets worked out and all that.

In some places it's gotten as acrimonious as the point nine nine nine repeating equals one debate, and there's a lot of surprising processes like having google settle it.
 
Posted by Samprimary (Member # 8561) on :
 
quote:
Originally posted by King of Men:
Yeah, ok, 288. But whoever wrote the expression that way should be shot for lack of clarity.

if I can find them, i'll shoot them for you
 
Posted by mr_porteiro_head (Member # 4644) on :
 
quote:
Wikipedia tells me that APL and Smalltalk have no precedence levels, and that operators in these languages are evaluated strictly right to left and left to right, respectively.
IIRC, Lisp has no precedence levels, and operations must be explicitly ordered with parentheses.

[ April 08, 2011, 11:39 PM: Message edited by: mr_porteiro_head ]
 
Posted by happymann (Member # 9559) on :
 
At first read I saw the answer as 2 with reservations because I couldn't remember where "÷" fell in the order of operations. After reading that so many different places agree that the answer is 288, I will have to trust them since I haven't taken a math course in 10 years (even if it was college calculus). So consider me convinced.
 
Posted by scholarette (Member # 11540) on :
 
This is the lesson I review the most often with my kids. I have taught proper order of operations hundreds of time. Somethings have to be defined and this is how we have defined them and having a standard amongst everyone is necessary for sanity. Honestly, I find it ridiculous that this is even a discussion.
 
Posted by Wingracer (Member # 12293) on :
 
I kept getting 72. I couldn't tell on this little screen that it was a division symbol. I thought it was +.
[Big Grin]
 
Posted by Destineer (Member # 821) on :
 
Wow, what a pointless "problem" for people to be spending their time and energy arguing about. It's not even a question about math, really. It's a question about the notation we use to describe math, which is a matter of arbitrary convention.
 
Posted by jebus202 (Member # 2524) on :
 
Oh God, not this stuff. These kind of problems always pop up on 4chan and it's pure trolling for the lulz.

It's boring there, and it's boring here. Find better material, Samp.
 
Posted by Jeorge (Member # 11524) on :
 
well, it is interesting for me; a year or two ago our state math competition league had this argument because a problem writer (not me!) had written an expression in a format similar to this (thought I can't remember the specific expression) and different graphing calculators evaluated it differently! [Embarrassed]

I always make sure my competition math problems use a horizontal bar for division, as that avoids the confusion.

On a related note, I get emails from elementary teachers all over the world complaining that my "Order of Operations" game ( http://www.theproblemsite.com/games/onetoten2.asp ) doesn't work properly, because they've never been taught that M & D are on the same level of priority, as are A & S.

And these are the people teaching Order of Operations to our kids. Really scary. [Razz]
 
Posted by King of Men (Member # 6684) on :
 
Eh. I'm all for having competent math teachers, but there's such a thing as a priority. If the answer depends on getting the order of operations right, UR DOIN IT RONG. Put in some dang parens.
 
Posted by Samprimary (Member # 8561) on :
 
quote:
Originally posted by jebus202:
It's boring there, and it's boring here. Find better material, Samp.

If it bores you, don't involve yourself.
 
Posted by Teshi (Member # 5024) on :
 
I teach BIDMAS (or BEDMAS or PEDMAS or PIDMAS depending on which words you use, sigh) to my maths classes.

I see how two is reached, and agree that it could possibly be seen as ambiguous, but in order to have a general consensus on how to solve mathematical notation in general I agree the answer should be 288.

Defining it different is fine, but it means you're talking a different mathematical language and, chances are, your spaceship is going to miss Neptune.
 
Posted by Samprimary (Member # 8561) on :
 
quote:
Originally posted by Teshi:
I teach BIDMAS (or BEDMAS or PEDMAS or PIDMAS depending on which words you use, sigh) to my maths classes.

It's PEMDAS here. I liked finding out about all the european ones.
 
Posted by Glenn Arnold (Member # 3192) on :
 
quote:
Edited also to add in responce (sic) to Glenn:

Except this is completely different than the topic at hand. We can prove that pi =/= 3. Proving that something previously thought to be correct is not correct will cause mathematical conventions to change, but that's not ignoring something "when it suits you", it's ignoring something because it's wrong.

You ignore i, pi vs. Tau, and the parallel postulate, and focus on my hyperbole? (that's a joke, son)

Mathematical conventions like order of operations are just that: conventions. One might just as well say that Hebrew must be read left to right because it's the correct way to read.

Mathematical facts are determined not by convention, but by proof. And one of the standard ways to begin a proof is to assume that a convention is untrue. i assumes that there is a square root of -1. To date, no one has found a value for i, but we've found i very valuable. Likewise for the parallel postulate. Assume it's not true, and we get entirely valid (and useful) geometries that Euclid never dreamed of.

In this case, order of operations in ENTIRELY convention. It's not even axiomatic, it's just accepted by agreement. We could change the rules at any time, as long as we agree on new rules. But the current rules don't eliminate ambiguity. They're better than nothing, but they aren't perfect. We can prove that order of operations is important, but we can't prove that they are true.
 
Posted by Xavier (Member # 405) on :
 
quote:
You ignore i, pi vs. Tau
I think you are misunderstanding the debate on Pi vs Tau. Just because C = τr doesn't mean that C = 2πr is somehow incorrect. Those in favor of Tau are simply suggesting that we should default to using Tau in those equations because Pi is a bit clunkier. I don't see how this has anything to do with ignoring the standard order of operations.

quote:
But the current rules don't eliminate ambiguity.
Can you give an example where they don't?

Edit: I missed where you expand on why you bring up i, but I still don't understand how that's relevant.

Added:

quote:
One might just as well say that Hebrew must be read left to right because it's the correct way to read.
That's actually a great analogy for this, but it doesn't help your point. People who write in Hebrew have decided that it is to be read right to left, in a pretty analogous way to how mathematicians decided on the standard order of operations. What you are suggesting is that we should ignore standard conventions and write Hebrew left to right because we feel like it. You are the one suggesting we break from current conventions, not us.
 
Posted by Nighthawk (Member # 4176) on :
 
Microsoft Excel says the answer is... let's see... Ah! "Formula error"!

Seeing as Microsoft is the foremost expert on everything, I conclude that the question is a trick question and there is no acceptable answer. That is unless "Formula error" is one of the available choices in a multiple choice question.
 
Posted by Lisa (Member # 8384) on :
 
One of the comments here argues that since we wouldn't evaluate 48÷2x as 48÷2×x, we should also treat 2(12) as a distinct entity. I just don't know what the rule is here. Are variables treated differently than numbers? Maybe it is 2.

I went to the Order of operations article at Wikipedia, and there's nothing there that would help. I posted a note on the discussion page, though, and maybe someone there will have an answer.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
quote:
But the current rules don't eliminate ambiguity.
They do in this case.

Assuming standard mathematical notation, there is one and only one solution for 48÷2(9+3). It is completely unambiguous. If you get any other answer than the correct one, then you made an error in reading the mathematical notation.

What it lacks is clarity -- it's far too easy for a human to misread it, as evidence by the multiple people who are comfortable and experienced with mathematical notation getting it wrong.

I'm glad that Samp posted this. It's interesting. I got it wrong at first as well, but as soon as I realized what I had done wrong, the correct answer was obvious.
 
Posted by Xavier (Member # 405) on :
 
Edit: This response is to Lisa.

The ÷ sign seems to be confusing you. Replace it with "/" and it becomes clear.

48/2x = 24x

We don't treat variables any differently than numbers. If we did, we'd have to chuck the whole system.

Added:

If the above isn't clear, consider 3/4x. That is (3/4)x, never 3/(4x). So if x is 5, then 3/4x is 15/4, not 3/20.
 
Posted by Lisa (Member # 8384) on :
 
quote:
Originally posted by Xavier:
Edit: This response is to Lisa.

The ÷ sign seems to be confusing you. Replace it with "/" and it becomes clear.

48/2x = 24x

See, and I'd say that 48/2x = 24/x.
 
Posted by Teshi (Member # 5024) on :
 
Given that you always solve math problems left to right, you should solve it so you end up with a multiplication by x or you should write it as 48/(2x).

However, I can see this ambiguity, because I think this is how Lisa is seeing it, although I don't think you can solve this as written without knowing x (although this is something I'm not sure about).

48
____ =
2x

This is the equivalent of 48/(2x) = NOT 48/2x, although I can definitely see that there is some ambiguity (it's a poorly written question there for those who don't view / as distinct from fraction notation.

The real problem written with a fraction looks like this:

48
(____) x =
2

I agree the distinction is not intuitive, but I think that, like the totally infamous airplane on a treadmill question, the ambiguity lies on the issues in the problem, rather than the issues in the actual conventions of our notation.
 
Posted by Jeorge (Member # 11524) on :
 
quote:
Originally posted by King of Men:
Eh. I'm all for having competent math teachers, but there's such a thing as a priority. If the answer depends on getting the order of operations right, UR DOIN IT RONG. Put in some dang parens.

I disagree. I teach algebra, and when I have students who have been taught Order of Operations incorrectly, I have to re-teach it, otherwise I get students who will simplify this incorrectly:

2x - x + 5x

And they say it's -4x. Why? Because you do addition before subtraction, so it's 2x - (x + 5x).

And I'm sorry, but I'm not going to ask my students to insert dang parens in every problem to force them to read it as:

(2x - x) + 5x

That's a waste of time and ink and effort.
 
Posted by Xavier (Member # 405) on :
 
quote:
See, and I'd say that 48/2x = 24/x.
I'm confused here Lisa. Do you think that it should be 24/x, or that it is 24/x (by current notational standards).

The former is something I can sympathize with, and won't argue with your opinion. The latter, however, is simply false.

Here is an example:

1/4x + 3/4x + 1/2x

This evaluates to 3/2x.

It can be written alternatively as:

0.25x + 0.75x + 0.5x = 1.5x

It is the exact same equation.

Similarly:

48 / 2x = 48 * 0.5 * x

Which I think you will agree is 24x.
 
Posted by Lisa (Member # 8384) on :
 
quote:
Originally posted by Jeorge:
Because you do addition before subtraction,

Since when? Addition and subtraction are done from left to right, without any regard for which is first.
 
Posted by Ace of Spades (Member # 2256) on :
 
He's saying that that's the incorrect way some students have been taught.
 
Posted by Jeorge (Member # 11524) on :
 
quote:
Originally posted by Lisa:
quote:
Originally posted by Jeorge:
Because you do addition before subtraction,

Since when? Addition and subtraction are done from left to right, without any regard for which is first.
Did you read my posts in their entirety? [Wink] Because that was exactly my point! There are teachers all over the place who teach it incorrectly, so by the time I get students in high school, they have it ingrained that you do addition before subtraction, even though that's not correct.

At first I thought they just were missing the point of what their teachers were saying, until I built that math game I linked earlier, and all of a sudden started getting emails from elementary school teachers all over the place complaining that my game didn't work right, because it didn't do addition before subtraction. [Razz]
 
Posted by Jeorge (Member # 11524) on :
 
If you have a school teacher who isn't strong in math, but has to teach math anyway (which typically happens more in the elementary grades) they do a cursory reading on things, and then say, "Oh, I've got it...PEMDAS means you do operations in that order, so multiplication is before division..."

And they teach it to their students that way, and no one is ever the wiser until the student gets to an Algebra class and their understanding of it gets turned upside down.
 
Posted by Teshi (Member # 5024) on :
 
As someone who teached BEDMAS for the first time, I can say it may not necessarily be what they are taught, only what they have learned.

The idea of BEDMAS as an order mnemonic is misleading. Lots of kids, despite my off-the-top explanation that DM and AS go simply from right to left in any order still stick to the idea that division comes before multiplication and addition before subtraction because that's what BEDMAS (or PIDMAS or PEDMAS or BIDMAS) makes it look like.

And some kids have difficulty getting over the mnemonic. Sigh.
 
Posted by Jeorge (Member # 11524) on :
 
quote:
Originally posted by Teshi:
I can say it may not necessarily be what they are taught, only what they have learned.

Yeah, and sometimes it is simply mis-learning, but I've had enough inquiries from teachers to know that it's also mis-learning on the part of the teacher. [Frown]

I don't know how to display this properly in the forum, but I always put MD vertically and AS vertically when spelling out PEMDAS, to visually show that M and D, from left to right, are at the same level, as are Addition and Subtraction.
 
Posted by Glenn Arnold (Member # 3192) on :
 
quote:
I think you are misunderstanding the debate on Pi vs Tau.
I think you are misunderstanding my argument. Pi is a convention. It is currently argued (we'll see if the convention changes) that Pi is inelegant, and the convention should be changed so that it is easier to understand.

quote:
What you are suggesting is that we should ignore standard conventions
Ah. this proves you don't understand my argument. I'm not suggesting that we ignore conventions. I'm suggest we improve them.

quote:
quote:But the current rules don't eliminate ambiguity.

Can you give an example where they don't?

Yes. This one. It's pretty obvious that the question was asked to begin with because the OP recognized that many people would find the problem ambiguous. And then, a Ph.D physicist (among others) gave the "wrong" answer. As I said in my first post in this thread, the problem here is that these numbers are laid out purely for arithmetic's sake. Assuming that there is a real world problem that these numbers represent, investigating that problem may well reveal that the arithmetic is not laid out in accordance with the rules of order of operations. Order of operations is irrelevant. What's important (in all math problems) is reality.
 
Posted by Glenn Arnold (Member # 3192) on :
 
quote:
What it lacks is clarity -- it's far too easy for a human to misread it, as evidence by the multiple people who are comfortable and experienced with mathematical notation getting it wrong.
Semantics.
 
Posted by Lisa (Member # 8384) on :
 
Here is what happens when you punchh it into a calculator.
 
Posted by Wingracer (Member # 12293) on :
 
I get what you are saying Glen. Since this problem is a strictly mathematical one (we have no context for what real world problem it is trying to solve), we do not know if the standard order of operations is justified or not. All we can do is try to follow the conventions to get the answer our teacher expects on the test.

If we did have a context for the problem, we might find that conventional order of operations gives the wrong answer to the real world situation. However, I would like to point out that if this is the case, I feel it is more an error on the person that wrote the problem in the first place, not an inherent error in the convention.
 
Posted by Wingracer (Member # 12293) on :
 
quote:
Originally posted by Lisa:
Here is what happens when you punchh it into a calculator.

Interesting that they are the same brand of calculator. Even the same manufacturer can't agree. [Big Grin]
 
Posted by Lisa (Member # 8384) on :
 
After pondering this question, I've come to the conclusion that the correct answer is 2. And that positioning two expressions adjacent to one another in order to signify multiplication carries with it an implicit grouping. The reason the contents of parentheses are evaluated first is that they signify grouping. This notation carries with it an implicit grouping.

My blog post about this actually started out by saying that either 2 or 288 is theoretically correct, and that it depends on how you handle the vagueness of the standard order of operations. But by the time I reached the end of the post, I'd concluded that this is wrong, so I went back and edited the beginning.

The truth is, anyone using an equation like that probably should use another set of parentheses in order to avoid confusion, but lacking that, the answer has to be 2.
 
Posted by PSI Teleport (Member # 5545) on :
 
Win: Even more interesting that it's the newer model that ended up with 2 as the answer.
 
Posted by Wingracer (Member # 12293) on :
 
quote:
Originally posted by Lisa:
After pondering this question, I've come to the conclusion that the correct answer is 2.

What if this equation was for determining the minimum safe number of bolts needed for a bridge section and the correct answer in reality is 288? You just built a bridge that will collapse and kill many people when those 2 bolts fail.

I think this is what some people were talking about with the difference between mathematics as pure abstraction and real world situations.
 
Posted by The Rabbit (Member # 671) on :
 
quote:
Originally posted by scholarette:
There is no ambiguity. 2 is wrong. 288 is right.

Scholarette is right. The rules are clear. First you do the operation that is in parentheses, then you do exponents, then multiplication (in the order in which its written), then addition (in the order in which its written.

Division and multiplication are the same thing as are addition and subtraction, so they have the same priority and are always done in the order in which they are written (regardless of how they are written). I learned those rules in 7th or 8th grade, they've been invaluable to me writing computer programs.
 
Posted by The Rabbit (Member # 671) on :
 
quote:
Originally posted by Wingracer:
quote:
Originally posted by Lisa:
Here is what happens when you punchh it into a calculator.

Interesting that they are the same brand of calculator. Even the same manufacturer can't agree. [Big Grin]
Yikes!!
 
Posted by Lisa (Member # 8384) on :
 
quote:
Originally posted by Wingracer:
quote:
Originally posted by Lisa:
After pondering this question, I've come to the conclusion that the correct answer is 2.

What if this equation was for determining the minimum safe number of bolts needed for a bridge section and the correct answer in reality is 288? You just built a bridge that will collapse and kill many people when those 2 bolts fail.
If you're doing a mechanics problem, you just don't put it that way. This question can really only arise theoretically or in a poorly written math text.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
quote:
positioning two expressions adjacent to one another in order to signify multiplication carries with it an implicit grouping
If you're doing any implying or inferring, you're not using standard mathematical notation. If you follow the rules of standard notation, there is one and only one answer.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
quote:
Originally posted by Glenn Arnold:
quote:
What it lacks is clarity -- it's far too easy for a human to misread it, as evidence by the multiple people who are comfortable and experienced with mathematical notation getting it wrong.
Semantics.
The two concepts usually go hand in hand, but the differences between them are pretty important in this situation.
 
Posted by Lisa (Member # 8384) on :
 
quote:
Originally posted by mr_porteiro_head:
quote:
positioning two expressions adjacent to one another in order to signify multiplication carries with it an implicit grouping
If you're doing any implying or inferring, you're not using standard mathematical notation. If you follow the rules of standard notation, there is one and only one answer.
So then you'd say that 48/2x (or 48÷2x) is equal to 24x? And not 24/x?
 
Posted by The Rabbit (Member # 671) on :
 
quote:
If you're doing a mechanics problem, you just don't put it that way. This question can really only arise theoretically or in a poorly written math text.
This problem arises all the time and has nothing to do with poorly written math texts. It comes up whenever you need to enter a long mathmatical formula into a computer. The solution to this problem is NOT to use more brackets. It is far too easy to make errors when you use lots of nested parentheses and far too difficult to find those errors. The standard student approach seems to be "When in doubt, add some more brackets. I've helped hundreds of engineering students debug/troubleshoot computer problems and virtually without exception, the more parentheses they've used, the more likely they are too have an error in their formula and the harder it will be to find that error.

The fact that some calculators (and possible other computers) aren't following the standard order of operations is really scary and dangerous.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
First, I'd say that 48/2x is a terrible way of writing it. In fact, it is the first thing I said in this thread.

Despite how used we are to expressions like 2x being considered a single thing, it's really just a shorthand for 2 * x, which bring us to 48 / 2 * x.

And since multiplication and division have the same priority, standard mathematical notation says that you have to resolve it from left to right, giving us 24 * x.

If you assume that it's 48/(2x), then you're assuming that the person who wrote it wrote it wrong (that is, not following standard mathematical notation for what he intended). Which, honestly, is a pretty good assumption. It's a terrible expression.
 
Posted by fugu13 (Member # 2859) on :
 
That's the rule (24x). I think you have a reasonable case that many people would interpret it otherwise, but that's not how the rules work. The currently accepted way of interpreting mathematical expressions would render it as 24x, full stop. Of course, the real rule in such a situation is to not write things in such an annoying way. You'd never see somebody who writes down mathematical expressions in the normal course of things ever write an expression so annoyingly.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
quote:
Originally posted by The Rabbit:
quote:
If you're doing a mechanics problem, you just don't put it that way. This question can really only arise theoretically or in a poorly written math text.
This problem arises all the time and has nothing to do with poorly written math texts. It comes up whenever you need to enter a long mathmatical formula into a computer. The solution to this problem is NOT to use more brackets. It is far too easy to make errors when you use lots of nested parentheses and far too difficult to find those errors. The standard student approach seems to be "When in doubt, add some more brackets. I've helped hundreds of engineering students debug/troubleshoot computer problems and virtually without exception, the more parentheses they've used, the more likely they are too have an error in their formula and the harder it will be to find that error.

Rabbit makes a point -- I run into this sort of thing all the time in programming.

In my experience, it's far better to use parentheses than to rely on the order of operations being left-to right. Not because the left-to-right order of operations cannot be depended on, but because it makes the expression much more difficult for humans to read and decipher.

But in cases where there are enough parentheses that it becomes difficult to see what's happening, it's usually easy enough to create new variables to simplify things.

I have zero qualms depending on the other order of oprations. If you don't instinctively know that multiplication happens before addition, you've got huge problems as a programmer.
 
Posted by Xavier (Member # 405) on :
 
quote:
That's the rule (24x). I think you have a reasonable case that many people would interpret it otherwise, but that's not how the rules work. The currently accepted way of interpreting mathematical expressions would render it as 24x, full stop. Of course, the real rule in such a situation is to not write things in such an annoying way. You'd never see somebody who writes down mathematical expressions in the normal course of things ever write an expression so annoyingly.
While this is true of the example in the subject bar, I did see this sort of thing pretty commonly in my way to my Math minor:

1/4x^3 + 3/4x^2 + 1/2x + 2/3

Here the professor could have written:

(1/4)x^3 + (3/4)x^2 + (1/2)x + 2/3

But its not necessary to do so when you assume your students are familiar with the order of operations.

The example in the subject title is annoyingly unclear, but 3/4x being (3/4)x and not 3/(4x) is something you needed to know off the top of your head for the curriculum I encountered.
 
Posted by Nighthawk (Member # 4176) on :
 
But how many curriculums still write fractions like that, as a single line, and not as a proper fraction with a horizontal dividing line, where numerator and denominator are clear?
 
Posted by The Rabbit (Member # 671) on :
 
quote:
n my experience, it's far better to use parentheses than to rely on the order of operations being left-to right. Not because the left-to-right order of operations cannot be depended on, but because it makes the expression much more difficult for humans to read and decipher.
My experience leads me to the opposite conclusion. The more parentheses people use, the harder it is to decipher a long formula in code. It's too easy to mistake which close parenthesis goes with which open parenthesis. Yes, you can break it up by introducing new variables that play the same role, but when the formula has some physical meaning (as they nearly always do in engineering) introducing dummy variables makes it harder rather than easier to decipher what's going on.
 
Posted by Jeorge (Member # 11524) on :
 
quote:
Originally posted by Nighthawk:
a proper fraction

I'm assuming you are not using the proper mathematical definition of a proper fraction? As it would be quite improper to imply that this does not properly apply to improper fractions as well...
 
Posted by The Rabbit (Member # 671) on :
 
quote:
Originally posted by Nighthawk:
But how many curriculums still write fractions like that, as a single line, and not as a proper fraction with a horizontal dividing line, where numerator and denominator are clear?

That's irrelevant. If you need to enter the formula into a computer program, it's still most commonly done in a single line. Since being able to enter mathematical expression into computer programs is an important skill, people need to know how to do it.
 
Posted by Nighthawk (Member # 4176) on :
 
quote:
Originally posted by Jeorge:
quote:
Originally posted by Nighthawk: a proper fraction
I'm assuming you are not using the proper mathematical definition of a proper fraction? As it would be quite improper to imply that this does not properly apply to improper fractions as well...
I'm not using the mathematical term. I mean "proper" in terms of display, as far as it is written: numerator and denominator.

quote:
Originally posted by The Rabbit:
quote:
Originally posted by Nighthawk:
But how many curriculums still write fractions like that, as a single line, and not as a proper fraction with a horizontal dividing line, where numerator and denominator are clear?

That's irrelevant. If you need to enter the formula into a computer program, it's still most commonly done in a single line. Since being able to enter mathematical expression into computer programs is an important skill, people need to know how to do it.
But entering it as written above, at least in most of the programs I know of, will yield an error. Can't enter it exactly as written in Excel or most of the programming languages I know. And as far as I know (it's been a while since I use it) programs like Mathematica explicitly require entering it in fraction form.
 
Posted by The Rabbit (Member # 671) on :
 
quote:
But entering it as written above, at least in most of the programs I know of, will yield an error.
That's really irrelevant. The terms 3x2, 3*2, 3(2), and 3*(2) mean exactly the same thing. 3/2,3÷2 and 3 over 2 mean exactly the same thing. The fact that some computer programs will accept only a subset of those terms is why its important to understand that they mean exactly the same thing. The fact that we calculate so many things using computer programs is a large part of why its important to understand the standard rules for the order of calculations.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
quote:
My experience leads me to the opposite conclusion. The more parentheses people use, the harder it is to decipher a long formula in code. It's too easy to mistake which close parenthesis goes with which open parenthesis
These days, any code editor worth its salt makes it very easy to tell which parentheses are paired. In many, if you put the cursor on one parentheses (or bracket, or quotation mark, etc.), the paired one is hilighted, bolded, etc.. Its pretty easy to read multiple nested parentheses when the editor does that for you.
 
Posted by The Rabbit (Member # 671) on :
 
quote:
Originally posted by mr_porteiro_head:
quote:
My experience leads me to the opposite conclusion. The more parentheses people use, the harder it is to decipher a long formula in code. It's too easy to mistake which close parenthesis goes with which open parenthesis
These days, any code editor worth its salt makes it very easy to tell which parentheses are paired. In many, if you put the cursor on one parentheses (or bracket, or quotation mark, etc.), the paired one is hilighted, bolded, etc.. Its pretty easy to read multiple nested parentheses when the editor does that for you.
I still disagree. Both matlab and excel have this feature and I still find that the more parentheses used in a formula, the harder it is to decipher the formula. I help students try to trouble shoot these things daily and the more parentheses they've used, the more likely it is that they've made an error and the harder it will be to find that error. I've taken to starting by deleting all the unnecessary parentheses since this is often the only way to sort out which set of parentheses is wrong.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
:shrug: While it's certainly possible to use too many parentheses, I think they're far preferable to depending on left-to-right operation order.

But then, I don't deal with novice programmers much. The coders I deal with have years of experience and don't egregious numbers of parentheses.
 
Posted by TomDavidson (Member # 124) on :
 
It's worth noting, Rabbit, that neither Matlab nor Excel are "code editor(s) worth (their) salt." As Porter has noted, actual code editors make parentheses trivially easy to pair up. Heck, even some text editors -- albeit ones designed for code -- do this fairly well. Neither Excel nor Matlab do.
 
Posted by The Rabbit (Member # 671) on :
 
quote:
Porter has noted, actual code editors make parentheses trivially easy to pair up.
Porter said

quote:
In many, if you put the cursor on one parentheses (or bracket, or quotation mark, etc.), the paired one is hilighted, bolded, etc.. Its pretty easy to read multiple nested parentheses when the editor does that for you.
I'm perfectly willing to believe there are better code editors but both matlab and excel have the feature Porter descibes. It's certainly helpful but I still find it very tedious to decipher formulas that contain many nested parentheses.

I'm not working with professional coders, I'm working with students. My students are not studying to become professional coders, they are studying to be engineers and scientist. As professionals, they are going to be using programs like excel and matlab and not "code editor(s) that are worth (their) salt".

Which takes me back to my original point. Understanding the standard order of operations is very important to any one who uses computer programs, like matlab, excel or even a graphing calculator, to evaluate long mathematical formulas. It's not just a text book problem that can be easily remedied by improving the notation used in text books.

[ April 11, 2011, 09:26 AM: Message edited by: The Rabbit ]
 
Posted by The Rabbit (Member # 671) on :
 
Porter and Tom, Here's a sample of what I'm talking about.

Here is typical sort of formula that might be used in a class I teach entered taking advantage of the standard order of calculations.

Y = 5/0.25^2*((T1-2*T2/0.25+T3)/0.1^2/2-1/0.25^2*(T3-T1)/0.1/2)+1/2*T1

Here's the formula as entered as it would be entered by one of my typical students. It contains an error. Which formula is easiest to decipher? Go ahead and paste it into what ever code editor you like.

Y = (5/(0.25^2))*(((T1-(2*T2)/0.25+T3)/(2*(0.1^2)))-(1/(0.25^2)*(T3-T1)/(2*0.2))+((1/2)*T1))
 
Posted by mr_porteiro_head (Member # 4644) on :
 
The second. It's not even a contest.

[ April 11, 2011, 10:29 AM: Message edited by: mr_porteiro_head ]
 
Posted by TomDavidson (Member # 124) on :
 
Yeah, the second. It's far, far clearer.
 
Posted by TomDavidson (Member # 124) on :
 
To give you an idea, my code editor almost immediately rendered it this way when I told it to:

code:
Y = 
(
5/(0.25^2)
)
*
(
(
(
T1-(2*T2)/0.25+T3) / (2*(0.1^2)
)
)
-
(
1/(0.25^2)*(T3-T1) / (2*0.2)
)
+
(
(1/2)*T1
)
)


 
Posted by mr_porteiro_head (Member # 4644) on :
 
Hmm... I've never used a code editor to expand out expressions in that manner. What editor are you using, Tom, and what is the tool you used there called?
 
Posted by Jeorge (Member # 11524) on :
 
Wow...I wrote a little utility once to expand nested loops/brackets/etc like that; I had no idea that was available in an editor.
 
Posted by TomDavidson (Member # 124) on :
 
It's part of the Idera toolkit for SQL Management Studio, which I used for this example as opposed to other editors because parentheses are more of a SQL thing. [Smile]

Don't be TOO glad, though, because careful review will reveal that it actually indented it incorrectly. Of course, this is likely due to the error Rabbit mentioned.
 
Posted by MattP (Member # 10495) on :
 
I also much prefer the second version. At least I can get some sense of the grouping of expressions there. The first one is just a wall of numbers to me.
 
Posted by Jeorge (Member # 11524) on :
 
Well, it's still better than the utility I created, which would show you that something was out of whack, but wouldn't even try to offer any intuitive guesses on what might be wrong!
 
Posted by TomDavidson (Member # 124) on :
 
I think, indented correctly, it should look like this:

code:
Y = 
(
5/(0.25^2)
)
*
(
(
(
T1-(2*T2)/0.25+T3
)
/
(
2*(0.1^2)
)
)
-
(
1/(0.25^2)*(T3-T1) / (2*0.2)
)
+
(
(1/2)*T1
)
)


 
Posted by The Rabbit (Member # 671) on :
 
quote:
Originally posted by mr_porteiro_head:
The second. It's not even a contest.

The first is correct. The second has an error. How quickly can you find the error in the second.
 
Posted by TomDavidson (Member # 124) on :
 
Add an error to the first, then try to find it. [Smile]

In order for us to find an error in the second using the first as authoritative, we'd have to be confident that we're parsing the first one correctly. Which, frankly, I'm not; the first is considerably harder to parse.
 
Posted by just_me (Member # 3302) on :
 
on a quick glance it appears there is an extra "2*" term in the second one.
 
Posted by MattP (Member # 10495) on :
 
I think I see the error, but if it's what I think then it's unrelated to the parenthesis.

0.1^2/2 from the first equation appears as (2*(0.1^2)) in the second.

If this is correct, then I don't see what the use of parenthesis have to do with the committing or debugging of this error.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
quote:
In order for us to find an error in the second using the first as authoritative, we'd have to be confident that we're parsing the first one correctly. Which, frankly, I'm not; the first is considerably harder to parse.
Yup. When I went to find the error in the second one, the first thing I did was start carefully adding parentheses to the first one so that I could tell what it was actually doing.
 
Posted by The Rabbit (Member # 671) on :
 
quote:
Originally posted by mr_porteiro_head:
quote:
In order for us to find an error in the second using the first as authoritative, we'd have to be confident that we're parsing the first one correctly. Which, frankly, I'm not; the first is considerably harder to parse.
Yup. When I went to find the error in the second one, the first thing I did was start carefully adding parentheses to the first one so that I could tell what it was actually doing.
Curious. To find the error in the second one, I first go through and remove all the unnecessary parentheses. I parse the first one correctly essentially instantaneously.
 
Posted by MattP (Member # 10495) on :
 
quote:
Curious. To find the error in the second one, I first go through and remove all the unnecessary parentheses. I parse the first one correctly essentially instantaneously.
And my method is to add parenthesis to the first one. When dealing with a complex expression (or query) that is not producing the results I expect, I start using parenthesis to logically group key components so they can be more easily considered in isolation of the other components.
 
Posted by King of Men (Member # 6684) on :
 
The second is clearer, although they're both nightmares. By the way, who divides by 2 when they can multiply by 0.5?
 
Posted by mr_porteiro_head (Member # 4644) on :
 
quote:
By the way, who divides by 2 when they can multiply by 0.5?
She didn't just divide by two -- she multiplied by one divided by two.
 
Posted by SenojRetep (Member # 8614) on :
 
I agree with Porter, Matt, and Tom: I believe I could find an error in an equation with more parenthesis faster than in one with fewer.

But really I think both equations ought to be broken into several intermediate equations. I would create a sequence of equations using dummy variables so that no expression contained more than a few operations.

The first equation rerendered:
d1 = 0.25^2;
nT2 = 2*T2/0.25;
d2 = 2*0.1^2;
d3 = 2*0.1;
%nT1 = T1/d3;
%Y = 5/d1*((T1-nT2+T3)/d2-1/d1*(T3-nT1))+1/2*T1;
Y = 5/d1*((T1-nT2+T3)/d2-1/d1*(T3-T1)/d3)+1/2*T1;

Alternatively:
d1 = (0.25^2);
nT2 = (2*T2)/0.25;
d2 = (2*(0.1^2);
d3 = (2*0.2);
Y = (5/d1)*(((T1-nT2+T3)/d2))-(1/d1*(T3-T1)/d3)+((1/2)*T1))

There seems to be a missing parenthesis after d3 in the above expression, relative to the original expression.

The process of decoding the expression was much easier in the second case than in the first, where I often had to remind myself about what effect earlier operations were having on the one I was currently looking at.

<edit>Oops...I accidentally created a normalized T1 variable in interpreting the first expression. Interestingly, without realizing it, I happened to avoid this error in parsing the second case.</edit>
 
Posted by The Rabbit (Member # 671) on :
 
My first calculator was an HP. HP calculators have long been popular among engineers. In my experience, if you hand someone who isn't familiar with HPs, a calculator that use HP (or reverse) notation they haven't a clue what to do with it. But once people become accustomed to it, they are able to use the reverse notation far more quickly and accurately than people who use standard notation that requires using lots of brackets. Its really hard to find someone who has become proficient with the HP notation that doesn't prefer it.

I think its very much the same way with using the standard order of operations verses lots of brackets. It may be more difficult to become proficient at parsing equations using the standard order of operations, but once you've got it down its much faster and less error prone than using lots of brackets.

My students typically make the error in the example above by originally leaving out one of close parentheses. Then they get an error message and because they've used so many parentheses and don't take enough time to parsing the equation, they add the final parentheses in the wrong place.
 
Posted by CT (Member # 8342) on :
 
quote:
Originally posted by SenojRetep:
I agree with Porter, Matt, and Tom: I believe I could find an error in an equation with more parenthesis faster than in one with fewer.[

Me, too.

quote:
Originally posted by The Rabbit:
Its really hard to find someone who has become proficient with the HP notation that doesn't prefer it.

I'm one of those people. I had to become proficient at HP notation for advanced calculus, chemistry and physics classes. Once I finished with undergraduate and could chose my own resources, I happily left Reverse Polish behind.
 
Posted by The Rabbit (Member # 671) on :
 
quote:
Originally posted by mr_porteiro_head:
quote:
By the way, who divides by 2 when they can multiply by 0.5?
She didn't just divide by two -- she multiplied by one divided by two.
Interestingly, I have discovered that in matlab using certain computer processors, dividing by 2 and multiplying by 0.5 give slightly different results. Not that differences out at the 15th and 16th decimal points are commonly of importance, but they are there.
 
Posted by CT (Member # 8342) on :
 
PS to the above: Of course, I haven't a problem with other people using reverse notation in their calculations, so long as they are chosing the convention which most consistently leads to accurate answers in the calculations they do.
 
Posted by TomDavidson (Member # 124) on :
 
quote:
Interestingly, I have discovered that in matlab using certain computer processors, dividing by 2 and multiplying by 0.5 give slightly different results. Not that differences out at the 15th and 16th decimal points are commonly of importance, but they are there.
Hm. This is actually rather interesting. Which is more accurate?
 
Posted by MattP (Member # 10495) on :
 
quote:
Originally posted by The Rabbit:
quote:
Originally posted by mr_porteiro_head:
quote:
By the way, who divides by 2 when they can multiply by 0.5?
She didn't just divide by two -- she multiplied by one divided by two.
Interestingly, I have discovered that in matlab using certain computer processors, dividing by 2 and multiplying by 0.5 give slightly different results. Not that differences out at the 15th and 16th decimal points are commonly of importance, but they are there.
That is interesting. Both 2 and 0.5 can be expressed in IEEE-754 binary floating point without rounding issues. I'd be really curious to see an example of an equation that produces different results depending on whether you divide by 2 or multiply by 0.5.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
That's a problem with using a proprietary language like Matlab -- it's impossible to find out what's going on behind the scenes if it's making mistakes.
 
Posted by The Rabbit (Member # 671) on :
 
This question has me interested (for instructional purposes. I'd appreciate anyone who is willing to answer all or part of the question.

Consider this mathematical formula.

The following set of formulas are each missing one close parentheses (I hope [Big Grin] ). Find the error and post your corrected version. Please rank them in terms of how hard it was to find the error. Please report any software you used to help parse the formulas.

1. y = D*(1-1/r)*((c1-2*c2+c3)/dr^2+2/r*(c3-c2)/2/dr+k*(a*r-b)*c
2. y = D*(1-(1/r))*((c1-2*c2+c3)/(dr^2)+2/r*(c3-c2/(2*dr))+k*(a*r-b)*c2
3. y = (D*(1-(1/r))*((c1-2*c2+c3/(dr^2)+2/r*(c3-c2)/(2*dr)))+k*(a*r-b)*c2
4. y = D*(1-1/r)*((c1-2*c2+c3)/dr^2+2/r*(c3-c2)/(2*dr)+k*(a*r-b)*c2
5. y = (D*(1-(1/r)))*((c1-2*c2+c3)/(dr^2)+2/r*(c3-c2)/(2*dr))+k*((a*r-b)*c2
6. y = D*(1-1/r)*((c1-2*c2+c3)/(dr^2)+2/r*(c3-c2)/(2*dr)+k*(a*r-b)*c2
7. y = ((D*(1-(1/r)))*((c1-2*c2+c3)/(dr^2)+2/r*(c3-c2)/(2*dr))+k*(a*r-b)*c2
8. y = (D*(1-(1/r)))*((c1-2*c2+c3)/(dr^2)+2/r*(c3-c2)/(2*dr))+(k*(a*r-b)*c2
9. y = (((D*(1-(1/r)))*((c1-2*c2+c3)/(dr^2)+2/r*(c3-c2)/(2*dr)))+k*((a*r)-b)*c2


Edited to add: It appears that my inclinations on this are atypical. It would really help me as a teacher to get a better idea of how others see the problem. I'm guessing that there is some optimum level of bracketing and I think I have a guess where that optimum lies, but I'd really like to know how far off I am with that guess.

[ April 11, 2011, 02:30 PM: Message edited by: The Rabbit ]
 
Posted by The Rabbit (Member # 671) on :
 
quote:
Originally posted by mr_porteiro_head:
That's a problem with using a proprietary language like Matlab -- it's impossible to find out what's going on behind the scenes if it's making mistakes.

It's not making a mistake per se. It's a difference in round off error for floating point numbers. I don't think the problem is in matlab itself, because it occurs on some processors but not others. I discovered it when I was devising problems that demonstrated computer round off error.
 
Posted by Sean Monahan (Member # 9334) on :
 
quote:
Originally posted by The Rabbit:
This question has me interested (for instructional purposes. I'd appreciate anyone who is willing to answer all or part of the question.

I found this humorously ironic. [Smile]
 
Posted by The Rabbit (Member # 671) on :
 
quote:
Originally posted by Sean Monahan:
quote:
Originally posted by The Rabbit:
This question has me interested (for instructional purposes. I'd appreciate anyone who is willing to answer all or part of the question.

I found this humorously ironic. [Smile]
[Big Grin]

I guess I should have said "the following formulas and preceding sentences are each missing one closing parenthesis."
 
Posted by mr_porteiro_head (Member # 4644) on :
 
quote:
The following set of formulas are each missing one close parentheses (I hope [Big Grin] ).
I went through each one, correcting it as I went. Some of my "corrections" wouldn't actually change the result, such as it adding parentheses that weren't strictly needed.

Honestly, they were all the same. It's not a difficult formula -- I just went through and made sure that there were parentheses where there needed to be. It was pretty much the same process for each problem.

Each one ended up looking like one of these two:

code:
1. y = D*(1-1/r)   *((c1-2*c2+c3)/(dr^2)+(2/r)* (c3-c2)/(2*dr)) +k*(a*r-b)*c2
2. y = D*(1-(1/r)) *((c1-2*c2+c3)/(dr^2)+(2/r)*((c3-c2)/(2*dr)))+k*(a*r-b)*c2

The first differnece is between 1/r and (1/r). Looking back, I can see that I just kept that as whatever the first one was. I felt no need to add or remove those parentheses.

The other is between (c3-c2)/(2*dr) and ((c3-c2)/(2*dr)). Since the there's a single division at the end, there's no confusion with not having the parentheses there.* Again, I appear to have stuck with whatever was in the original problem after the initial cleanup of mis-matched parentheses.

The only software I used was gVim, a text editor with a lot of features designed for editing code. The only features I used were the hilighting of and jumping to the matched parentheses when the cursor was on a parentheses.

Oh, and #8 was not missing any closing parentheses.

*eta: For example, a*b*c*d*e*f/g needs no parentheses to be clear, because it doesn't matter what order you do the multiplication and division, but a*b/c*d/e*f/g would need several.
 
Posted by The Rabbit (Member # 671) on :
 
quote:
*eta: For example, a*b*c*d*e*f/g needs no parentheses to be clear, because it doesn't matter what order you do the multiplication and division, but a*b/c*d/e*f/g would need several.

 
Posted by TomDavidson (Member # 124) on :
 
quote:
It's a difference in round off error for floating point numbers.
Are these modern processors? There were known floating-point bugs in some older CPUs, years ago, but I'd be astonished if this were still happening. Do you have examples?
 
Posted by The Rabbit (Member # 671) on :
 
quote:
Originally posted by TomDavidson:
quote:
It's a difference in round off error for floating point numbers.
Are these modern processors? There were known floating-point bugs in some older CPUs, years ago, but I'd be astonished if this were still happening. Do you have examples?
Yes, these are modern processors. Round-off error is machine dependent. I'm not sure exactly why a/2 gives a very slightly different answer than 0.5*a, but it does, at least on some current machines. Like I said before, the difference normally occurs out at the 15th or 16th decimal place using double precision floating point representation.
 
Posted by MattP (Member # 10495) on :
 
There could conceivably be a difference in the result between a 32-bit vs 64-bit processor, depending on how floating point values are stored. For instance, 0.1 in IEEE-754 binary:

32-bit: 001111011110011001100110011001101
64-bit: 001111111011111001100110011001100110011001100110011001100110011010

While still rounded (note the repeating pattern of "1100" at the end), the 64-bit version does have more precision. This could result in a different result in a 64-bit calculation vs a 32-bit calculation. Though I doubt processor differences alone would account for this. I think you'd also need a 64-bit OS and 64-bit version of the application in question.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
Rabbit, did you mean to say something in the above post where you quoted me?
 
Posted by TomDavidson (Member # 124) on :
 
Yeah, Matt, I think you're right. ".5" is a decimal value, and is stored differently than the integer value "2". On a 32-bit processor, this difference could conceivably manifest itself in a visible way.
 
Posted by SenojRetep (Member # 8614) on :
 
I agree with Porter's analysis; none was significantly easier or harder to find the missing parenthesis using a tool that matches opening and closing brackets (in my case, the built-in Matlab editor).

As far as readability, I think #6 is the best balance between use and overuse of parentheses. Although again, I would never write any of those equations; I would separate it into much smaller chunks. In this case, if I were writing the formula you provided, I would do it as:

f1 = (1-1/r);
f2 = (c1-2*c2+c3)/(dr^2);
f3 = 2/r*(c3-c2)/(2*dr);
f4 = k*(a*r-b)*c2;
y = D*f1*(f2+f3)+f4;

although with variables renamed to provide significance.
 
Posted by Samprimary (Member # 8561) on :
 
quote:
Originally posted by TomDavidson:
quote:
It's a difference in round off error for floating point numbers.
Are these modern processors? There were known floating-point bugs in some older CPUs, years ago, but I'd be astonished if this were still happening. Do you have examples?
Sidenote: Did you play Mass Effect 2?
 
Posted by MattP (Member # 10495) on :
 
FYI, here's what .5 and 2 look like in binary floating point:

.5
32-bit: 001111110100000000000000000000000
64-bit: 00111111111010000000000000000000000000000000000000000000000000000

2
32-bit: 010000000100000000000000000000000
64-bit: 01000000000010000000000000000000000000000000000000000000000000000

Both values can be expressed with perfect precision in binary (look at that nice trail of 0s) so what's probably happening is that a rounding error is being introduced by another term in the expression which is amplified/preserved more by one of these values than the other.

Still, .5 is extremely similar to 2 in binary (just a small difference in the exponent (1 for the value of 2, -1 for the value of .5) so I'm surprised this difference is sufficient to manifest in different results often enough to notice it.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
The 2 is likely being stored as an integer, not in binary floating point.
 
Posted by MattP (Member # 10495) on :
 
quote:
Originally posted by mr_porteiro_head:
The 2 is likely being stored as an integer, not in binary floating point.

While I can see that being possible, it would actually be irrelevant to the evaluation of an expression. When the expression is actually evaluated, any integer values would need to be promoted to floating point values so the binary floating point value would come into play then.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
That makes sense.
 
Posted by MattP (Member # 10495) on :
 
I am making some assumptions about the software in question using standard floating point conventions. If MATLAB, for instance, has built some exotic proprietary floating point library then all bets are off.
 
Posted by The Rabbit (Member # 671) on :
 
quote:
Originally posted by mr_porteiro_head:
Rabbit, did you mean to say something in the above post where you quoted me?

Woops, yes I meant to say that I'm so accustomed to applying the standard order of operations that it actually took me some time to figure out why you thought the second case was any different than the first.

I'm genuinely surprised to see how many math and computer literate adults find the standard order of operations to be confusing. To me, they seem incredibly straight forward and unambiguous. I've been working with them long enough that its quicker and easier for me to parse a formula that uses the standard rules than one with lots of parentheses.
 
Posted by MattP (Member # 10495) on :
 
quote:
I'm genuinely surprised to see how many math and computer literate adults find the standard order of operations to be confusing.
Speaking for myself, it's not the order of operations that's confusing, but the sheer volume of data. When you have different operations with different OOO priority scattered throughout a lengthy, complex equation, the mental stack necessary to keep everything in order can be confusing.

By adding parenthesis, you break it down into multiple smaller units that are easier to evaluate individually.
 
Posted by TomDavidson (Member # 124) on :
 
*nod* Since you resolve and design each unit separately, it's easier to "debug" through unit testing even if the overall picture is murkier.
 
Posted by rivka (Member # 4859) on :
 
quote:
Originally posted by CT:
quote:
Originally posted by The Rabbit:
Its really hard to find someone who has become proficient with the HP notation that doesn't prefer it.

I'm one of those people. I had to become proficient at HP notation for advanced calculus, chemistry and physics classes. Once I finished with undergraduate and could chose my own resources, I happily left Reverse Polish behind.
Ditto. I was never a fan.
 
Posted by King of Men (Member # 6684) on :
 
So, additional data, I just tried the problem in the OP on one of my bosses, a physics professor who got his PhD in an era when there were no desktop calculators. He got it wrong, too. So did a physics undergrad we've got working with us. But we all agree on what the correct answer is once the issue is pointed out. So, sod the order of operations, that problem without parens is just plain misleading.
 
Posted by rivka (Member # 4859) on :
 
Pfft. The fact that PhD'd mathematicians and physicists can't do basic arithmetic is a well-documented phenomenon.

(In the days of print catlogs) the AMS had to print a separate catalog for members, because many of them couldn't calculate 20% off consistently. [Razz]
 
Posted by The Rabbit (Member # 671) on :
 
quote:
So, sod the order of operations, that problem without parens is just plain misleading.
Obviously you are correct, though as I said before I find that a genuine surprise.

I wonder if there would be the same degree of confusion if the problem were written 48/2*(9+3) or 48/2(9+3) rather than 48÷2(9+3). Even though nearly everyone would agree that all three ways of writing it are identical, the visual spacing is different. I think when its written 48÷2(9+3), the spacing creates a visual break between the 48 and the 2 that makes one want to group the 2(9+3), when its written the other way 48/2*(9+3), the visual break works the opposite way.

When I first saw the problem, I wasn't wearing my glasses and got the answer 72 because I read it 48+2(9+3). I don't think I've seen the ÷ sign used in a problem since elementary school. I'm pretty sure I've never seen it in an expression that omitted using a 'x' sign for multiplication.
 
Posted by The Rabbit (Member # 671) on :
 
quote:
Originally posted by rivka:
Pfft. The fact that PhD'd mathematicians and physicists can't do basic arithmetic is a well-documented phenomenon.

(In the days of print catlogs) the AMS had to print a separate catalog for members, because many of them couldn't calculate 20% off consistently. [Razz]

This.
 
Posted by The Rabbit (Member # 671) on :
 
quote:
Originally posted by TomDavidson:
*nod* Since you resolve and design each unit separately, it's easier to "debug" through unit testing even if the overall picture is murkier.

As a general rule I agree. When I am coding long formulas, I very commonly do something like SenojRetep suggested because its so much easier to "debug" each little piece.

quote:
In this case, if I were writing the formula you provided, I would do it as:

f1 = (1-1/r);
f2 = (c1-2*c2+c3)/(dr^2);
f3 = 2/r*(c3-c2)/(2*dr);
f4 = k*(a*r-b)*c2;
y = D*f1*(f2+f3)+f4;

But it definitely makes the overall picture of what I'm doing murkier. If I do this when I'm trying to show less advanced students how to work a problem, they have a terrible time following what I'm doing.

For me, however, using lots nested brackets generally has the opposite effect.

Thanks to MPH and Senoj for answering my question. Senoj, your assessment that number 6
quote:
6. y = D*(1-1/r)*((c1-2*c2+c3)/(dr^2)+2/r*(c3-c2)/(2*dr)+k*(a*r-b)*c2
was the optimal number of brackets, was what I expected. It has two more sets of parentheses than case number 1. One set is completely unnecessary (dr^2), the other (2*dr) can be eliminated if you change the operator. I agree that changing "/dr/2" to "/(2*dr)" improves the readability of the equation. Adding the brackets around dr^2 just seems to make things more cluttered to me, but I can see how some people would find the lack of brackets ambiguous. Adding more brackets than #6 definitely makes it harder for me to decipher rather than easier.

The problem I face is that students are much more likely to bring me something like

quote:
y = (((D*(1-(1/r)))*((c1-2*c2+c3)/(dr^2)+2/r*(c3-c2)/(2*dr)))+k*((a*r-b*c2)))
The formula gives the wrong answer because they've misplaced one of the brackets, but because they've used so freaking many unneeded brackets, it's a lot harder to find the mistake. (I'm not exaggerating, I've seen hundreds of students do this)

They do this because they've learned to use brackets instead of understanding and applying the order operations.
 
Posted by mr_porteiro_head (Member # 4644) on :
 
quote:
They do this because they've learned to use brackets instead of understanding and applying the order operations.
No, if they'd learned to properly use parentheses, they wouldn't be making the mistakes in the first place.
 
Posted by Ghost of Xavier (Member # 2852) on :
 
quote:
I wonder if there would be the same degree of confusion if the problem were written 48/2*(9+3) or 48/2(9+3) rather than 48÷2(9+3). Even though nearly everyone would agree that all three ways of writing it are identical, the visual spacing is different. I think when its written 48÷2(9+3), the spacing creates a visual break between the 48 and the 2 that makes one want to group the 2(9+3), when its written the other way 48/2*(9+3), the visual break works the opposite way.
Yeah, agreed. The main issues here seem to be:

1) People getting confused by the ÷ sign. It looks like a + sign, and adds a level of unfamiliarity with the syntax that makes previous practice with OOO not 100% applicable. I immediately answered 288, but when KoM and others were convinced it was 2, I started to wonder if ÷ and / were different after all (see my second post).

2) People thinking that 2(x) is somehow different from 2 * (x). To me, this was a surprise to see. I've never thought of juxtaposition as anything other than a shorthand for multiplication. To even have to argue this was an odd feeling.

3) The answer of "2" is cleaner than the answer of "288". I have used this test taking strategy myself to good effect. When one answer is simple and the other less simple, the simple answer is usually the correct one.

If the original problem had been written as:

quote:
3/4(12) = ?

A) 9
B) 3/48
C) None of the above.

I doubt there'd be a huge debate over juxtaposition, but maybe I'd be wrong.

Is the above example unclear to anyone here? Would those arguing that juxtaposition is somehow special think the answer should be B?

Edit: I'm also curious if Porter and others think the above should have been written as (3/4)12 or something. To me it is perfectly clear as written, but maybe I got more practice at this than others.

Edit 2: I also am wondering if my bad hand writing is to thank for how this seems obvious to me. I typed up a lot of my math homework in college so my teachers could read it, and the "insert equation" functions had not been added to word processors yet. When typed out, 3/4x + 1/2x looks a lot better than (3/4)x + (1/2)x, at least to me.

[ April 11, 2011, 05:40 PM: Message edited by: Ghost of Xavier ]
 
Posted by mr_porteiro_head (Member # 4644) on :
 
quote:
Edit: I'm also curious if Porter and others think the above should have been written as (3/4)12 or something.
Yes.
 
Posted by King of Men (Member # 6684) on :
 
quote:
Originally posted by rivka:
Pfft. The fact that PhD'd mathematicians and physicists can't do basic arithmetic is a well-documented phenomenon.

Well yes, granted. But in this case we're not making a simple mistake. Nobody is multiplying 2 by 12 and getting 25. We're all getting the same wrong answer! So it's not a question of simple arithmetical mistakes, but of mentally inserting the wrong parens.

As a complete aside, I remember being taught as a child to do what was called mental arithmetic (`hoderegning'), where you were supposed to ignore the order of operations. That is, the teacher would list up some problem like "Two, plus four, times 2", and you were supposed to keep a running total and get twelve, rather than 10. This was explicitly explained to be an exception to the usual rules. I don't recall the rationale, but presumably it was considered that when instructions are being given manually, any sort of dependence on the order of operations was Doin It Rong; any such problem should not be constructed so that you need to hold the whole stack of instructions in your head at once, a running total should be sufficient. Or maybe it was just to practice doing arithmetic fast; if you were still calculating 2+4 when the teacher said "times 2", you'd get the wrong answer anyway.
 
Posted by TomDavidson (Member # 124) on :
 
quote:
I'm also curious if Porter and others think the above should have been written as (3/4)12 or something.
I absolutely do.

3/4(12) or 3/4*12 both introduce possible misunderstandings, while 12(3/4) is perfectly clear.
 
Posted by Tstorm (Member # 1871) on :
 
Yes, the parenthesis make the difference on (3/4)12 versus the other possibilities.

Great discussion, by the way. If I needed any refresher on my understanding of order of operations, I certainly received it. [Smile]
 
Posted by rivka (Member # 4859) on :
 
quote:
Originally posted by King of Men:
quote:
Originally posted by rivka:
Pfft. The fact that PhD'd mathematicians and physicists can't do basic arithmetic is a well-documented phenomenon.

Well yes, granted. But in this case we're not making a simple mistake.
Sure you are. The difference is of type, not degree, and it comes down to the rules of basic arithmetic.
 
Posted by King of Men (Member # 6684) on :
 
No, the point is that we're all making the same mistake. If we made errors of multiplication, you'd expect us to be all over the place - one multiplies two by twelve and gets twenty-five, another gets twenty-eight. But we all multiply, add, and divide correctly, just in the wrong order.
 
Posted by rivka (Member # 4859) on :
 
The fact that there are fewer types of mistakes possible with OoO than with multiplication hardly seems to prove that it is less simple.
 
Posted by The Rabbit (Member # 671) on :
 
The fact that you are all making the same mistake, suggests you all have the same deficiency. I'd suggest you all be required to enroll in a basic refresher course in arithmetic.
 
Posted by Xavier (Member # 405) on :
 
I'd consider that unreasonably rude phrasing Rabbit, but KoM has been a jerk about math proficiency enough on this forum that he probably deserves that and much more [Smile] .
 
Posted by The Rabbit (Member # 671) on :
 
If telling Ph.D. physicists they need to take a course in remedial arithmetic isn't understood in the joking tone in which it is intended, I give up.
 
Posted by Xavier (Member # 405) on :
 
Eh, could have been just me. I'm usually pretty good at picking up tone, or at least I thought I was, but that doesn't mean I don't make mistakes.

Edit: Though to clarify, I knew it was a joke, I just seem to have misinterpreted the tone of the joke.
 
Posted by King of Men (Member # 6684) on :
 
quote:
Originally posted by The Rabbit:
The fact that you are all making the same mistake, suggests you all have the same deficiency. I'd suggest you all be required to enroll in a basic refresher course in arithmetic.

Well yes. We just did, by having our mistake pointed out to us. [Smile]

As an incidental aside, my ancient graphing calculator from Casio makes the same mistake when the problem is given in the form in the OP; but if I insert an 'x' between the 2 and the paren, it gets it right. Looks like some Casio programmer didn't consider an edge case.
 


Copyright © 2008 Hatrack River Enterprises Inc. All rights reserved.
Reproduction in whole or in part without permission is prohibited.


Powered by Infopop Corporation
UBB.classic™ 6.7.2