"AP (lambda) calculus" in the comics
« previous post | next post »
Blondie for 10/3/2013:
I believe that this is the first time that the lambda calculus has ever been featured in a popular comic strip.
"Beta reduction" is really a thing, and
λx.x2 + 2
is really a way to represent the function
f(x) = x2 + 2
in the lambda calculus.
But the strip's author probably meant "lambda abstraction" rather than "lambda extraction" — the latter term seems to be used only by linguists talking about relative clauses and similar things.
And anyhow, it would be surprising (though gratifying) to see a high-school "AP calculus and physics" course using the lambda calculus at all. The relevant concepts originated in the 1920s in the study of functions as rules by mathematical logicians, and the notation was first used (I think) by Alonzo Church in “A set of postulates for the foundation of logic”, Annals of Mathematics, 1932.
There's no substantive connection between the lambda calculus and the techniques for the mathematical study of change developed by Newton and Leibnitz — the terminological overlap arises because the basic meaning of calculus is just "a system or method of calculation", as the OED puts it, with relevant examples like these:
1796 C. Hutton Math. & Philos. Dict. I. 234 We say the Arithmetical or Numeral Calculus, the Algebraical Calculus, the Differential Calculus, the Exponential Calculus, the Fluxional Calculus, the Integral Calculus, the Literal or Symbolical Calculus, etc…Algebraical, Literal or Symbolical Calculus is..the same with algebra.
. . . except there's the cover of Sussman & Wisdom's Structure and Interpretation of Classical Mechanics, where Newton's prism analyzes sunlight into the glyph lambda rather than into a spectrum, for reasons hinted at in this review, mainly the fact that lambda expressions are used in the programming language Scheme . . . [and of course the cover of this more famous book]
So how did the lambda calculus migrate from formal logic to Alexander's "AP calculus and physics" homework?
Maybe the strip's authors remembered that integration by reduction was an especially annoying feature of some long-ago calculus course, and figured that it would be good to throw in a greek letter or two, and so searched the web for something like {calculus reduction beta}? Or maybe one of them once encountered the Sussman & Wisdom book?
Sili said,
October 9, 2013 @ 5:11 am
Or maybe they just have nerdy friends.
Jason said,
October 9, 2013 @ 5:57 am
People on Reddit think the authors simply googled "calculus" and incorrectly cribbed from a page on lambda calculus instead of differential calculus. I guess we can't exclude the possibility that one of the authors was a math, computer science or philosophy major, but "lambda extraction" for "abstraction" would seem to militate against it.
[(myl) The "googled 'calculus'" theory is not very plausible — a verbatim search for "calculus" does not show any sign of the lambda calculus on the first five pages of returns, and the same is true for me using standard Google search, though I'm quite likely to have been reading or writing search-personalizing things that might predispose Google to zero in on formal logic rather than on differentials and integrals. But throwing in a word like "reduction" changes that.]
And anyhow, it would be surprising (though gratifying) to see a high-school "AP calculus and physics" course using the lambda calculus at all.
As someone who has successfully managed to forget nearly everything he used to know about his brief and traumatic introduction to lambda calculus, I think this would be a guaranteed way of completely discouraging just about everyone thinking about enrolling in tertiary physics unless everyone in your class is a clone of Richard Feynman. Or better yet, Hermann Weyl. Even at AP level, it'd dwarf the controversy over "new math."
[(myl) Well, killing off calculus as a gateway subject would probably be a Good Thing anyhow, as I've argued e.g. here:
Unfortunately, the current mathematical curriculum […] mostly teaches things that people don't really need to know, like calculus, while leaving out almost all of the things that they will really be able to use. (In this respect, the role of college calculus seems to me rather like the role of Latin and Greek in 19th-century education: it's almost entirely useless to most of the students who are forced to learn it, and its main function is as a social and intellectual gatekeeper, passing through just those students who are willing and able to learn to perform a prescribed set of complex and meaningless rituals.)
But you're right, adding lambdas to the mix would probably just make students hate mathematics even more than they (on average) do now.]
AntC said,
October 9, 2013 @ 6:22 am
@Jason traumatic?
It's the most elegant calculus I've come across. Beats the Turing machine into a cocked hat.
This cartoon has already done the rounds of programming blos.
Never mind Scheme, Mark should mention Haskell [*] — named for a logician who later studied grammar. [nerdview]
Perhaps Barbara Partee could explain?
[*] http://en.wikipedia.org/wiki/Haskell_(programming_language)
[(myl) Haskell had its turn a couple of weeks ago: "X combines the P of Q with the R of Q", 9/28/2013. Never mind obfuscating the differential and integral calculus — using Haskell, it would be possible to make younger students refuse to learn to count. Elegance is not always appreciated.]
Yuval said,
October 9, 2013 @ 7:08 am
Um, surely the SICM cover is more-than-a-nod at the cover of Sussman's SICP (as well as the name)?
Did I miss an explicit mention of this in the post? Or was it left as an exercise to the reader?
[(myl) The latter.]
Mark Dunan said,
October 9, 2013 @ 7:34 am
That number "2", with its wavy base, really stands out. And it reminds me of just how rarely you see written numerals in non-tech-related comic strips.
Jerry Friedman said,
October 9, 2013 @ 8:56 am
I like the "nerdy friends" theory. The authors might have asked somebody for some math that would be real but widely incomprehensible and would be easy to letter in a small space, and their friend was amused to offer a sample of the lambda calculus (which I know nothing about but the name).
Dennis Paul Himes said,
October 9, 2013 @ 9:32 am
I can remember, from my college days, zero order logic being referred to as Propositional Calculus, and first order logic as Predicate Calculus. My college days being in the 1970s.
Andrew (not the same one) said,
October 9, 2013 @ 9:48 am
Yes, there are actually quite a few calculi (there's also the Hedonic Calculus of utilitarianism). It would be interesting to know how the name came to be associated especially with the differential calculus.
KeithB said,
October 9, 2013 @ 10:19 am
My wife took a great math class in college for liberal studies. It was basically practical math. It covered probablity, combinations and amortization calculations including things like APR.
I really wanted her to keep the book as a reference, but she hated the class so much she sold the book.
One reason for calculus in college is that it is really needed for some science classes. You can take the high-school approach and avoid calculus, but it really involves a lot of handwaving.
Rosie Redfield said,
October 9, 2013 @ 1:08 pm
"…needed for some science classes." That's not a very good reason for forcing all science majors to learn it, and infusing most of them with a lifetime distaste for math. Surely we could teach useful math to everyone, and specialized math only to those who genuinely need it.
Layra said,
October 9, 2013 @ 1:32 pm
Are we absolutely sure this was a mistake on the author's part? I honestly find the AP calculus to lambda calculus mixup funnier than the apparently intended joke.
Ted Powell said,
October 9, 2013 @ 1:53 pm
Python is another language with lambda:
In [1]: f = lambda x : x**2 + 2
In [2]: f(5)
Out[2]: 27
In [3]:
TonyK said,
October 9, 2013 @ 2:41 pm
"It covered probablity, combinations and amortization calculations including things like APR."
If that is what I had been taught instead of calculus, I would have given up mathematics at the age of fifteen. What a joyless, uninspiring list! Calculus is beautiful. It's also extremely useful, but that's just a spin-off.
[(myl) Agreed on the beauty. And usefulness in certain areas, yes — but for most working biologists, psychologists, neuroscientists, sociologists, doctors, computer scientists, etc., not so much. Linear algebra is equally beautiful, at least when properly taught, and is much more useful in most areas of modern science. For example, I've asked several hundred MDs (both clinical and research) whether they ever used calculus after the end of their undergraduate calculus (or post-calculus physics) course, and I've never gotten a single convincing positive response.]
D.O. said,
October 9, 2013 @ 3:59 pm
If there is λ calculus there should also be λ physics. Well, some of it is actually Λ physics, but never mind.
J. W. Brewer said,
October 9, 2013 @ 5:07 pm
Calculus has arguably been less practical use to me in my adult life then Latin and Greek (which have been useful only intermittently), but I'm glad I took all three in my youth. I suppose I don't support the revival of mandatory Latin/Greek instruction for liberal arts majors, but it's certainly not clear to me what classes with greater "value" (whether in beauty terms or utility terms) are on average being taken instead, or would be squeezed out at the margin in the unlikely event of a revival of the older practice. As I may have said before, I do regret never having taken a decent statistics class, but when I try to figure out in hindsight what classes I should have known going in would be wastes of time that I could have skipped in order to have room for statistics I tend to assume that 19-or-20-year-old me would just have filled the vacuum with Sanskrit or something like that.
Whether it was a a good idea for my university to award B.A.'s in linguistics without requiring taking a single class involving even rudimentary exposure to the sorts of mathematical/quantitative techniques that may be quite useful in collecting/organizing/analyzing/understanding linguistic data (you had to fulfill the university-wide STEM requirement, which was quite minimal, but the Ling Dep't certainly didn't ask for anything beyond that) seems dubious in hindsight, but that was the way it was and for all I know the way it still may be.
Daniel Barkalow said,
October 9, 2013 @ 5:35 pm
Referring to material not normally taught in high school as "AP (subject)" reminds me of the door at MIT marked "AP French", wherein you might learn about Special Relativity or Quantum Physics from the professor emeritus whose name that is.
I like the idea that Dagwood was prepared to help with differential or integral calculus, and was only confused by the actual material in question.
Jerry Friedman said,
October 9, 2013 @ 6:07 pm
TonyK: There are, of course, millions of people who gave up math in their teens and were in the usual algebra-geometry-trig-calculus sequence, which they found joyless or worse. Some of them might well have had more interest (no pun intended) in probability and amortization. It would be nice if people could take the kinds of math that are likely to be interesting and useful to them. And I say this as someone who finds calculus beautiful and teaches calculus-based freshman physics.
I'd say the requirement that American doctors to take calculus and non-calculus physics shows that something is wrong.
By the way, Harvard Medical School is changing its admission requirements to emphasize calculus less and statistics more.
Kevin McCready said,
October 9, 2013 @ 11:04 pm
LISP has lambda too. I was hoping the wonderfully nerdy and funny xkcd would have had a lambda cartoon earlier than this, but no.
http://www.explainxkcd.com/wiki/index.php?title=224:_Lisp
BTW BTW BTW can someone please email me how, on twitter, to follow only the languagelog poster I want to follow, instead of getting all the tweets for all the posters?
kevin 1 mccready at gmail dot come
Wesley Kerfoot said,
October 10, 2013 @ 12:59 am
I'm looking forward to the day when the SKI combinator calculus is in a comic, oh wait, that happened: http://ro-che.info/ccc/08
Barbara Partee said,
October 10, 2013 @ 1:19 am
I don't know what AntC hoped I could explain — I think Mark explained everything just fine. I would only amend his original statement of the origins of the lambda calculus by saying that SOME of the relevant concepts arose in the 1920's, but it was definitely Alonzo Church who invented the lambda calculus, in the 1932 paper that Mark cited.
I'm definitely among those who were taught more calculus than was welcome. At my small college math majors studied almost exclusively calculus; I was a renegade in not taking complex variables in my last semester and taking probability instead. I got virtually no discrete math in college, to my great regret. Of the stuff in the Partee, ter Meulen and Wall textbook on math for linguists, I think only the algebra section corresponds to anything I learned as an undergraduate; the rest I got in graduate school.
AntC said,
October 10, 2013 @ 3:04 am
Hi Barbara,
I thought you might draw the arc from Lambda calculus (indeed, Church) through its variant Combinatory Logic (Schonfinkel 1924 and Haskell Curry 1927 are I guess who you have in mind in the 1920's, also perhaps Polish notation Lukasiewicz 1924) to Categorial Grammar (Lambek) to Montague to yourself and to NZ's own Max Cresswell who pretty much re-introduced lambda calculus 'undiluted' in NL semantics.
All "motivated by the principle of compositionality", as one of the wikipedia nodes on that arc puts it.
dainichi said,
October 10, 2013 @ 10:02 am
Wow, I always thought that "lambda calculus" without "the" was the only option, but searching on the web, I see that "the lambda calculus" is also common. I wonder how I could have missed that for this long.
Jason said,
October 10, 2013 @ 12:00 pm
@Jerry Friedman
By the way, Harvard Medical School is changing its admission requirements to emphasize calculus less and statistics more.
But how then can we prevent the embarrassment of Tai's model?.
Seriously, though, I agree that doctors need inferential and bayesian statistics a hell of a lot more than they need calculus.
@Ted Powell
Python is another language with lambda:
As this is language log, not computer science log, I won't launch into an extended discussion, but Python lacks most other features of functional language, for example currying, pattern matching, and a rich library of the standard functional operations on lists (map, reduce, filter, fold, etc.)
There are hardcore functional languages (Haskell, and maybe Erlang) that enforce functional style and semantics through and through (no mutable variables, no imperative control structures,) and softcore languages (LISP, Scala, F#) that are built around functional idioms but are happy to support other styles of programming. Having a token lambda construct (Python, Smalltalk, Objective-C etc.) does not the lambda calculus make.
AEM said,
October 10, 2013 @ 1:52 pm
@Jason
"Python lacks most other features of functional language, for example currying, pattern matching, and a rich library of the standard functional operations on lists (map, reduce, filter, fold, etc.)"
As a side note, I would like to mention that Python does in fact have currying (called partial) and map, reduce, filter, etc.. (Many functional features are just hidden in the functools and itertools modules.)
I certainly doesn't enforce functional style, though.
Jussi Piitulainen said,
October 10, 2013 @ 2:34 pm
Jason, you are seriously under-informed about Python. I, too, wish to respect the scope of the log, so I say just this: the information about partial, map, reduce, filter, first class functions, conditional expressions, and more in Python is not hard to find; some of the stuff is in the standard functools library; generators and comprehension expressions are stateful but relevant.
Wesley Kerfoot said,
October 10, 2013 @ 4:08 pm
@AEM, python's partial is not the same thing as currying because it does not actually transform a multi-parameter function into functions that each take 1 parameter and return new functions (E.g "lamba a,b: a+b" becomes "lambda a: lambda b: a+b"). All it does is fix one of the arguments.
AEM said,
October 10, 2013 @ 4:26 pm
@Wesley Kerfoot
My mistake. Apparently, this confusion between currying and partial function application is common: http://www.uncarved.com/blog/not_currying.mrk
(And I will now stop discussing programming.)
Barbara Partee said,
October 10, 2013 @ 4:46 pm
Thanks, AntC. Well, you've said it all in a nutshell, I think.
There are nice comments on the history of the lambda calculus by Dana Scott, ACM A.M. Turing Laureate, during the ACM A.M. Turing Centenary. Here are the slides: turing100.acm.org/lambda_calculus_timeline.pdf . And here are two different youtubes of the corresponding lecture. One is 53 minutes, at Princeton: http://www.youtube.com/watch?v=7cPtCpyBPNI , and the other is at the ACM meeting: http://www.youtube.com/watch?v=7cPtCpyBPNI . Dana Scott is always a pleasure to listen to, and there's a lot in the lectures about key people and about interesting ideas and results.
Yet Another John said,
October 11, 2013 @ 7:00 am
Actually it's not such a crazy idea to teach lambda notation in AP (Differential) Calculus (at least the basic concepts, probably not the deductive calculus and the Curry-Howard isomorphism…). Like set theory, it's something that offers useful notation and clarifying generalizations even if you don't delve into it too deeply.
Too many students at that level confuse the concept of "function" with an algebraic expression like "x^2 + 2x", which usually doesn't cause big trouble until they get to multivariable calculus. But already in 1-variable calculus you have the "dx" notation in definite and indefinite integrals, which (in this context) really functions as an abstraction operator.
Carl Offner said,
October 11, 2013 @ 4:30 pm
@Yet Another John: It's certainly true that practically all students at the first-year calculus level think that a function is an expression. Mathematicians through the 1800's basically viewed things this way as well. And in fact, the notion of a function is a remarkably sophisticated one which really takes some getting used to.
For a very simple example, most students that I see don't believe that a step function is a function. But I don't see how expressing it as a lambda expression would clarify anything.
Jussi Piitulainen said,
October 12, 2013 @ 2:35 am
@Carl Offner, I think I know what Yet Another John means. I have used lambda privately for just that. It's not the nature of the step function it clarifies, it's notions like summation, integration, differentiation where some variable is bound: the binding can be delegated to a lambda, and then the operator is applied to an explicit function.
I've written summation operators in Scheme like this. Numerical integration is analogous except not trivial to implement even approximately, as far as I know.
(sum 0 n (lambda (k) (floor k))
(integral 1 (exp 1) (lambda (x) (floor x))
Those two can actually be eta-reduced even in Scheme (and I realize now that flooring an integer is a silly thing to do).
(sum 0 n floor)
(integral 1 (exp 1) floor)
I think variations of this exercise have clarified mathematical notions and notations to me. The comic resonates.
Circe said,
October 12, 2013 @ 4:45 am
MYL said:
And I have never found any convincing use (and I am willing to bet that neither have those MDs) of Shakespeare's The Tempest that was plonked down my throat in high school. On the other hand, it is hard to imagine if there was anything I learnt in high school that has turned out to be more useful for me than the differential and integral calculus.
I agree that the method calculus is often taught, it looks like a meaningless set of rituals ("here is a list of derivatives, here is a list of integrals"). But what calculus represents is one of the crowning mathematical achievements of humankind in that it systematizes the study of continuous rates of changes. For me, an ideal introductory calculus course would ensure that students leave with a good understanding of the intermediate value property, Rolle's theorem, and Fermat's theorem on stationary points, along with a thorough understanding of what derivatives and integrals mean. As for the rest, there is always Mathematica (or Maple, or Maxima, or Sage…).
Carl Offner said,
October 12, 2013 @ 2:20 pm
@Jussi Piitulainen: Well yes, the issue of bound versus unbound variables is also something that can be mysterious to students. In my experience, however, it's something that is nowhere near as mysterious as the notion of function. And it's not really clear to me that formalizing it — via lambda expressions, for instance — would really help much.
But I could well be wrong. One thing I have found is that different people have different ways they like to explain things, and different ways that work for them. And if this is a convenient way for you (or anyone else) to explain bound vs. unbound variables and their uses, then I don't see how anyone can argue with that. There's no royal road (or better: unique road) to teaching, or to explanation.
Graeme said,
October 16, 2013 @ 7:09 am
Or perhaps we could teach things like the origin of zero, Cantor's levels of infinity, series as patterns? In other words maths as a creative and enriching discipline. Rather than the godforsaken 'utility' vs ' technicality' debate here.
It never ceases to amaze me (pure maths being my first degree, tho I'm now a law prof) how maths is taught in a deconstructed way, akin to teaching English either as just a set of phonemes, or as just a device for basic communication.