Skip to content

Mathematics Foundations

A free, self-paced math curriculum built on open-source textbooks. This track covers the mathematical foundations required for computer science, machine learning, and software engineering: from precalculus and single-variable calculus through probability and statistics, and on to the math an LLM system runs on (matrix calculus and autodiff, numerical methods and floating point, optimization, information theory). In the course, every math topic with code has a call site: the modules you build here are called by the system you build.

The primary math texts are free to read online. Access and reuse permissions differ; consult each source’s license. See the source register for checked references.

graph LR
    PC[00 Precalculus] --> C1
    C1[01 Calculus 1] --> C2[02 Calculus 2]
    C2 --> C3[04 Calculus 3]
    LA[03 Linear Algebra] --> C3
    D1[05 Discrete Math 1] --> D2[06 Discrete Math 2]
    C1 --> PS[07 Probability & Statistics]
    D1 --> PS
    C3 --> MC[08 Matrix Calculus & Autodiff]
    LA --> MC
    D2 --> MC
    C2 --> NM[09 Numerical Methods & Floating Point]
    PC --> NM
    C3 --> OPT[10 Optimization]
    LA --> OPT
    PS --> IT[11 Information Theory]
    LA --> IT
    LA --> SI[12 Signals & Images]
    PC --> SI
    NM --> SI
#TopicTextbookEstimated Time
00PrecalculusOpenStax Precalculus 2e2-3 weeks
01Calculus 1OpenStax Calculus Vol 14 weeks
02Calculus 2OpenStax Calculus Vol 24 weeks
03Linear AlgebraHefferon, Linear Algebra4 weeks
04Calculus 3OpenStax Calculus Vol 34 weeks
05Discrete Math 1Hammack, Book of Proof4 weeks
06Discrete Math 2Levin, Discrete Mathematics4 weeks
07Probability & StatisticsGrinstead & Snell + OpenStax Stats3-4 weeks
08Matrix Calculus & AutodiffParr & Howard, Baydin et al. (free)3 weeks
09Numerical Methods & Floating PointGoldberg (free), Higham3-4 weeks
10OptimizationBoyd & Vandenberghe (free)3 weeks
11Information TheoryStudent’s Guide to Coding & Info Theory + MacKay (free)3-4 weeks
12Signals & ImagesOppenheim & Schafer; Smith (free)2 weeks

Total: ~27-28 weeks for 01 to 07 as an intensive introductory pass, at 10-12 hours per week; 00 and 08 to 12 add about 17 weeks, or arrive just in time through the course passes. Full textbook coverage and degree-level mastery require additional problem sets and assessment.

  1. Pick your entry point. Calculus 1, Linear Algebra, and Discrete Math 1 have no college-level prerequisites. Algebra and functions are assumed; calculus also requires trigonometry. Start with one subject unless your weekly time budget supports more.
  2. Open the topic README. Each topic lists the free textbook, section-by-section study plan, key theorems, worked examples, and exercises.
  3. Work problems with pencil and paper. Mathematics is learned by doing, not reading. Aim for 10-12 hours per week on each active topic.
  4. Follow the prerequisite graph. Once you complete the entry-level topics, the graph above shows what unlocks next.
  5. Connect to CS. Each topic README maps math concepts to their CS applications and links to the algorithms/systems tracks in this repo.

Full-time (2 topics at once):

  • Weeks 1-4: Calculus 1 + Discrete Math 1
  • Weeks 5-8: Calculus 2 + Discrete Math 2
  • Weeks 9-12: Linear Algebra + Probability & Statistics
  • Weeks 13-16: Calculus 3

Part-time (1 topic at a time):

  • Follow the numbering 01 through 07, respecting prerequisites.

Use the CS curriculum math labs alongside these topics: prove a scheduler correct, implement least squares and PCA, check gradients, measure integration error, and simulate statistical inference. Each assignment requires a derivation, implementation, independent comparison, and failure analysis.

After the foundations, read Deisenroth, Faisal and Ong’s Mathematics for Machine Learning for the bridge to numerical optimization and data applications.