from Hacker News

Ask HN: Resources to learn math as a foundation for CS

by txmjs on 3/2/18, 9:20 PM with 12 comments

I’ve been a self taught web developer for about 4 years, and although my programming knowledge has been increasing at an exponential rate recently, I feel like I want to step up to the next level, by which I mean trying to teach myself the foundations of CS. I know in order to do this, my maths needs to be much stronger than it is now. Assume that my maths knowledge is currently at the same level as a high school student. I’d appreciate any advice as to how I can improve my maths, and what I should be learning in order to better grasp CS foundations. Thanks!
  • by jfaucett on 3/3/18, 2:26 PM

    I've done exactly what you are talking about, so I think I have some insight that might be helpful.

    For me, the biggest aid was finding good books, ones with exercises and that explained the material very well. Then it was just a matter of reading, actually doing all the exercises, and struggling with the material until I could fully understand it; then I moved on to the next chapter/book/etc.

    I've worked through a lot of books by now but here's the short list of ones that I think are great for getting started(especially, if you do what I described above), also when these have solutions manuals I would advise getting them as well so you can ensure you understand how every problem works.

    1. Calculus 4th ed. by Smith and Minton

    2. Introduction to Linear Algebra (Gilbert Strang)

    3. Introduction to Probability Theory (Hoel, Port, Stone)

    4. Discrete Mathematics and its applications (Rosen)

    5. Introduction to Automata Theory, Languages, and Computation (Hopcroft)

    6. Introduction to Algorithms (Cormen, Leiserson, Rivest, Stein)

    It will take you at least a year if not two to work through all these in your spare time, but the advantage is that after that you'll have the skills to be able to approach just about any topic in computer science (even highly theoretical ones) and not have much difficulty understanding them (at least that was my experience).

  • by nextos on 3/3/18, 4:27 AM

    Modern mathematics is built around linear algebra and analysis. It's no coincidence math bootcamps like Harvard Math 55 go this route. If you are into long-term mathematical learning and you can afford the detour, I'd start by learning linear algebra from e.g. Axler and analysis from e.g. Bressoud (both are didactic masterpieces).

    Alternatively, you can start by studying any of the alternative foundations to mathematics (set theory, logic, etc). Perhaps from a toned down alternative to Sørensen & Urzyczyn. A beautiful and very modern way to do this for a CS student would be to marry it with a course on automated theorem proving (using Isabelle or Coq). Any book suggestions welcome.

  • by ezekg on 3/3/18, 2:02 AM

    This has been the single most useful math resource for me as a programmer: https://github.com/Jam3/math-as-code, especially for working through CS textbooks like CLRS.
  • by BiancaDelRio on 3/2/18, 9:30 PM

    Mathematical Foundations of Computing by Keith Schwarz:

    https://web.stanford.edu/class/cs103/notes/Mathematical%20Fo...

  • by junk_f00d on 3/7/18, 3:26 AM

    Concrete Mathematics by Knuth was designed with your needs in mind, and has essentially become the canonical "math for cs" text. I haven't read more than the preface plus a few pages though, so I can't comment further on whether or not it delivers in my opinion, but the opinions of others seem very positive.
  • by seagullz on 3/3/18, 5:07 AM

    This sounds pretty much like what you are looking for: https://courses.csail.mit.edu/6.042/spring17/mcs.pdf

    Given that linear algebra has become so vital lately (as others remarked already), the following new book appears better than the lot from an applied viewpoint: https://web.stanford.edu/~boyd/vmls/vmls.pdf