6 ms·
I think programmers reaction to the mathematics in SICP is completely hysterical - in the sense of hysteria, not comedy. For example, the author-professors who
by earthicus 8y ago
I think programmers reaction to the mathematics in SICP is completely hysterical - in the sense of hysteria, not comedy. For example, the author-professors who wrote HTDP, quoted at length in this article complain about using 'complex domain knowledge' and the author of the blog post does as well, but the running example used is literally arithmetic. In particular:
Section 2.1 starts by building a data type of rational numbers, then extends it to interval arithmetic In section 2.4 this is extended to Complex numbers, which also adds the complication of multiple representations of a data type (rectangular vs polar). In section 2.5 these are unified with a generic arithmetic package. Which is finally extended to operate on symbolic polynomials, creating a symbolic algebra system.
So you can see, the authors complain about 'domain knowledge', but the example was surely chosen precisely because everyone already understands these relationships so well! It's a relatively nontrivial example, technically simple but structurally complex, that everyone already understands intuitively, so that you can get right to work thinking about data abstraction techniques - and in this example we go all the way from introducing the notion of an 'abstraction barrier' for the first time, to data-directed programming & message passing!
-----
The other mathematical section is 2.3, which is the infamous calculus section. Again the reaction is completely over the top - there's no 'deep dive', you don't need a 'solid foundation' in calculus, etc. The appearance of calculus is no more than implementing a couple of symbolic transformations of data, and all 4 of the rules are provided for you. You don't actually use calculus to do anything, so that if you don't know calculus, you can still write the program, it'll just be a bit more boring not knowing what it means. This section of the book is like 5 pages long, out of a 500 page book, but it's all we hear about...
- jules 8y ago"already understands these relationships so well" Is that true for complex numbers?
- ahuth 8y agoPerhaps the thing people potentially already understand well is the arithmetic?
- earthicus 8y agoComplex numbers as 'cyclic numbers' is not widely understood. What is understood is how they fit into the arithmetic 'hierarchy': how the real numbers embed into the real axis, and how the operational rules for addition and multiplication work. However SICP also asks us to implement the polar form of C to illustrate multiple representations of the same data type, so I have to admit that part might require some additional explanation for many students.
- deleted 8y ago[deleted]
- ahuth 8y agoI agree. Currently working through the book in Javascript [1], and there isn't a crazy amount of math. Newton's method in the first chapter was a little rough for me, but after that it's much more about exploring ways of representing data. (At least so far... I'm almost through chapter 2). 1. https://github.com/ahuth/sicp https://github.com/ahuth/sicp
- deleted 8y ago[deleted]
- emmelaich 8y agoFor me it wasn't the maths in SICP, it was the physics, or rather the particular examples in the chosen domain. I love physics but coding Newton-Raphson does not engage me. (I had a similar reaction to particular Python book -- Roman numeral conversion? blah!)
- earthicus 8y agoThe motivation for using that example in particular is, I believe, that it's computing a fixed point - which is an idea that came up several times in the course in increasingly general settings. First you do the concrete example of newton's method, then do a more general fixed-point (higher order) function, and a more general newton's method. Later on the Y-combinator is presented as computing the fixed point of an (finite) iteratively defined function - the fixed point returned is the full recursive function. Lastly when talking about programming languages, and interpreter computes a fixed point. The scheme language is the fixed point of the scheme meta-circular evaluator.
- emmelaich 8y agoOK, that's interesting. I should go back to it. But it would be good to hint about it's relationship to later material. Perhaps it's the timing/context; I had an very odd lecturer for numerical methods.
- earthicus 8y agoThe first genralization is in section 1.3.3 and 1.3.4 https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book-Z-H-12.html#%_sec_1.3.3 https://mitpress.mit.edu/sites/default/files/sicp/full-text/... Unfortunately I couldn't find the material about interpreters - my memory of it is them discussing it in the lectures so perhaps it never actually made it in the book, or was only in the 1st edition. Those lectures are available on youtube if you want to find it.
- dan-robertson 8y agoI basically disagree. In my opinion, the main mathematical requirement of the book is not knowing how to add fractions and such, but a reasonable amount of mathematical maturity, and many people reading the book will not have this. When I say mathematical maturity, I mean the kind of basic “real” mathematics that is normally taught only at universities, specifically the idea of what a proof is, what one looks like, how to write one, how to read definitions, and some idea of how one might analyse a problem and work towards its solution. For example, exercise 1.10 defines the Ackerman function and asks some questions about it. The Ackerman function does not fit the model of any function one might typically encounter in mathematics before this course, it’s definition is hard to reason about, and solving the exercise requires understanding certain cases of the Ackerman function (and not trying to figure it out all at once) and also having a good understanding of various mathematical operations (e.g. +, *, ^, which seems simple but spotting the pattern might not be so easy). Exercise 1.13 is about proving a closed form for fib(n) which requires a reasonable amount of mathematics and no programming whatsoever. Thankfully the hint gives one some kind of clue as to how to solve it or I think many would find the mathematical bar too high. Immediately following this is a chapter introducing orders of growth (big-O and friends) which is fine for anyone with a decent background in mathematics or computer science but one must remember that there is a difference between the abstract manipulation of symbols and vague graph-sketching one does in school (e.g. e^x is flat and then shoots up a bit past 0, x^2 shoots up either side of zero, x^3 goes up on the right and down on the left ...) and having a good understanding of how these functions behave and compare. Exercise 1.19 essentially requires a careful and correct analysis of the Fibonacci sequence (thankfully there are lots of hints) to derive a logarithmic algorithm for computing fib(n). This is essentially the “matrix exponentiation method” except that the matrix is hidden in three variables. I think it is silly to say that all you need is to be able to understand arithmetic to solve these. I think the book is fine for a course that happens after (or possibly concurrently with) a first course in real mathematics. It is probably less useful if one is lacking in the mathematical background required, and I think it is reasonable for people studying a “first course in computer science” to not have this mathematical background.