Math for Data Science

Last modified: 2026-11-03 15:17:03 (PST)

Welcome

Math is not just a way of calculating numerical answers; it is a way of thinking, using clear definitions for concepts and rigorous logic to organize our thoughts and back up our assertions.

Cheng [1]

These notes collect the mathematics that data science courses assume: mathematical notation, algebra (including exponentials and logarithms), univariate calculus, linear algebra, vector calculus, optimization, and proof writing. Some key results are listed here, organized by topic.

The first six topics are the foundations. Apart from a few remarks in Algebra that touch on calculus, they assume no calculus, so a course on discrete math, such as Math for Computer Science, can build on them directly:

The remaining topics build on the foundations and on each other:

  • Measures: \(\sigma\)-algebras, finite and countable additivity, measures, and the counting measure
  • Calculus: derivative rules, antiderivatives, regularity conditions (the continuity, differentiability, and integrability that results assume), the Fundamental Theorem of Calculus, and double integrals
  • Linear Algebra: vectors, matrices and their operations, special matrices, quadratic forms, eigendecompositions, definite matrices, determinants, and the design matrix
  • Vector Calculus: derivatives with respect to vectors and matrices, quadratic forms, and the vector chain rule
  • Optimization: optimality conditions, Taylor approximations, convexity in several variables, Lagrange multipliers, Newton’s method, and gradient descent

Further reading

These resources cover related material.

  • Mathematical Methods in Data Science (MMiDS) by Sebastien Roch (University of Wisconsin-Madison), is available online and in print from Cambridge University Press. It grew out of MATH 535, a one-semester advanced undergraduate and master’s course at the University of Wisconsin-Madison. It is written as an invitation to data science and AI for math students, and as a mathematical companion to machine learning, AI, and statistics courses. Its chapters treat least squares, optimization (finding where a function is smallest or largest), the singular value decomposition, spectral graph theory, probabilistic models, random walks on graphs, and neural networks, so they overlap with our linear algebra and vector calculus pages.

  • UCLA Biostat 216, Mathematical Methods for Biostatistics is a course for first-year biostatistics MS and PhD students at UCLA. As of October 2026, the most recent course site in the organization is the 2024 Fall edition, taught by Hua Zhou. Its schedule links slides on vectors, matrices, vector spaces, rank, orthogonal projection, matrix inverses, least squares, determinants, eigendecompositions, positive (semi)definite matrices, the SVD, and multivariate calculus and optimization. Those topics overlap with our linear algebra and vector calculus pages.

  • Calculus for Machine Learning is a YouTube playlist by Jon Krohn (56 videos as of October 2026), taken from his Machine Learning Foundations series. It includes limits, derivative rules, partial derivatives, and integrals, so it overlaps with our calculus and vector calculus pages. Those pages link the individual videos in the sections they match.

  • 3Blue1Brown playlists by Grant Sanderson produce animated visual explanations of core mathematical concepts. Recommended playlists include:

    • Essence of Linear Algebra covers vectors, linear combinations, linear transformations, matrix multiplication, determinants, inverse matrices, dot and cross products, change of basis, and eigenvectors and eigenvalues, overlapping with our linear algebra page.
    • Essence of Calculus covers limits, derivatives, product and chain rules, implicit differentiation, integration, and Taylor series, overlapping with our calculus page.
    • Neural Networks covers gradient descent and backpropagation calculus, visualizing multivariable optimization in connection with our vector calculus and optimization pages.

Using these notes in another site

Course sites link to these pages by URL; they do not include this repository as a git submodule. A host site that keeps a copy of this repository at its root, named mds, can still include fragments with paths that start with mds/, for example {{< include mds/_notation.qmd >}}. This site includes its own fragments the same way, through a mds symlink that points at the repository root.

Each page is a thin wrapper around one or more fragments:

Page Fragment(s) to include
Notation mds/_notation.qmd
Number Systems mds/_number-systems.qmd
Sets mds/_sets.qmd
Functions mds/_functions.qmd
Expressions and Algorithms mds/_expressions-algorithms.qmd
Indicator Functions mds/_indicator-functions.qmd
Algebra mds/_algebra.qmd
Measures mds/_measures.qmd
Calculus mds/_calc-derivatives.qmd, mds/_calc-integrals.qmd, and the double-integral subfiles mds/_subfiles/_*fubini*.qmd
Linear Algebra mds/_subfiles/_sec_linear_algebra.qmd
Vector Calculus mds/_subfiles/_sec_vector_calc.qmd
Optimization mds/_subfiles/_sec_optimization.qmd
Proof Writing mds/_proof-writing.qmd

_notation.qmd, _number-systems.qmd, _sets.qmd, _functions.qmd, _expressions-algorithms.qmd, _indicator-functions.qmd, _algebra.qmd, _measures.qmd, and _subfiles/_sec_linear_algebra.qmd include latex-macros/macros.qmd themselves; a host page that includes any of the other fragments must include latex-macros/macros.qmd first, as the pages of this site do.

Quarto resolves @id cross-references only within one rendered page, so a host site that links to a result here uses an explicit link, [text](notation.qmd#id).

References

[1]
E. Cheng, “Opinion | how math turned me from a D.E.I. Skeptic to a supporter,” The New York Times, 2025, Accessed: Sep. 05, 2025. [Online]. Available: https://www.nytimes.com/2025/09/05/opinion/math-dei.html