All courses

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. 1.1

    Mean, Median and Mode

    Measures of the centre, and when each misleads

    Code: compare the measures on skewed data

    x̄ = Σxᵢ / n

    10 min Read
  2. 1.2

    Variance and Standard Deviation

    How spread out values are

    Code: compare two classes with the same mean

    σ² = Σ(xᵢ − x̄)² / n

    10 min Read
  3. 1.3

    Percentiles, Quartiles and Outliers

    Box plots and the 1.5 × IQR rule

    Code: find outliers in salaries

    IQR = Q3 − Q1

    8 minBeing written
  4. 1.4

    Correlation

    Measuring how two variables move together, and why correlation is not causation

    Code: correlation heatmap

    r = cov(X,Y) / (σₓσᵧ)

    10 min Read

Chapter 2 Probability

  1. 2.1

    Probability Basics

    Events, outcomes and simple probability

    Code: simulate dice rolls

    P(A) = favourable / total

    10 min Read
  2. 2.2

    Conditional Probability

    Probability when we already know something

    Code: spam given a word

    P(A|B) = P(A∩B) / P(B)

    10 min Read
  3. 2.3

    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)

    12 min Read
  4. 2.4

    Probability Distributions and the Normal Curve

    Uniform, binomial and normal distributions, and z-scores

    Code: simulate heights

    z = (x − μ) / σ

    12 min Read

Chapter 3 Linear Algebra

  1. 3.1

    Vectors and Matrices

    How data becomes rows and columns of numbers

    Code: represent students as vectors

    10 min Read
  2. 3.2

    Vector Operations and the Dot Product

    Adding, scaling and comparing vectors

    Code: similarity between two users

    a·b = Σ aᵢbᵢ

    10 min Read
  3. 3.3

    Distance and Similarity

    Euclidean distance and cosine similarity

    Code: find the most similar document

    d = √Σ(aᵢ − bᵢ)²

    10 min Read
  4. 3.4

    Matrix Multiplication

    Combining tables, as every neural network layer does

    Code: a bill for many customers at once

    (AB)ᵢⱼ = Σ AᵢₖBₖⱼ

    10 min Read

Chapter 4 Calculus Intuition

  1. 4.1

    Functions and Graphs

    Inputs, outputs and the shape of a function

    Code: plot common functions

    8 minBeing written
  2. 4.2

    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

    10 min Read
  3. 4.3

    Gradients and Gradient Descent

    Walking downhill to make an error smaller

    Interactive: roll a ball to the bottom of a curve

    θ ← θ − η∇L

    12 min Read Activity
  4. 4.4

    Module Review and Assessment

    Worked problems and a scored quiz

    Graded problem set

    15 minBeing written