Learn All the Math for Machine Learning at Zero Cost: A Complete Khan Academy Roadmap

A free Khan Academy roadmap for learning all the math needed for machine learning in nine stages.
A Reddit user created a comprehensive machine learning math roadmap using only Khan Academy's free resources. The guide covers nine stages from algebra through linear algebra, calculus, and statistics, with clear prioritization of what's essential, optional, or skippable for ML. It emphasizes building intuition over completeness, highlighting linear algebra and calculus as core subjects while trimming traditional math education's redundant content.
One of the biggest barriers to getting started with machine learning often isn't programming—it's math. Linear algebra, calculus, probability and statistics—these subjects sound intimidating, and paid courses on the market don't come cheap. Recently, a Reddit user compiled a complete machine learning math learning roadmap based entirely on Khan Academy's free videos with the help of ChatGPT, sparking widespread discussion in the community.
The reason machine learning demands strong math skills is that its core algorithms are essentially solutions to mathematical optimization problems. For example, linear regression is a matrix solution using the least squares method, logistic regression relies on gradient optimization of the log-likelihood function, and neural network training involves repeated iterations of chain rule differentiation and gradient descent in high-dimensional spaces. Andrew Ng noted in Stanford's CS229 course that truly understanding algorithms—rather than merely calling library functions—requires solid foundations in linear algebra and calculus. Khan Academy, founded by Salman Khan in 2008, currently offers over 10,000 instructional videos covering math courses from elementary school through university level, all completely free with interactive practice problems, making it an ideal platform for self-learners to build their mathematical foundations.
The core value of this roadmap isn't about "listing every math course"—it's about precise prioritization. It explicitly tells you what must be mastered, what's optional, and what can be skipped entirely. For self-learners, this kind of "subtraction" is often more valuable than "addition."

The ML Math Route: Nine Progressive Stages
The author's recommended learning sequence is as follows:
- Get Ready for Algebra 1 (diagnostic test only)
- Algebra 1 (learn nearly all of it)
- Geometry (selective learning)
- Algebra 2 (learn nearly all of it)
- Trigonometry
- Precalculus
- Linear Algebra (core)
- Calculus 1 (core)
- Multivariable Calculus (selective)
- AP/College Statistics (statistics and probability)
The author specifically emphasizes: You don't need to complete every math course Khan Academy offers. Many courses are alternative or redundant content that isn't necessary for building an ML math foundation.
Algebra Foundations: Making Operations Second Nature
For "Get Ready for Algebra 1," the author suggests going straight to the course challenge test. If you've already mastered basic algebra, don't waste weeks re-learning—just use it to identify gaps.
Algebra 1 and Algebra 2, however, should be studied nearly in full. The author highlights a key principle: The goal is to make basic algebra an automated skill—you should be able to manipulate equations and formulas without thinking, rather than stopping to reason through every operation.
This principle has a cognitive science basis. Cognitive Load Theory states that when basic operations haven't been automated, learners facing complex problems expend much of their working memory on low-level operations, preventing them from focusing on higher-level conceptual understanding. In the ML context, exponential functions appear in the Softmax activation function (e^x), logarithms appear in cross-entropy loss functions (log loss) and information theory (entropy H = -Σp·log(p)). If you need to recall logarithm rules every time you encounter these expressions, learning efficiency drops dramatically.
Among these topics, exponents and logarithms are especially important, as they appear repeatedly in statistics, probability, optimization, and machine learning.
Geometry and Trigonometry: Learn Only What's Useful for ML
The most practical aspect of this roadmap is its bold trimming of "redundant content" from traditional math education.
For geometry, the author explicitly states you don't need to complete the entire course. What machine learning actually needs is coordinate geometry: coordinate planes, distance between two points, midpoints, slopes, equations of lines, and basic transformations like translations, reflections, rotations, and scaling. The purpose is to strengthen spatial and coordinate intuition.
This prioritization is well justified. Many core ML concepts build on coordinate geometry intuition: K-Nearest Neighbors (KNN) directly uses Euclidean distance to measure similarity between data points; the core idea of Support Vector Machines (SVM) is finding an optimal hyperplane in high-dimensional space to separate data, requiring understanding of slopes, normal vectors, and point-to-plane distances. Transformation operations (translation, rotation, scaling) are fundamental in data augmentation, feature engineering, and computer vision—affine transformations in image preprocessing are essentially geometric transformations represented as matrix multiplications.
Content that occupies large portions of traditional geometry—lengthy geometric proofs, congruence proofs, similarity proofs, circle theorems, geometric constructions, detailed Euclidean geometry—are all marked as low priority. This tradeoff perfectly aligns with engineering-oriented learning logic: we want geometric intuition, not proof techniques.
The same applies to trigonometry. The author recommends learning angles, radians, the unit circle, sine/cosine/tangent, trigonometric function graphs, inverse trig functions, and basic identities, but don't get bogged down in complex trigonometric identities. The main purpose of trigonometry is preparation for calculus and mathematical modeling.
Linear Algebra and Calculus: The Core of ML Math
In the roadmap, the author marks two courses as "CORE": linear algebra and Calculus 1. This aligns perfectly with machine learning's actual requirements.
Linear Algebra: Understanding What y = Xw Really Means
Linear algebra is called "one of the most core subjects for machine learning" by the author, who recommends deep study. Key topics include:
- Vectors: vector operations, norms, dot products, geometric interpretation, linear combinations
- Matrices: matrix multiplication, transpose, inverse, determinants, systems of equations
- Core concepts: span, linear independence, basis, linear transformations, orthogonality, projections, eigenvalues and eigenvectors
In modern machine learning, virtually all data is stored and processed in matrix form. A dataset with m samples and n features is an m×n matrix X. The closed-form solution for linear regression is w = (X^T X)^{-1} X^T y, an expression involving matrix transpose, matrix multiplication, and matrix inversion. Eigendecomposition is the mathematical foundation of Principal Component Analysis (PCA) dimensionality reduction—PCA essentially finds the eigenvectors of the data covariance matrix and projects data onto the directions of maximum variance. In deep learning frameworks (like PyTorch and TensorFlow), tensors are generalizations of multidimensional matrices, and all forward propagation computations are essentially large-scale matrix operations. GPUs accelerate deep learning precisely because their architecture is particularly suited for parallel matrix multiplication.
The author provides a very concrete learning objective: when you see an expression like y = Xw, you should understand what this matrix/vector operation actually represents, not just how to compute it.
Notably, the author also recommends 3Blue1Brown's "Essence of Linear Algebra" video series for building visual intuition, while Khan Academy serves as the primary resource for structured learning and practice. 3Blue1Brown is a math education YouTube channel founded by Grant Sanderson, known for its unique visualization animation style. He uses Manim, a Python animation library he developed, to create geometric intuition demonstrations of mathematical concepts. The "Essence of Linear Algebra" series has 16 episodes, with the core idea of understanding linear transformations as "deformations" of space—matrices are no longer arrays of numbers but "functions" describing how space is stretched, rotated, and compressed. For example, the absolute value of the determinant represents the scaling factor of area/volume after transformation, and eigenvectors are vectors whose direction remains unchanged under the transformation. This geometric intuition is extremely helpful for understanding linear transformations in machine learning (such as fully connected layers in neural networks: z = Wx + b). This combination of "intuition + systematic training" is worth emulating.
Calculus: The Chain Rule Leads to Backpropagation
Calculus 1 also requires deep study, with focus on limits, continuity, derivatives, derivative rules, the chain rule, implicit differentiation, applications of derivatives, optimization, and integrals.
The author specifically notes that the most important parts for machine learning are: derivatives, the chain rule, optimization, and understanding what derivatives actually represent. The chain rule becomes especially critical when studying neural networks and backpropagation—this hint points directly to the mathematical cornerstone of modern deep learning.
Backpropagation, formally introduced to neural network training by Rumelhart, Hinton, and Williams in 1986, is mathematically a systematic application of the chain rule. In a multi-layer neural network, the gradient of the loss function L with respect to first-layer weights w₁ must be propagated through all intermediate layers: ∂L/∂w₁ = (∂L/∂aₙ)·(∂aₙ/∂aₙ₋₁)·...·(∂a₂/∂a₁)·(∂a₁/∂w₁). This is precisely the chain rule for multivariate composite functions. Without understanding the essence of the chain rule—that the derivative of a composite function equals the product of derivatives at each layer—one cannot truly understand the root causes of training problems like vanishing gradients and exploding gradients, nor why residual connections in ResNet help mitigate these issues.
Multivariable Calculus: The Mathematical Foundation of Gradient Descent
Multivariable calculus is a typical "selective learning" subject. The author provides clear priorities by unit:
- Unit 1 (Multivariable Functions): Learn multivariable functions, multidimensional graphs, contour maps, vector field basics
- Unit 2 (Derivatives of Multivariable Functions) — High Priority: Partial derivatives, higher-order partial derivatives, gradients, directional derivatives, multivariable chain rule. The author emphasizes that gradients are especially important—you should understand what
∇fmeans, not just how to compute it - Unit 3 (Applications of Multivariable Derivatives): Critical points, extrema, saddle points, optimization, Hessian matrix—these directly correspond to optimization problems in machine learning
- Unit 4 (Multivariable Integrals): Low priority initially, can be learned later
- Unit 5 (Green's Theorem, Stokes' Theorem, Divergence Theorem): Skip entirely at first
Gradient Descent is the most fundamental optimization algorithm in machine learning and the most direct application of multivariable calculus knowledge in ML. Its core idea: the gradient vector ∇f points in the direction of steepest increase, so updating parameters in the negative gradient direction minimizes the loss function fastest. The parameter update rule is θ_{t+1} = θ_t - η·∇L(θ_t), where η is the learning rate. The Hessian matrix (composed of second-order partial derivatives) describes the curvature of the loss function surface—its eigenvalues determine whether a point is a minimum, maximum, or saddle point. In high-dimensional parameter spaces, saddle points are more common than local minima (an important finding by Dauphin et al. in 2014), so understanding the mathematical properties of saddle points is crucial for understanding modern deep learning optimization. The design of adaptive learning rate optimizers like Adam and RMSprop is also closely related to second-order information approximation.
This unit-by-unit breakdown prevents learners from spending time on unnecessary advanced content.
Statistics and Probability: Finding the Right Path Through a Confusing Catalog
The author admits that Khan Academy's statistics catalog is "particularly confusing," with multiple seemingly overlapping courses. His advice is very clear: Just take AP/College Statistics (or its current equivalent) and that's sufficient. You don't need to separately study College Probability or Normal Probability and Statistics, as these topics are already covered in the broader statistics and probability course.
For specific statistics and probability content, the author identifies several high-priority modules:
- Summary Statistics: Mean, median, variance, standard deviation, range. The author emphasizes not memorizing formulas, but understanding what these quantities actually tell you about the data
- Percentiles, Z-scores, and Normal Distribution: Standardization, density curves
- Bivariate Data: Scatter plots, covariance, correlation, linear regression—directly relevant to understanding ML models and datasets
- Probability: Probability rules, conditional probability, independence, Bayes' theorem, addition and multiplication rules
- Random Variables and Probability Distributions: Expected value, variance, discrete and continuous variables—extremely important for understanding probabilistic machine learning
Bayes' theorem P(A|B) = P(B|A)·P(A)/P(B) is the theoretical cornerstone of probabilistic machine learning. It provides a mathematical framework for starting from prior knowledge (prior), updating beliefs (posterior) through observed data (likelihood). Naive Bayes classifiers directly apply this theorem for text classification and spam filtering. More broadly, the entire Bayesian machine learning school—including Bayesian neural networks, Gaussian processes, and variational inference—is built on this framework. The core advantage of Bayesian methods is their ability to quantify prediction uncertainty, which is especially important in safety-critical scenarios like medical diagnosis and autonomous driving. Even in the frequentist-dominated deep learning field, Bayesian thinking permeates through Dropout (proven to approximate Bayesian inference), prior regularization, and other techniques.
Statistical inference (confidence intervals, hypothesis testing, p-values) should be studied but at lower priority. The author reminds us: "You don't need to spend months mastering every statistical test before starting machine learning." Chi-square tests, ANOVA, and other advanced statistics can be learned later depending on your specific ML direction.
Conclusion: A Pragmatic Self-Study Map for ML Math
The greatest highlight of this roadmap is that it embodies a goal-oriented learning philosophy: not pursuing mathematical completeness, but pursuing what's most useful for machine learning.
The author also explicitly lists courses that are "not needed": arithmetic, pre-algebra (unless you genuinely have gaps), integrated math 1/2/3, college algebra, standalone probability courses, differential equations, multiple versions of precalculus, and test prep courses. These are either alternative courses or redundant content.
For self-learners on a budget who want to systematically build their machine learning math foundation, this completely free path offers tremendous reference value. Of course, it's worth noting that this list was generated with ChatGPT assistance. When actually studying, it's still advisable to adjust the pace based on your own situation and combine it with hands-on coding practice to solidify mathematical intuition—after all, math for machine learning is ultimately meant to be "applied," not just tested on.
Related articles

The Post-Training Data Dilemma: Quantity vs. Quality? The Diminishing Marginal Returns of Synthetic Data
Exploring the post-training data dilemma: why scaling synthetic data hits diminishing returns, and how the industry is shifting from data quantity to quality curation for SFT and RL.

5 Claude Code Productivity Tips: From Going Off-Track to Supercharged Workflow
5 battle-tested Claude Code work habits: system prompts, constraints, role assignment, phased building, and structured data to eliminate AI coding mistakes and drastically reduce rework.
Expert OpinionsRethinking Scaling Laws: Parameters Are Not the Only Answer
Deep analysis of Scaling Law evolution from Kaplan to Chinchilla to the MoE era, exploring why blindly stacking parameters is a mistake, and how GLM-5.3 proves scaling has multiple knobs.