Mathematical Foundations for Computer Science and AI

Build mathematical fluency for programs, algorithms, data, and learning systems. Start with precise notation, then follow the CS or AI route.

32 modules328 hoursEN / 中文

Start here

Entry diagnostic · Optional algebra refresher · Python lab primer · NumPy array preparation

All 32 modules, including both capstone projects, are available in English and Simplified Chinese.

How to study

Predict before calculating. State the domain, show intermediate steps, and explain why an answer is valid. Modules 01–30 combine worked examples, three runnable labs, exercises with complete solutions, an interactive explorer and a ten-question review. The capstones provide implemented reference projects, proof obligations, actual outputs and assessment rubrics. Progress and written reviews are saved in this browser.

Choose a route

RouteModuleshours
Full foundation01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32328
CS core01, 02, 03, 04, 05, 06, 07, 08, 21, 22, 23, 24, 31120
AI foundation01, 02, 03, 04, 05, 06, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32286
Preparation for the existing AI series01, 02, 03, 04, 05, 09, 10, 11, 12, 13, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25192

Hours cover the full curriculum; probability has a discrete CS branch and a continuous AI branch. The complete syllabus records conditional prerequisites and optional extensions.

Detailed curriculum and production plan (English) · Roadmap metadata

The modules

Module 01
Mathematical language numbers and functions
Mathematical objects and number systems: natural numbers with an explicit zero convention, integers, rationals, reals, and a preview of complex numbers. Symbols, equality, inequalities, indexed notation, intervals, absolute value, and the difference between an assignment and an equation.
Available · 6 hours
Module 02
Logic quantifiers and specifications
Propositions and Boolean connectives, with truth-table semantics. Implication, equivalence, necessary/sufficient conditions, converse, inverse, and contrapositive.
Available · 8 hours
Module 03
Sets relations and discrete structures
Membership, subsets, power sets, complements relative to a universe, and Cartesian products. Set identities and their proof by membership or logical equivalence.
Available · 8 hours
Module 04
Proof methods induction and invariants
Theorems, hypotheses, conclusions, lemmas, and the role of definitions. Direct proof, cases, contrapositive, and contradiction.
Available · 10 hours
Module 05
Counting combinatorics and finite probability
Addition and multiplication rules, decision trees, and disjointness assumptions. Permutations with and without repeated objects.
Available · 8 hours
Module 06
Sequences sums asymptotics and recurrences
Arithmetic and geometric sequences, finite sums, and telescoping. Growth rates, logarithm bases, and comparison of polynomials and exponentials.
Available · 10 hours
Module 07
Graphs trees and state transitions
Directed/undirected graphs, vertices, edges, degrees, paths, walks, and representations. Degree sums, connectivity, cycles, and simple counting arguments.
Available · 8 hours
Module 08
Modular arithmetic and algebra for computing
Divisibility, primes, factorisation, and the division algorithm. Euclid's algorithm and its invariant; extended Euclid and Bézout coefficients.
Available · 8 hours
Module 09
Vectors geometry and array notation
Scalars, vectors, coordinates, features, and points versus displacements. Addition, scalar multiplication, linear combinations, lines, and affine combinations.
Available · 8 hours
Module 10
Matrices linear maps and linear systems
Matrices as linear transformations and data tables; columns as images of basis vectors. Products, transpose, identity, diagonal and block matrices, and non-commutativity.
Available · 10 hours
Module 11
Vector spaces bases rank and identifiability
Vector spaces and subspaces; closure and examples involving functions or polynomials. Span, dependence, independence, and redundant representations.
Available · 10 hours
Module 12
Orthogonality projections and least squares
Inner products and orthogonality; weighted inner products as an extension. Projection onto a vector and onto a subspace.
Available · 10 hours
Module 13
Eigenvalues spectral geometry and quadratic forms
Eigenvectors as invariant directions; characteristic equations in two dimensions. Diagonalisation, defective matrices, and the role of complex eigenvalues.
Available · 10 hours
Module 14
SVD low rank approximation and PCA
Singular values, left/right singular vectors, and full versus reduced SVD. Rotation/reflection–scaling–rotation geometry for rectangular matrices.
Available · 10 hours
Module 15
Limits continuity and convergence
Sequences, convergence, boundedness, and monotone convergence examples. Function limits, one-sided limits, and algebraic limit laws with conditions.
Available · 8 hours
Module 16
Derivatives Taylor approximation and sensitivity
Derivatives as local linear approximations and rates of change. Derivatives of powers, exponentials, logarithms, sine, and cosine, with domains.
Available · 10 hours
Module 17
Integration accumulation and simple differential equations
Riemann sums, signed area, accumulation, and the distinction between a definite integral and an antiderivative. Fundamental theorem of calculus and basic antiderivatives.
Available · 10 hours
Module 18
Multivariable derivatives matrix calculus and automatic differentiation
Functions of several variables, partial derivatives, level sets, and directional derivatives. Total differentials and gradients; differentiability versus existence of partial derivatives.
Available · 12 hours
Module 19
Convexity gradient methods and unconstrained optimisation
Objectives, feasible domains, minimisers, infima, and local/global optima. Convex sets/functions, Jensen's inequality, and first/second-order characterisations where applicable.
Available · 12 hours
Module 20
Constrained optimisation Lagrange multipliers and duality
Equality/inequality constraints, feasible sets, active constraints, and projection. Equality-constrained extrema and Lagrange multipliers, including constraint-qualification caveats.
Available · 12 hours
Module 21
Probability models conditioning and Bayes rule
Probability models, events, axioms, complements, and countable additivity at an introductory level. Uniform versus non-uniform outcomes; union bounds and event inclusion–exclusion.
Available · 10 hours
Module 22
Random variables distributions and transformations
Random variables as functions on a sample space; support and distribution. Discrete PMFs and CDFs; Bernoulli, categorical, binomial, geometric, and Poisson models.
Available · 10 hours
Module 23
Expectation joint distributions covariance and dependence
Expectation as a weighted sum or integral; expectation of a function. Variance, standard deviation, moments, and existence conditions.
Available · 10 hours
Module 24
Limit theorems concentration and Monte Carlo
Sampling assumptions, independence, identical distribution, and what changes under dependence. Markov/Chebyshev inequalities and a complete elementary proof of Chebyshev.
Available · 10 hours
Module 25
Estimation likelihood and Bayesian updating
Statistical models, parameters, samples, estimators, and identifiability. Likelihood versus probability as a function of different arguments; log-likelihood and independent sample factorisation.
Available · 12 hours
Module 26
Statistical inference experiments and regression
Sampling distributions, standard errors, confidence intervals, and coverage by repeated sampling. Null hypotheses, test statistics, significance, power, effect sizes, and p-value interpretation.
Available · 12 hours
Module 27
Information theory entropy and probabilistic objectives
Surprisal, coding intuition, logarithm bases, and units of bits/nats. Discrete entropy, conditional entropy, and chain rules.
Available · 10 hours
Module 28
Stochastic optimisation regularisation and training dynamics
Expected risk versus empirical risk, finite dataset objectives, and stochastic gradient estimates. Sampling with/without replacement, batch size, gradient variance, and correlation.
Available · 12 hours
Module 29
Numerical computation conditioning and reliable experiments
Floating-point representation, rounding, machine epsilon, overflow/underflow, and representable spacing. Absolute/relative error, catastrophic cancellation, stable summation, and safe comparisons.
Available · 12 hours
Module 30
Generalisation kernels and mathematical learning theory
Hypothesis classes, empirical/population risk, and the i.i.d. sampling assumption. Fixed-model concentration versus a uniform statement over a finite class; use a union bound and Hoeffding.
Available · 12 hours
Module 31
CS capstone verified dependency planner
build a small planner for tasks with prerequisites and finite random duration models. It must either return a valid dependency order and predicted completion times or provide a cycle witness. Use a DAG model with unlimited parallel workers for critical-path calculations; do not imply this solves a resource-constrained scheduling problem
Available · 14 hours
Module 32
AI capstone a learning pipeline with mathematical checks
implement and explain a small binary classifier from data generation to an honest final evaluation. Include ill-scaled and nearly dependent features so the mathematics predicts failures that the learner must then repair. No GPU, paid API, or external dataset is required
Available · 16 hours