
#31 overallEvergreen
6.042J Mathematics for Computer Science
MIT OpenCourseWare
12 recommenders · 12 threads · recommended in 9 years, 2008–2024 · score 16.6
MIT's undergraduate discrete mathematics course covering logic, proof techniques, sets, number theory, graph theory, probability and related tools used in computer science. Course materials, lecture videos and a textbook are freely available through MIT OpenCourseWare, taught by Tom Leighton in the versions commenters mention.
Commenters call it an excellent, intuition-first course for the math behind algorithms and theory, and a strong way to build logic and proof-writing skills.
Mathematicsintermediatefreevideo lectures#discrete mathematics#proofs#logic#probability#number theory#leighton
Recommendations by year
20062026
Sightly OT: the best Math for Computer Science book/course I ever read is the one from MIT https://ocw.mit.edu/courses/electrical-engineering-and-compu...
Prof. Tom Leighton is an incredible teacher who teaches the intuition before the theory.
I would suggest something like https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-... instead of that book.
I appreciate that some may find the book useful, but I personally don't agree with the presentation. There are too many conceptual errors in the book that you need to unlearn to make progress. For example, the book describes R^2 as a "pair" of real numbers. This is very much untrue and that kind of thinking will lead you even further astray.
I say this as someone with a math/cs degree and PhD having taught these topics to hundreds of students.
For CS math, I'd recommend MIT's 6.042 https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-...
They have a book on the course website that's pretty good
Calculus and analysis is commonly the entry point to "serious" mathematics for engineers and physicists but it is certainly not the "only true way". It's not even particularly the usual way.
I recommend the content covered in MIT 6042J, Mathematics for Computer Science (https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-...). The most important part of this course is logic and proof-writing, both of which are foundational tools of serious mathematics, that sometimes get elided if you come in through the physics side (i.e. via calculus and analysis). You will also learn discrete mathematics, i.e. "a bunch of stuff that is useful for cryptography". But I think the foundational stuff about logic and proofs is even more useful. It will rewire your brain in a way that prepares you to go deeper in maths.
Lots of good stuff in this thread already, so I'll just add a thought or two. A lot of commentators here have picked up that what you need is roughly the equivalent of a "Data Structures & Algorithms" course. I agree with that sentiment. Whether you actually take a course, or work through some books, or whatever, so long as you acquire that knowledge you'll have a great foundation.
The question then is "what next?" To which I would say that you want roughly the equivalent of a course titled something like "Introduction to Computation" or "Automata Theory & Computation" or whatever. That is, you'll want to understand things like Universal Turing Machines, Finite-State Automata, Formal Grammars, and some basics of Computational Complexity Theory (the same "Big O" stuff you'll hear mentioned in the Data Structures & Algorithms class, but going a little bit deeper). This stuff isn't necessarily required to do a lot of "grunt work" programming, but it starts coming into play if you want to do some more advanced stuff.
One of the classic texts in this area is by Hopcroft & Ullman.
https://www.amazon.com/Introduction-Automata-Theory-Language...
And on a semi-related note, there's a really good course on Youtube: MIT 6.042J Mathematics for Computer Science, taught by Tom Leighton[1], that you might find useful as well. A version of the book[2] used in that course is freely available online as well
https://www.youtube.com/playlist?list=PLB7540DEDD482705B
[1]: https://en.wikipedia.org/wiki/F._Thomson_Leighton
[2]: https://people.csail.mit.edu/meyer/mcs.pdf
Check out the course 6.042J from MIT (Mathematics for Computer Science).
https://ocw.mit.edu/courses/electrical-engineering-and-compu...
Hey no problem with asking late though sometimes people may not respond or they may take a while though I have hacker news replies setup [1], so I sometimes have to get through my 300+ emails per week (mostly marketing emails [just saying I’m not that popular haha]). I actually was doing it at Utah State University (USU) and I was on Campus my distance-ed program was across different campuses for a University that has multiple campuses across Utah. So, I’m not sure if they have many people that do off campus distance ed classes.
I loved my University though. They were accredited for their CS program (not sure how important that is honestly in fact I only learned about that because I had to do an exit interview). Though there are many arguably better Universities in Utah such as BYU and U of U to name a fewer, I’ve come to believe that pretty much any University will likely give you a world class education. Also Utah State is a research University which is an added bonus, because it helps to have teachers that research in their field. I felt I got a really good grasp on the theoretical principles there. My favorite course was probably Discrete Mathematics at USU. It helped me get a good grasp on abstract thinking (might as well bring that up since this thread is about that). I really recommend anyone take something similar to Discrete Math by starting to go through the readings for the Mathematics for Computer Science course from MIT Open Course Ware and possibly the videos too (OCW) (e.g. [2] or [3]). Reading the beginning of the Math for Computer Science course manual prepared me for my Discrete Math class so well (In fact I ended getting over a 100% final grade because the teacher had to move the grading curve, because likely too many were likely not doing so good). Usually before you take a class like that you need to take Calculus, but really all you need to know from Calculus to complete that class is likely sums and series. Any ways best of luck with your studies and if you plan on doing online education I’m not sure the best University to do it through. I was really glad that I was able to attend University on campus though, because though I can be disciplined I feel like I lack that discipline whenever I don’t have enough pressure to keep me focused and not get distracted on other things. Again best of luck in studies!
[1]: http://www.hnreplies.com/ [2]: https://ocw.mit.edu/courses/electrical-engineering-and-compu... [3]: https://ocw.mit.edu/courses/electrical-engineering-and-compu...
Those ADuni lectures are actually what I know him from. They're excellent, and I very much admire his teaching. The problem I think is either that I went too far in the lectures without attempting the problem sets, or that I simply didn't have the educational prereqs or a work / hobby application to ground me and keep me working at it. Nonetheless, I very much admire the work and enjoy watching the lectures. If nothing else it gets me in a better headspace when I program. Hopefully I can transition that into learning the actual methods and techniques over time.
I will definitely check out the MIT course. I bet that would help me retain it much better. I was also looking at the Math for Electrical Engineering & Computer Science that I think you mentioned in an earlier comment.
For anyone who wants to learn more discrete math, I recommend the Mathematics for Computer Science MIT OCW course:
http://ocw.mit.edu/courses/electrical-engineering-and-comput...
Doing a BS in CS would be the best, otherwise you will need a ton of self-discipline to learn even a half of what you would learn in a degree program. If you decide to self study, and have enough "mathematical maturity", you will find everything you need on MIT OpenCourseWare, they have all the core courses available online with video lectures, solved homeworks etc. I would start with going through those two first:
Structure And Interpretation Of Computer Programs:
http://ocw.mit.edu/courses/electrical-engineering-and-comput...
Mathematics For Computer Science:
http://ocw.mit.edu/courses/electrical-engineering-and-comput...
The first one is pretty much a master class in software engineering, the other prepares you for studying algorithms, I would consider those the two main more theoretical facets of programming at a professional level. With that background you can try to work on their algorithms course:
http://ocw.mit.edu/courses/electrical-engineering-and-comput...
It would also be very valuable to eventually take all the core mathematics subjects from OCW: Single+multivariable calculus, linear algebra and probability theory - the profit is less immediate but those things do come very useful. All those six courses on the MIT OCW are top notch.
Try the "MATH FOR CS" course in MIT Opencourseware :)
Adding in some practical pointers too. If you're not in a position to enroll in an accredited CompSci program, look at MIT's free online courses:
http://ocw.mit.edu/OcwWeb/web/courses/courses/index.htm#Elec... * Start with 6.001 * Make sure to hit one (or all three) of 6.042J. * I was about to claim the 6.171 (Software Engineering for Web Applications) was too out of date to bother with, being dated Fall 2003, but scanning the topic list of the course, everything listed there is still a concern in my day to day work. * Dewar and Schonberg would have you stress compilers. I would have you stress analysis of algorithms.
According to an older ocw version of this course [1], you need "General ease with algorithms, elementary number theory and discrete probability". You can learn these from MIT's own ocw's excellent "Mathematics for Computer Science" [2] and "Introduction to Algorithms" [3].
For a gentler intro to crypto, I am planning to do Cristof Paar's course first, given that he takes his time to carefully explain all the math; there is a youtube list with all the lectures [4] and a course webpage [5]. In case any further encouragement is needed, according to a blog posting "Matasano Crypto Challenges, Set 5" [6]: "This set was surprisingly easy, actually. The book Understanding Cryptography by Paar & Pelzl is an excellent intro to the basic maths needed for crypto — namely, the group theory and number theory necessary for RSA and Diffie-Hellman."
Now that I am at it, here are some HN links you may find helpful if planning to learn crypto, in no particular order:
Rolling Your Own Crypto (DON'T!) [7]
Telegram’s Cryptanalysis Contest [8]
The most dangerous code in the world [9]
BearSSL – Smaller SSL/TLS [10]
NaCl: DJB’s new crypto library [11]
JavaScript Cryptography Considered Harmful [12]
Cryptographic Right Answers [13]
Ask HN: Current Crypto Best Practices [14]
Mathematical Cryptology [15]
Ask HN: What are the best books for learning information security? [16]
Of course, there are also the courses Bohne's CS255, Rivest's 6.857 and many others, and the books Cryptography Engineering, Introduction to Modern Cryptography etc ... Harvard's [pdf] https://people.seas.harvard.edu/~salil/cs127/fall13/conclusi... is a good guide.
Good times for learning!
[1] https://ocw.mit.edu/courses/electrical-engineering-and-compu...
[2] https://ocw.mit.edu/courses/electrical-engineering-and-compu...
[3] https://ocw.mit.edu/courses/electrical-engineering-and-compu...
[4] https://www.youtube.com/playlist?list=PL2jrku-ebl3H50FiEPr4e...
[5] http://www.crypto-textbook.com/
[6] https://raywang.tech/2017/04/21/set5-writeup/
[7] https://news.ycombinator.com/item?id=13221923
[8] https://news.ycombinator.com/item?id=6940665
[9] https://news.ycombinator.com/item?id=4695350
[10] https://news.ycombinator.com/item?id=12863699
[11] https://news.ycombinator.com/item?id=704689
[12] https://news.ycombinator.com/item?id=7903720
[13] https://news.ycombinator.com/item?id=16748400
[14] https://news.ycombinator.com/item?id=14041827
[15] https://news.ycombinator.com/item?id=7795958
[16] https://news.ycombinator.com/item?id=11710028
If you want a book to help get you started with TAOCP I've heard Concrete Mathematics is good. It's the math precursor to TAOCP (so if that's what's holding you back it could be helpful.) I haven't finished concrete mathematics yet though either :P so I can't tell you if it actually helps reading TAOCP. I would recommend knowing calculus, linear algebra, and discrete math before concrete mathematics. MIT OpenCourseware should have all those courses with Mathematics for Computer Scientists working as the Discrete Mathematics supplement.
I've never taken linear algebra so that is what is holding me back right now from continuing concrete mathematics. I bought Gilbert Strangs Linear Algebra book and it seems good so far, but I am busy with schoolwork now so I'll have to get back to it after I graduate in a spring.
This.
If you take a look at the MIT course "Mathematics for Computer Science"[1] you'll see that the only prerequisite for learning the math for cs is ... calculus!
[1]http://ocw.mit.edu/courses/electrical-engineering-and-comput...