High-School Refresher — Cheat Sheet
Math for AI · 3 topics. Download the PDF or the Instagram carousel and share it.
Cheat Sheet · AiCanCode.org
High-School Refresher
Math for AI3 topicsQuick revision reference
1
Do You Need a PhD? The AI-Math Mindset
You do not need a PhD in mathematics to be a strong AI engineer — you need a solid, intuition-first grasp of a handful of topics and the ability to connect each one to what a model actually does.
- ✓No PhD required — intuition + code + knowing where each topic is used is enough to start
- ✓Top priority: Linear Algebra, Calculus, Probability & Statistics
- ✓Libraries do the heavy computation; you supply the understanding
- ✓Always ask "what is this measuring/doing?" before memorising notation
The map: math topic → where it shows up in AI
Linear Algebra -> data as vectors/matrices, embeddings, every neural-net layer Calculus -> how a model learns (gradients, backpropagation) Probability -> reasoning under uncertainty, LLM next-token sampling Statistics -> evaluating models, understanding data Optimization -> training efficiently (gradient descent, Adam) Information Theory-> loss functions (cross-entropy), comparing distributions Discrete Math -> algorithms, knowledge graphs, search Graph Theory -> graph neural nets, recommendations
2
Functions, Graphs & Coordinate Geometry
A function is a machine that maps inputs to outputs; a graph is its picture — and a neural network is just a very large, learnable function.
- ✓A function maps inputs to outputs; its graph is that mapping drawn out
- ✓y = wx + b: slope=weight, intercept=bias — the core of a linear layer
- ✓Non-linear functions (ReLU, sigmoid) let networks fit curved data
- ✓Reading a graph = predicting a function's behaviour without computing every point
y = wx + b — one line, two learnable numbers
import numpy as np w, b = 2.0, 1.0 # weight (slope), bias (intercept) x = np.linspace(-3, 3, 7) # inputs: -3, -2, ... 3 y = w * x + b # the line / a linear neuron print(y) # [-5. -3. -1. 1. 3. 5. 7.] # Change w -> steeper line; change b -> whole line moves up/down. # Training a model = searching for the w and b that fit the data.
3
Exponents, Logarithms & Summation Notation
Exponentials grow explosively, logarithms tame that growth back down, and the Σ (sigma) symbol is just a for-loop — three notations you will meet on every page of AI math.
- ✓e^x grows fast and stays positive; log is its inverse and compresses scale
- ✓ML uses log-probabilities to avoid underflow and to shape loss functions
- ✓Σ (sigma) means "iterate and add" — a for-loop in disguise
- ✓log turns products into sums, which is why log-likelihood is everywhere
log turns "multiply many small numbers" into "add"
import numpy as np p = np.array([0.9, 0.2, 0.01]) # three probabilities print(np.log(p)) # [-0.105 -1.609 -4.605] (more negative = more surprising) # multiplying probabilities vs adding their logs (same ranking, safe math): print(np.prod(p)) # 0.0018 print(np.exp(np.sum(np.log(p)))) # 0.0018 -> log-sum then exp recovers it
Learn this free with Aria, your AI tutor → AiCanCode.org/learn/math-for-ai