Wednesday, April 6, 2016

PEMDAS...it's not just for breakfast anymore.


PEMDAS...it's not just for breakfast anymore.

Originally shared by Notepad++

My 8 year-old son has asked me "Why should I learn math?".
I have showed him this video and then, he work hard on math.

22 comments:

  1. Adam Liss​, for your math series.

    ReplyDelete
  2. In Australia the order was taught to us as BODMAS (brackets, of, division, multiplication, addition, subtraction) but I'm sure it's essentially the same thing

    ReplyDelete
  3. Order of operations is not math. It's a hack we use because the standard orthography for arithmetic is needlessly ambiguous.

    In most of the rest of math, we use prefix notation for functions, rather than infix. If we treat + as similar to some named function like sine (and it fundamentally is the same kind of thing!) then we would write "a + b" as "+(a, b)" instead. And then there's no more order of operations, and no problem:
    +(2, *(2, 2)) --> 6
    *(2, +(2, 2)) --> 8
    Easy as pie. Order of operations just goes away in a puff of logic.

    In fact, if we taught kids to write the four simplest arithmetic operations this way from the get go, then moving on to f(x, y) or g(x) in algebra would be much easier for students. The progression is much more straightforward: First you gave names to the numbers by saying things like "3 = +(2, x)" and you had to figure out that x is 1. Then you start giving names to the functions themselves, and you get to figure out, for "3 = f(2, 1)", which of +, -, *, / might f be?

    Another choice is postfix, or "reverse polish" notation:
    2 2 * 2 + --> 6
    2 2 + 2 * --> 8
    Again there is no ambiguity, no need for order of operations, etc. You just do things from left to right. Much easier than learning PEMDAS.

    Math is more about the language of the world and the structure we can find in it, and the power to name and describe things rigorously so as to get power over them. It's sad, in my view, that we stick with a way of writing math that makes things actively harder for kids to learn, and actively harder for adults to use, just because it's the way we've always done it.

    ReplyDelete
  4. Gregory Marton It's no different than any other language, really. Languages have rules. PEMDAS is merely a set of rules to interpret what's written. Could we devise simpler rules? Yes, we could, but PEMDAS seems simple enough already.

    ReplyDelete
  5. Craig Froehle The simplest rules are no rules at all, and those are super easy to achieve, and make the world better for everyone. Perhaps read what I wrote?

    ReplyDelete
  6. "The simplest rules are no rules at all, and those are super easy to achieve, and make the world better for everyone. Perhaps read what I wrote?"

    Gregory Marton​ you still need rules to parse your examples. Just because you think your system is easy does not negate the fact that it actually does require rules, too.

    Give "+(2, *(2, 2))" to a random set of people and ask them to complete it without explanation. I am willing to bet they'll need an explanation of the rules for parsing your syntax. Your syntax may leave less room for ambiguity, but it still requires rules.

    ReplyDelete
  7. Sean M No rules for order of operations. Yes, every language has rules especially artificial languages like math. Order of operations is pointless though — an artifact of a historical convenience.

    ReplyDelete
  8. I had to watch this animation twice before I realised why she was wrong. Mathematics has never been my thing.

    ReplyDelete
  9. Gregory Marton Even your examples require rules that guide how people interpret the notation. For example:

    +(2, *(2, 2))

    I might interpret that as "add up two sets of 2 * 2" and that equals 8. Unless you tell me that parentheses indicate groupings, they're open to various interpretations. 

    Postfix is easier, yes, but you still have to guide interpretation with rules:

    2 2 * 2 +

    If they don't know postfix notation, someone could interpret that to mean "22 times 2 + zero," which equals 44.

    Every notation, be it a human language or math or computer code, requires rules to interpret it. We can discuss the merits of simpler rule sets (e.g., postfix), but they're still rule sets.

    ReplyDelete
  10. Craig Froehle asked by Sean M and acknowledged there. Yes, "no rules" was meant to be restricted to "no rules for order of operations", which is plenty win enough. The rules for parsing prefix as suggested are the same rules as those for parsing f(x) or sin(x), so nothing new there.

    A more meaningful critique of my rant appeared on my reshare:
    "while your rant is totally correct, it is probably a much smaller factor in kids not successfully learning later concepts than many other things (underfed/funded/staffed/etc schools, the societal belief that math is hard, etc)"

    ReplyDelete
  11. I'm all for prefix and postfix, but there are reasons we use infix. Consider:

    y = mxz + b

    y = +(((m,x),z),b)

    y = mx*z*b+

    Prefix notation with parentheses is clunky; essentially, it's death by a thousand parentheses, or as we call it in the business, LISP.

    With either prefix or postfix notation, the "mxz" gets broken up, although I suppose that we could allow an n-ary prefix notation:

    y = +(*(m,x,z),b)

    Even so, the fact that the "mxz" is added to "b" seems obscured by having the operation so far away. I can only imagine that it scales even more poorly.

    ReplyDelete
  12. Steve S then why do we use infix only for simple arithmetic operations?

    I wish I could use a code font here, but of course we tend to use whitespace to solve the problem you pose for other functions. Why not for the simple ones?

        y = +(*(m, x, z),
                 b)

    You're more used to reading infix for math, so it's easier for you, but the extra work from order of operations is well lampooned in the gif at top. It's much harder than arranging the math on the page to be readable.

    Scaling: the way math and code are both meant to scale is by naming components:
    u = *(m, x, z)
    y = +(u, b)

    Order of operations / operator precedence / infix is primarily harmful to readability and to math learnability at this level. 

    Note: I'm explicitly not complaining about the equality / assignment operator. I'm also not complaining about oop style, which is another kind of infix. I'm saying this ugly wart of math orthography should stay out of first through sixth grade. I'd like kids to be able to see the beauty of math, the power of naming. That's tough until you at least learn to ignore junk like order of operations.

    ReplyDelete
  13. Gregory Marton The answers to these why questions are invariably complex and mired in history. Why do we use QUERTY keyboards? Well, it's not that they're ideal, just that they won out. Why are some ops infix and others not? Ditto.

    Not all notations are equally good, and not all are equally good for the same things. I'd argue that dx/dy is generally a better notation than f', yet it's the latter that we typically get taught first. We also get taught × as an explicit operator and learn implicit multiplication later. Same for ÷.

    So maybe there are two issues. The first is which of the many notations is best when solving real problems. The second is which is best for teaching.

    I'm not sure that the one-time cost of learning order of infix operations is so terrible, frankly. The video cheats because it's time-constrained and intentionally puts the lower-precedence op first.

    ReplyDelete
  14. Steve S yes, much of standard math notation is absolutely terrible, including implicit multiplication and prime as differentiation. 

    I actually remember being super confused when I saw "cos(90)" on my older sister's homework. I had just learned implicit multiplication, and I was wondering how you could solve that without knowing the values for c, o, and s. What a crock!

    The very fact that math tends to use single letters in various alphabets rather than, you know, words, makes many things much harder to read than they need to be. When I'm reading technical papers these days, I'm constantly frustrated that I'm not sure how to pronounce many of the formulae or their components, so I find it hard to have discussions about them with others in the room, and I'm constantly embarrassed by not realizing that a particular notation went with a name that I otherwise knew.

    People have actually thought about pedagogy and notation. One of the clearest examples I know is "Structure and Interpretation of Classical Mechanics" by Sussman and Wisdom. Take a look and see if some of the stuff you may have learned in college physics isn't a whole ton clearer there, or at least a whole lot clearer than the corresponding section of any other mechanics text.
    http://www.fisica.net/mecanicaclassica/struture_and_interpretation_of_classical_mechanics_by_gerald_jay_sussman.pdf

    I don't think the problem-solving notation and the teaching notation need to be separate. In many cases, certainly the most esoteric cases, it's best if they're the same, otherwise you have the overhead of using multiple languages. No, I know it's utopian, but let's stop teaching infix plus, or switch to teaching it in functional notation at around the time we might consider introducing PEMDAS, because it's just cleaner. "2 + 2 * 2" should just be undefined.

    Re "cheating" by putting the lower-precedence operator first, I think Paul Fisher and Randall Munroe hit the nail on the head. 

    Having arbitrary operator precedence at all is what enables the conflict with left precedence, for no apparent gain, so I'm choosing to blame the language purveyors rather than the game-show creators, and least of all the unhappy contestant.

    ReplyDelete
  15. Gregory Marton

    1) I suspect that, for problem-solving, we want to use whatever notation is most appropriate, which means knowing a few and being able to select based on cost/benefit analysis, or even coming up with novel ones as needed. (I suspect that automatic translation tools would be helpful here.) For education, it would be better if we picked one that had the right properties for that role, which could then be used fairly consistently.

    Back in the day, there was an attempt to teach simplified algebra a year before regular algebra was on the curriculum. The simplified method was, in fact, too simple, as it only worked for a narrow subset of problems. Worse, when students had to learn the full methods, there was a lot of confusion and expensive unlearning.

    I'll add that the presence of computers really changes things. It is now awkward to write up many traditional notations, requiring special tools that are themselves non-trivial to learn. For scientific notation, I long ago switched from 2.99 x 10^8 m/s (except with actual superscript instead of the caret) to 2.99E8. It's not only more compact and easier to render, it's how computers do things.

    2) I don't want to prematurely commit to anything, and in particular, I'm not willing to sign on to the idea of a perfect system.

    For example, I'm not sure whether implicit multiplication is actually a bad thing. I don't have years of experience doing it both ways. In fact, I'm not sure what the other way is. Prefix? Postfix? Infix with mandatory parentheses? Spelled out operations instead of symbols?

    I can easily make a case for any of these, complete with pluses and minuses. Which one is best would depend on which attributes are more important in a given context.

    It may well be that this notation is inconsistent and systematically impure, but handy. A lot of things are like that.

    3) I'm going to politely avoid commenting on physics, because it's been too long for me and it's a bit out of scope.

    4) If you want to argue that the root cause of the puzzle's success is that infix required precedence, fine. But the proximate cause here is that they intentionally placed the operations in the reverse of precedence.

    ReplyDelete
  16. Adam Liss​ - but mostly for the comments :D

    ReplyDelete
  17. BTW, what idiot decided that "scientific notation" should hide the most significant digit in the middle of the string, just on the other side of the E from the least significant digit? How about if 2.34 x 10^56 were 56_e_2.34?

    Quick, which one is bigger? 
    3.1231e1341 or 8.0923e922 ?

    Quick, which one is bigger? 
    1,341_e_3.1231 or 922_e_8.0923?
     
    Last gripe Steve S. I'm gonna stop whining about bad notation I can't change now.

    ReplyDelete
  18. Simon B​: I hate you. :-\

    P.S. RPN FTW!

    ReplyDelete
  19. Gregory Marton Well, nothing stops you from making a new scientific notation, where 2.99E8 is rendered as 8S2.99.

    ReplyDelete
  20. Steve S working on it, as it happens. This is an active user interface choice we're exploring as we display very very small probabilities.

    ReplyDelete
  21. Gregory Marton I've always hated scientific notation for that very reason.

    ReplyDelete

Now I'm doubly intrigued!

Now I'm doubly intrigued!