1059 points · by lainon · 9y ago · 153 comments
Lucky I saw this!!
I do have one reservation though -- many of our students come in with a weaker mathematical background than MIT students; for example we spent several weeks doing proofs by induction (and no other kinds of proofs) and this text doesn't seem to feature a couple of weeks worth of examples.
I think I'll probably go with this and supplement as needed. Really it looks quite wonderful. (And hell, the book seems to be open source which would mean that I could potentially write supplmentary material directly into the book and make my version available publicly as well.)
This thread seems like a particularly good place to solicit advice: experiences with this book or others, what you wished you'd learned in your own undergraduate course on this subject, etc. I've taught this course once before -- I feel I did quite well but I still have room to improve. Thanks!
[1] https://www.amazon.com/Discrete-Mathematics-Applications-Sus...
https://sites.google.com/site/mathematicalreasoning3ed/
http://www.math.vt.edu/people/day/ProofsBook/
http://giam.southernct.edu/GIAM/
For anybody looking for freely available maths related texts online, three great resources are:
http://aimath.org/textbooks/approved-textbooks/
http://web.archive.org/web/20170126161813/http://people.math...
For proofs, you can find the free Book of Proof online [0]. It includes solutions to the odd exercises.
Velleman's How to Prove It is also a great text, though not free.
Regarding math pedagogy, I think this post might prove useful [1].
[0] http://www.people.vcu.edu/~rhammack/BookOfProof/
[1] https://bentilly.blogspot.com/2009/09/teaching-linear-algebr...
That was one of the high points of the college I went to, and I sure as hell did not take it for granted.
Yes, these are the terms of the license:
https://creativecommons.org/licenses/by-sa/3.0/legalcode
Webpage for the course is here: https://learning-modules.mit.edu/class/index.html?uuid=/cour...
That page includes an email contact for the course; (6042-gradesmaster@mit.edu). If you're planning to release an edit, I'd reach out as soon as possible to give them time to get back to you on if they'd be interested in working with you and the best way to do so, since you posting it randomly somewhere on the net would likely do less good in my opinion, but would be a huge help if done with them.
I found it highly accessible and fun to work through. The concepts are all well-explained and I don't recall anything that would be out of reach for someone with some probability and foundations in classical logic. If they are at discrete math, this book is well withing their reach.
It doesn't teach hard math per se, but how to think in a mathematical way, showing how to break apparently diabolical problems into manageable pieces, and how to reconsider the perspective of the problem, if that makes sense. The book is among the most mind-expanding books I've ever read.
I'm fully autodidact and far from MIT pedigree.
The book is terrific, and wonderful that it is available under a CC license. Most students found it accessible. We covered about Chapters 1-8 (and some things not in the book). (This is only the first part of the book, so a much slower pace than the MIT course. Some of this is to have more time for additional background and to go in depth in things, but also that our courses are scheduled with about 2/3 the amount of time per class as an MIT course is.
>"Previously I used Epp's book [1] which in my opinion is an outstanding book but regrettably is $280.44."
This is extortionate. What is the justification for a book being priced at nearly $300? This is one book of how many a student will need that semester? Are school's getting a piece of this as well? Is this why such a racket is permitted?
Sorry I know its tangential to your original comment but I would be curios to hear anyone's feedback, especially someone from Europe or elsewhere. I wonder if this pricing is specific to the U.S.
That is a bit high for textbooks, most textbooks are usually "only" in the realm of $80-160. That said, math textbooks are usually far more expensive than others.
The excuse given for high prices is that there is a strong used book market for college textbooks, as most students sell off their textbooks at the end of the semester, so from the point of view of the publisher, they see only one sale in 5-20. Of course, publishers discovered that the "cure" for this is to release new editions of textbooks with minor updates (most importantly, reorder the questions in the question banks!) every few years to kill off the used textbook market and haven't lowered their exorbitant prices to compensate.
As an undergrad, I did have one semester where my total book costs were about $1000. Most of the semesters, they were more like $500.
Oh, and the prices usually go to lining the publishers' pockets. Not the authors', not the schools'.
For a math book like this, I'd guess they spent more like a million getting it done. I wouldn't be surprised if it was $50-100K just for the typesetting.
Right, and couldn't they make up for this by issuing e-Textbooks with lower prices that would much higher volume in terms of sales?
Also I believe the book stores themselves are in this farce, as large percentage of the bookstores are not run by the schools but private companies such as Barnes and Noble and Follet[1]. So they are making out in this scheme as well.
[1]http://www.businessinsider.com/textbook-publishers-going-aft...
It's a product of a capitalist, for-profit producer. The justift for its price is that the market will bear it.
So I don't think your "this is just how capitalism works" argument holds much credibility here.
I knew prices were "high", but good grief! I guess I really am out of touch.
Glad I held onto my vintage copy. Don't imagine the intervening 20-ish years have added circa $200 (at a guess) of value to the latest edition.
Throughout most of my semesters I just rented the books. Much cheaper than buying.
University text books should be material to get back to later in life, when confronted with a related problem. Part of university education should be a complete book shelf of well-understood books.
This just exemplifies the new nature of university education: An ephemeral experience where the most durable result is debt /cynisism.
The other perspective is that if tuition is many thousands of dollars a year, then the cost may be not that dramatic.
Maybe this would be a better first couple of weeks introduction:
http://bookboon.com/en/gentle-introduction-to-mathematics-fo...
More information about BookBoon:
http://bookboon.com/blog/en/bookboon-com/our-mission-and-concept/
http://bookboon.com/blog/en/bookboon-com/about-the-concept-and-books/
Note, I have no affiliation with BookBoon, I've just found their textbooks/books very useful.Looking it up, I think I did that when I was 16, but I've never used it while programming. I can't see a single benefit to knowing it for programming. Been programming professionally for 12 years now. What am I missing?
Why do you think it's important?
Any reasoning about loops or recursion requires an implicit understanding of proof by induction. Making it formally explicit seems like a perfectly fine idea.
Whether you are missing anything depends on whether you ever write the sort of code that benefits from this. (Even if you do, you still might not be missing anything. You might be comfortable with loop invariants but not have connected them with proof by induction. Or you might be good at reasoning about these things in other ways that don't involve invariants.)
(You can stop reading here if you're already very familiar with loop variants and invariants.)
Here's the sort of thing I mean by loop variants/invariants. Suppose you're writing a binary search. (Don't write a binary search. Use someone else's that's already had the bugs taken out.) This is basically pretty simple but surprisingly easy to get subtly wrong, which means it's the sort of code it may be useful to write and document in such a way that you have an informal proof of its correctness. Like this:
function find(a, x):
# find x in sorted array a; return index i such that a[i]==x
# or -1 if no such index exists. Takes time at most
# proportional to log(#elements).
lo,hi = a.index_bounds()
while lo<hi:
# INVARIANT: min index <= lo < hi <= max index+1
# INVARIANT: if x is in the array then lo <= its index < hi
# VARIANT: D := hi-lo reduces to at most D/2 next iteration
mid = lo + floor((hi-lo)/2) # may equal lo, can't equal hi
if a[mid] == x: return mid # done!
if a[mid] < x:
lo = mid+1
else:
hi = mid
# INVARIANT: if x is in the array then lo <= its index < hi
# now lo >= hi which means there's nowhere for x to live
return -1
The above is pseudocode in no particular language. Is it correct? Those variants and invariants (1) divide that question in two and (2) provide a strategy for answering the second half of the question. First sub-question: if the (in)variants always hold, does that imply that the code is correct? Second sub-question: do they always hold? (Strategy for second sub-question: proof by induction on array size and/or number of iterations.)The first invariant implies that since mid is always between lo (inclusive) and hi (exclusive) it's safe to access a[mid]. The second, given that it holds at both start and end of the loop body, implies that if we exit the loop then indeed x isn't in the array. The only ways to leave the function are via the return in the middle, which only happens when we have explicitly found x, and via the return at the end, which only happens when x is known to be absent; therefore, if we return anything, we return the right thing. And the variant says that the quantity D, which starts by equalling the number of elements in the array, is reduced by a factor of at least 2 at each step; as it's always a (strictly) positive integer, this implies that the number of steps is at most log_2(n), so the function does return.
(Note that that last bit is more or less a proof by induction on array size that the function always returns.)
So if the invariants hold then the function does the right thing in the right amount of time.
Proving that the invariants hold is the induction-like bit. The first invariant holds at the start (since lo,hi start out being exactly min index and max index + 1). Each time around the loop we replace either lo or hi with something in between the two, so we still have min <= lo <= hi < max+1; and we will exit the loop unless in fact lo<hi. So the first invariant always holds.
The second invariant holds at the start (since lo,hi are bounds on the entire array). Because the array is sorted, our adjustments to lo/hi make this invariant true again for the next time around the loop. So the second invariant holds at the end of the loop -- and of course therefore at the start of the next iteration.
(Note that those were both proofs by induction, though I wasn't super-explicit about the fact.)
The variant works because if we write D = hi-lo and E = floor(D/2) then the new value of D is, depending on which branch of that if we take, either E or D-E-1; note that D-E-1<=E; so new-D <= E <= D/2 as claimed.
It's probably pretty clear what sort of code this is useful for: highly "algorithmic" code that's basically doing something fairly simple but that's tricky to think about and easy to get wrong. If you're writing a language's standard library, or implementing some sort of iterative mathematical algorithm, then you're quite likely to find it useful. The less like that your code is, the less often this technique will be useful to you. (Fairly extreme example: if you are writing a CRUD webapp then it is unlikely that anything you do will benefit from this.)
while lo < hi:
mid = (lo + hi) // 2
if a[mid] == x:
return mid
elif a[mid] < x:
lo = mid + 1
else:
hi = mid
return -1
But then I discovered that there's an alternative approach which has only one test per iteration: while lo < hi:
mid = (lo + hi) // 2
if a[mid] < x:
lo = mid + 1
else:
hi = mid
if lo < len(a) and a[lo] == x:
return lo
else:
return -1
If comparisons are expensive compared to other operations then this is twice as fast as the variant with two comparisons per iteration. (If comparisons are cheap, as they are if you are searching an array of numbers in a compiled language, then it doesn't make much difference.)Sorry to burst your bubble, but any moderately complex LOB CRUD app usually has a large amount of far more complex algos than a binary sort. Your off-hand comment shows a total ignorance of what's involved in writing a LOB CRUD web app.
In my experience, algos are the really easy part of programming. The hard part is managing complexity.
Given that I obviously don't "truly" understand it, having never done a CS degree.
I'd posit that most CS students don't truly understand recursion, they just vaguely know the theoretical basis behind a practical skill they have no experience in.
I'm currently taking a discrete mathematics class that Applied Discrete Structures by Alan Doerr and Kenneth Levasseur (http://faculty.uml.edu/klevasseur/ads2/). It's freely available, though I recommend steering away from the PDF on their site as it's got quite a few errors that are corrected in the source on Github.
On the surface this looks like an insurmountable task with questionable benefits. Don't get me wrong, but in the past 6 years of casual and professional programming, I've needed only a basic understanding of math, the most difficult thing being collision detection in games, and that includes doing RSA cryptography by hand. This paper starts off with proofs, something I've never had in school and which always seemed to me as if they only belong in scientific math papers, not practical life of someone doing computer science.
I don't mean to criticize the document or math in general, I would genuinely like to understand what 900 pages of this is going to bring me, especially when it starts with something I've never needed or seen outside of theoretical math discussions.
The benefits of these is hardly questionable. Its use is apparent when you take a Design and Analysis of algorithms course like https://www.youtube.com/watch?v=JPyuH4qXLZ0. A good example of using knowledge of the pdf is analysing expected runtime of a hashtable. Which turns out to be theta(1) average case. Good analysis of algorithms inspire better design of it in general.
Data structure and software engineering courses would probably be sufficient for many software engineering jobs out there. Databases, networks, OS and security are good to have knowledge. However, if an engineer is building cutting edge stuff, Mathematics will be his/her best friend.
One good property of Mathematics is that it provide guarantees in the form of equality, inequalities or equivalences. Such guarantees can help you ensure that your system holds quantitatively. It is thus your job to reduce your computer science/engineering problem to a mathematics problem.
I find this remark by Terence Tao particularly good: "If you don’t have mathematical background, the classes you take will help you train to analyze existing systems and build things that haven’t been built before. If you want to design something really new, at some point you’ll have to model what you’re doing, which might be different from previous models, and you have to do some mathematics somewhere." This remark is made in this interview: https://docs.google.com/document/d/1rinL25rC8LnMTzZcGjg1axT-...
For historical examples: consider Turing, Knuth, and Page & Brin.
For current examples: consider High Performance Computing (HPC), Data Science, and Data Engineering.
For future examples: wait and see (or study math in the present).
Also, consider etymology: computers are machines that preform computations; software is code that directs computations and their results on computers; software engineers create code that directs computations on computers; computational scientists define the limits of computing on computers that have given properties, and create novel computational solutions to problems; mathematicians discover the theory that computational scientists (and, more generally, all scientists) utilize.
Note_0: There is a field at the cutting edge of computation, computational science, that requires the most mathematical knowledge of any discipline that includes the compute stem.
Note_1: Math goes beyond providing guarantees of equality, inequality, and equivalence: it is the quantitative basis of computer science (and all science); it provides Boolean logic; it guarantees boundaries/possibilities; and it provides scope.
This covers intro to proofs, mathematical logic, number theory, graph theory, combinatorics, and probability. In a typical undergrad math curriculum, these would be five or six different courses. So if you have a two-semester course or self-study covering this 900-page textbook, it's probably more efficient than learning the material in the math department by a factor of 2.5:1 or 3:1.
Yes, stuff's been cut. This is more of a survey of these fields with the emphasis on the most important points, and informing you of the most basic parts. So if you encounter one of the more specialized problems that might have been covered in a more specialized course, you'll have hints on where to look, what to Google for, and what sort of reasoning to use.
A computer programmer who understands the mathematical underpinnings of his work might replace the standard library implementation of HashMap with one that's better suited to his use case, or do his own derivations to figure out how to implement back-propagation in a neural network, etc.
No, it's not a perfect analogy, but the point stands I think - having the deep knowledge of the theory and foundations in any field enables you to push the boundaries beyond any "black box" that is provided to you.
My approach with something like this is to breeze through it a first time, just to understand the main point of each section and how it all fits together. If you spend 30s/page on average (obviously there will be a lot of variation), that's 7.5 hrs -- two mornings, afternoons, or evenings.
And for most people, that will provide 90% of the value. And you know what to look up, where, when you need it in the future. And you also know whatever part you might be personally interested in more, and you can go back and read those sections in more detail.
This approach works well with all types of non-fiction, and it can actually be really helpful to first "skim" through every non-fiction book you read, before reading in detail -- knowing in advance where the author is going can often help remove a lot of confusion.
When I work on complex algorithms or concurrent systems I really feel the benefit of proof, because there's no way I could just test if the code is correct.
In the book, explaining what a proof is, how proofs are typically constructed and how to write a good one takes them ten pages, all written in very down-to-earth language. Then there are eight pages of problems you could do if you wanted to test your understanding.
I bet if you read those ten pages you'd feel there was nothing special there, just obvious ways to reason about things.
A term has ~15 weeks with 4 hours per week.
The exercises are not included in this - so I think 100-150 hours should suffice.
Thoughts?
To that end, I bought a copy of the 1995 "C Edition" of Foundations of Computer Science by Aho and Ullman. It combines data structures and discrete math into one massive text.
Does anyone have an assessment of that book? Is the combined data structures and discrete math a good approach? Does the book hold up well against more "modern" ones?
If you understand this stuff, you really need linear algebra for today's "deep learning", which perhaps is 18.03 (I can no longer remember).
18.06 is linear algebra. 18.03 is differential equations, which you don't really need for machine learning.
Is Gilbert Strang still teaching linear algebra at MIT? His intro materials to all things applied math are incredibly accessible.
https://hn.algolia.com/?query=machine%20learning%20math&sort...
One good way to go about it is to audit an online course [like Andrew Ng's] and figure out what gaps you need to fill in your knowledge to understand the material.
Once you feel comfortable with those, you'll be more than ready to tackle 6.867: https://ocw.mit.edu/courses/electrical-engineering-and-compu....
http://tutorial.math.lamar.edu/
Also: /r/learnmath
We're friendly!
I work for Akamai Technologies and the author I am talking about is Frank Thomson Leighton.
Obligatory 'zoomout' recommendation: https://www.amazon.com/Mathematics-Content-Methods-Meaning-V..., which I learned about from HN (http://hackernewsbooks.com/book/mathematics-its-content-meth...). Wish I had read/pondered this before grad math classes.
I'm not convinced either that it's negatively affected my career. I do occasionally wonder if it was just not taught in a way I could get, whether I was just bored to tears because the theory was so separate from the application, or if it's actually just not that important a prerequisite.
We detached this subthread from https://news.ycombinator.com/item?id=13800495 and marked it off-topic.
It can be, depending on what you're doing. Look at back-propagation in neural networks for example, where the whole thing is based on the chain rule from Calculus.