
Mathematics for Computer Science: Readings - rspivak
https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-spring-2015/readings/
======
codekilla
Avi Wigderson's forthcoming book is pretty great if this sort of thing
interests you:
[https://www.math.ias.edu/files/mathandcomp.pdf#page=1](https://www.math.ias.edu/files/mathandcomp.pdf#page=1)

~~~
topologie
It looks even better than the MIT course itself. I hadn't heard of Wigderson
before, but now I'm definitely going to keep an eye on his work. Thank you for
sharing this.

------
mettamage
Question: why isn't linear algebra in here? I know this is a type of "but this
isn't in my favorite list" question but since a lot of universities include it
in their CS curriculum, I wonder why it isn't in here.

Or did I oversee it? Is in there?

~~~
joker3
There are a few reasons.

First, the purpose of a class like this is to prepare students for further
coursework in algorithms and automata/complexity. You need logic, graphs and
combinatorics for those a lot more than you need linear algebra.

Second, the math department teaches a class in linear algebra. This is a
collection of topics that you wouldn't ordinarily find in undergraduate math
classes.

Third, there's a limit on how much linear algebra you can cover in part of a
course like this. Better to give it its own semester so you can treat the
subject in some reasonable breadth.

~~~
mlevental
i agree with you that this is in principle math for CS proper (rather than
machine learning or numerical algos or something) but

>Second, the math department teaches a class in linear algebra. This is a
collection of topics that you wouldn't ordinarily find in undergraduate math
classes.

x math department doesn't have classes on graph theory, combinatorics, or prob
& stats?

~~~
dsacco
You would not typically find _dedicated_ undergraduate courses for graph
theory, probability theory or combinatorics, no. At the very least you
wouldn't expect to see those until you hit 300 level, but most likely not
until graduate courses.

Discrete mathematics is a grab bag of topics, and it's more fair to say that a
discrete math course pulls in selected topics from other areas than to say it
provides a focused coverage of any of them. At the depth each topic is taught,
you couldn't pull it out into its own semester's worth of lectures. On the
other hand, it would be very difficult to compact linear algebra into a
discrete math course. Learning linear algebra already requires you to
introduce a bunch of new concepts, like fields and vector spaces, linear
equations, linear transformations, matrix representation and matrix
operations, determinants, inner products...

Equally importantly, linear algebra doesn't really "fit" with the topics of
discrete mathematics, pedagogically speaking. It fits well with a treatment of
multivariable calculus, but that's only a small part of what's taught in
discrete math courses. If you wanted to teach linear algebra in a course
covering a bunch of topics, you'd probably want to do a "topics in abstract
algebra" course that works through groups, rings, modules, linear algebra and
multilinear algebra. But then you're going well beyond what a non-math major
should encounter in an undergraduate setting.

Really, linear algebra stands on its own very well. In my opinion it should
receive focused coverage and not be mixed with anything else. While graph
theory and combinatorics can easily receive the same coverage, their treatment
is usually pushed back to advanced undergraduate or graduate level courses
because engineers don't usually work with them beyond what's covered in
discrete math (which is exactly why we have discrete math as a standalone
course). In fact, MIT actually lists linear algebra and multivariable calculus
as _prerequisites_ for the focused courses on combinatorics. The same applies
for probability theory: you can't really learn probability theory (beyond
discrete) without first learning analysis.

~~~
smadge
Strange, I have taken a 4 credit, one quarter class in both probability theory
and combinatorics in my undergraduate math and computer science education.

~~~
gizmo686
It is certainly possible to offer a complete class in combinatorics or
probability theory at the undergrad level. The point is that such a course
would cover far more than what a discrete math class would cover in those
subjects.

------
mbrundle
Related course (w video lectures):
[https://news.ycombinator.com/item?id=9311752](https://news.ycombinator.com/item?id=9311752)

------
iwansyahp
Is this book suitable for math self-learning?

~~~
dsacco
I took a look at the first four or so chapters and I'm not really a fan of the
organization. But I think you could self-study the material and be fine. The
introduction of the book explains that it's very focused on proofs, and it
feels to me like it's more of an applied mathematics book than it is discrete
mathematics (i.e. computer science) book. That's a subtle distinction, but I'd
summarize it by saying this book feels as if it was written more for math
majors than computer science majors. That doesn't mean you shouldn't read it;
rigor and formalization are important! It just means that (as I interpret it),
the authors are focusing more heavily on mathematical formalization and
foundations than most "discrete mathematics" treatments.

For the context of my opinion: my favorite math textbook for computer science
is Chapter 1, Section 1.2 of _The Art of Computer Programming_ ("Mathematical
Preliminaries"). That's pretty dense though, so I usually recommend _Concrete
Mathematics_ , which was also (co)authored by Knuth. The benefit of _Concrete
Mathematics_ is that it spreads the information out with more examples and
better exposition. It also includes an expanded section on probability. But in
my opinion, the failing (if you could call it that) of both is that there
isn't a dedicated section on set theory. I really think that should be covered
alongside the introduction to various types of proof.

Which brings me back to this textbook...I personally think it spends too much
time building logic and proof machinery in the first chapter. Sets and
functions have sections that are only pages long, but there is a large focus
on logic. I understand it's a mathematics for computer science treatment and
not a pure mathematics treatment, but that's actually pretty dry in my opinion
- I think a treatment that focuses more on sets is more intuitive. One of the
things I like about Knuth is that he covers these topics in a slightly
irreverent and humorous way. He also engages the reader by jumping more
directly into arithmetic operations, functions, basic number theory, the
binomial theorem and combinatorics, etc.

Some of this is admittedly my own bias. I've _never_ enjoyed staring at things
like e.g. truth tables. It's important to know, but this actually seems
excessively formal for a discrete mathematics course. Reading through the
algebra of propositions isn't exactly riveting. I think that, for self-study
at least, exposition and organization of topics is just as important (probably
more so) than complete coverage of topics. All of the material you'd want to
know _is there_ , it's just that the treatment might be a bit suboptimal for
self-study. It probably depends on what you find interesting and how quickly
you'd like to do interesting things with what you're learning. It would
probably also be beneficial if some people who have actually learned from this
textbook for their first encounter with the material could chime in, because
that might be more relevant to your question.

~~~
dizzystar
I'm guessing you have a very strong math background if you are suggesting
Concrete Math to a random person asking about self-teaching.

Concrete math requires MUCH more background than this book. Besides the real
gems and clever tricks Mathematics for Computer Science appear after the
fourth chapter.

~~~
dsacco
Really? What background do you think _Concrete Mathematics_ needs?

------
sidcool
How has this book helped you as a programmer? I am finding it difficult going
through it.

~~~
alehul
I'm currently taking a near-identical course as a CS freshman, and while I
lack the programming expertise to adequately explain the importance in that
field, it's definitely valuable to learn. I've never enjoyed a maths class
more, really.

It offers so many 'hacks' to working with numbers, which I could imagine would
make code more efficient and avoid unnecessary computations when dealing with
very large numbers.

Separately, my increased mental efficiency with problems involving numbers is
really surprising. There have been interview questions I've read about in the
past where I've thought "someone must be a genius to be able to answer that
through mental math," and it all makes so much more sense now! It's taught me
about dozens of visualizations that can break down these problems in much more
manageable ways.

As an example of a mental maths problem on my midterm: How many numbers
between 1 and 99,999 have digits that add up to 10? (23,500 would work whereas
23,510 would not). While initially I would have no clue how to answer this,
learning about the balls-in-bins method solves it in an incredibly simple
manner.

------
linkmotif
This is so good. The lectures broken up into shorter videos are great. Thank
you for posting.

------
juskrey
Why so obsessed with proofs? How often a programmer needs to prove anything
except PnL of a project?

~~~
episteme
Because it's not Mathematics for Programmers?

------
WhitneyLand
Do they every provide lecture videos or audio, assuming I didn’t miss it
browsing the pages?

------
mikevm
Latest edition of the book:
[https://courses.csail.mit.edu/6.042/spring18/mcs.pdf](https://courses.csail.mit.edu/6.042/spring18/mcs.pdf)

~~~
abhishekjha
I wonder how one would read 1000+ pages of a technical book like this.

~~~
cultvoid
Some famous runner who's name I can't remember and probably didn't exist
anyway once said "I can't run 200 miles. But I can run 1 mile - 200 times".

Start from page 1 and iterate from there.

~~~
SebNag_
This analogy does not capture the problem that the human brain constantly
forgets...

~~~
marpstar
Sure it does. If you _really_ wanted to read and understand this book and
dedicated time each day to understanding 3 pages worth of content, you could
read the book in a year. Remembering 3 pages of content per day (especially in
math where concepts build on each other) is really not hard.

~~~
dsacco
_> Remembering 3 pages of content per day (especially in math where concepts
build on each other) is really not hard._

I disagree. Or rather, I think that's unsustainable. Any given three
consecutive pages from Spivak's _Calculus_ are probably doable on a daily
basis. But is would be legitimately _hard_ for most people to go through three
pages of Rudin's _Principles of Mathematical Analysis_ each day and
consistently retain that information. Axler's _Linear Algebra Done Right_ is
very readable, but Halmos' _Finite-Dimensional Vector Spaces_ will start
getting just as dense as Rudin. These are difficult textbooks even when
students are well-prepared for them with prerequisite courses. Terence Tao
wrote two books to cover (with better exposition) what Rudin did in one. I
think it would be pretty hard to read consistently three pages of Tao's
_Analysis I_ each day, before he even gets to limits.

I think you're underestimating the intellectual effort here. In my opinion,
even if you're reading a math book targeted to your level, committing to
reading _and understanding_ three days of material each day would become
exhausting. A typical semester is 15-16 weeks, with lectures 1 - 3 times a
week, and most undergraduate courses do not actually work through the entirety
of a 300 page textbook. Even at that slower pace it's not typical for most
people to ace the course. If you read three pages a day and had a solid
understanding of it, you'd be absolutely breezing through math courses.

In my experience students need to really step away from the material and let
it percolate for a bit every so often in order to solidify their
understanding. I really don't think you can partition the material into equal,
bite-sized amounts each day. The learning progression doesn't tend to be that
consistent or predictable.

