Intermediate · module I3
Mathematics for AI
By the end: Calculate and interpret the key statistics, probabilities, vector operations and slopes that machine learning relies on
- Covers
- The statistics, probability, linear algebra and calculus ideas behind AI, each explained in words before any formula
- Contents
- 4 chapters, 16 topics
- Time
- About 3 hours
- Level
- Intermediate
- Your progress
- 0 / 16
This module builds on Python Programming for AI. We suggest looking at it first, but the choice is yours.
Chapter 1 Statistics
- 1.110 min Read
Mean, Median and Mode
Measures of the centre, and when each misleads
Code: compare the measures on skewed data
x̄ = Σxᵢ / n
- 1.210 min Read
Variance and Standard Deviation
How spread out values are
Code: compare two classes with the same mean
σ² = Σ(xᵢ − x̄)² / n
- 1.38 minBeing written
Percentiles, Quartiles and Outliers
Box plots and the 1.5 × IQR rule
Code: find outliers in salaries
IQR = Q3 − Q1
- 1.410 min Read
Correlation
Measuring how two variables move together, and why correlation is not causation
Code: correlation heatmap
r = cov(X,Y) / (σₓσᵧ)
Chapter 2 Probability
- 2.110 min Read
Probability Basics
Events, outcomes and simple probability
Code: simulate dice rolls
P(A) = favourable / total
- 2.210 min Read
Conditional Probability
Probability when we already know something
Code: spam given a word
P(A|B) = P(A∩B) / P(B)
- 2.312 min Read
Bayes' Theorem
Updating a belief with new evidence, using a medical test example
Code: the rare-disease test
P(A|B) = P(B|A)P(A) / P(B)
- 2.412 min Read
Probability Distributions and the Normal Curve
Uniform, binomial and normal distributions, and z-scores
Code: simulate heights
z = (x − μ) / σ
Chapter 3 Linear Algebra
- 3.110 min Read
Vectors and Matrices
How data becomes rows and columns of numbers
Code: represent students as vectors
- 3.210 min Read
Vector Operations and the Dot Product
Adding, scaling and comparing vectors
Code: similarity between two users
a·b = Σ aᵢbᵢ
- 3.310 min Read
Distance and Similarity
Euclidean distance and cosine similarity
Code: find the most similar document
d = √Σ(aᵢ − bᵢ)²
- 3.410 min Read
Matrix Multiplication
Combining tables, as every neural network layer does
Code: a bill for many customers at once
(AB)ᵢⱼ = Σ AᵢₖBₖⱼ
Chapter 4 Calculus Intuition
- 4.18 minBeing written
Functions and Graphs
Inputs, outputs and the shape of a function
Code: plot common functions
- 4.210 min Read
Slope and the Derivative
How fast a value changes, in pictures first
Code: estimate a slope numerically
f′(x) ≈ (f(x+h) − f(x)) / h
- 4.312 min Read Activity
Gradients and Gradient Descent
Walking downhill to make an error smaller
Interactive: roll a ball to the bottom of a curve
θ ← θ − η∇L
- 4.415 minBeing written
Module Review and Assessment
Worked problems and a scored quiz
Graded problem set