MIT · on MIT OpenCourseWare

Mathematics for Computer Science (6.042J)

4.8(5,000) on MIT OpenCourseWare·800K enrolled
Intermediate 40 hours EnglishFREE
SkillsDiscrete mathematicsProofsLogicProbabilityGraph theoryCombinatorics

Is this course right for you?

Our take
If you can already code but never learned the mathematical foundations behind algorithms, this fills that gap — rigorously, and free from MIT.

Good for: cs learners who want the discrete maths and proofs behind algorithms.

Skip if: you want applied coding, or you dislike proofs.

It covers proofs, number theory, graph theory, probability and counting — the machinery behind algorithm analysis and cryptography — with MIT's rigour but concrete examples that tie the maths to real CS. It is a common gap for self-taught developers, who can build software but have not seen why algorithms work or how their performance is bounded.

It is proof-heavy and not applied, so there is no coding here and it will frustrate anyone who dislikes proofs; take an applied algorithms course instead if that is you. There is no certificate from the free materials. The recordings date from around 2010, but the core mathematics is still relevant.

Comparison · LBS

Compare alternatives for Mathematics for Computer Science (6.042J)

Same topic, different options. We surface the trade-offs others hide so you can pick the course that actually fits your time, budget, and goals.
MIT OpenCourseWare4.8(5,000)
Mathematics for Computer Science (6.042J)
Price
Free
Completely free, openly licensed — no certificate
Duration
40 hrs
Level
Intermediate
Certificate
Coursera4.8(14,000)
Google Advanced Data Analytics Professional Certificate
Price
Free
Audit free · Certificate on subscription
Duration
197 hrs
Level
Intermediate
Certificate
Professional Certificate
Coursera4.9(39,000)
Machine Learning Specialization
Price
Free
Audit free · Certificate on subscription
Duration
86 hrs
Level
Intermediate
Certificate
Specialization
MIT OpenCourseWare4.8(3,200)
Statistics for Applications (18.650)
Price
Free
Completely free, openly licensed — no certificate
Duration
30 hrs
Level
Intermediate
Certificate
Prices & availability can change — confirm on the provider's site. We're not affiliated with any single provider.

About this course

Mathematics for Computer Science is the discrete math course at MIT that underpins algorithm analysis, cryptography, and the theoretical foundations of computing. It covers mathematical proof techniques, number theory, graph theory, probability and counting — the mathematical machinery that algorithm proofs, data structures analysis, and cryptographic systems depend on.

Instructor

TL
Tom Leighton / Albert Meyer
MIT OpenCourseWare instructor
800K+ learners6 courses4.8 instructor rating

Taught by Tom Leighton (MIT professor and co-founder of Akamai Technologies) and Albert Meyer, MIT Professor of Computer Science — both known for connecting mathematical theory to practical CS.

Frequently asked questions

The discrete-maths toolkit that computer science actually runs on: formal logic and proof techniques, induction, sets and relations, graph theory, number theory, counting, and discrete probability. It's the maths behind algorithms and CS theory, not the calculus-based maths of engineering.

It's exactly the intended prerequisite. MIT lists it as the maths background for its algorithms course, so if proofs, induction and asymptotic notation feel shaky, working through this first makes an algorithms course far less painful. Many people who struggle with algorithms are really missing this.

No. This is discrete mathematics — a different branch, built on logic, counting, graphs and probability. Comfort with secondary-school algebra is enough to start; calculus simply doesn't come into it.

It's proof-heavy, and that's the real challenge — especially if your maths so far has been about calculating answers rather than proving statements. The difficulty is in learning to reason and prove rigorously, which takes time to click, more than in any single hard topic.

MIT posts a Fall 2010 version (largely Tom Leighton, who co-founded Akamai) and a Spring 2015 one, with Albert Meyer too. Either is excellent, and the material — discrete maths — doesn't date, so pick whichever lecturer's style suits you. It's a genuine MIT course, which is part of why it's demanding and well regarded.
Free
to audit
Enroll now