heading · body

YouTube

Why Mathematics Is the Foundation of Artificial Intelligence | AI Mathematics Explained

Dinesh Paudel published 2026-06-02 added 2026-06-04 score 5/10
mathematics artificial-intelligence machine-learning linear-algebra calculus probability deep-learning
watch on youtube → view transcript

ELI5 / TLDR

AI looks like it understands things, but underneath it is just doing arithmetic on enormous lists of numbers. This lecture walks through the handful of maths topics that do all the actual work: turning data into numbers, measuring how similar things are, handling uncertainty, and nudging the machine toward fewer mistakes. The big claim is that if you only learn the buttons (the code libraries) you can run AI, but if you learn the maths you can actually fix it when it breaks. It is a survey, not a deep dive — a map of the territory rather than a hike through it.

The Full Story

The whole talk rests on one flat, slightly deflating fact. A machine that writes essays and recognises faces does not know anything. It moves numbers around.

AI systems do not think like humans… Instead, AI systems work through mathematical operations.

When a chatbot picks its next word, it is not reaching for the right word the way you would. It is doing a calculation: given everything before this, which word is statistically most likely? That is the spine of the whole subject. Behind the magic is bookkeeping.

Step one: turn the world into numbers

A computer cannot see a photo. It sees a grid of numbers, one per pixel. This is the job of the first maths topic, linear algebra — the algebra of lists and grids of numbers.

The vocabulary here is just a ladder of “how many dimensions.”

  • A single number — your height, say — is a scalar.
  • A list of numbers — height, weight, age, exam score for one student — is a vector. Think of it as a row in a spreadsheet describing one thing.
  • A grid of numbers is a matrix. A black-and-white photo is exactly this: a table where each cell holds how bright that pixel is.
  • Stack grids into higher dimensions and you get a tensor. A colour image is three grids (red, green, blue) stacked. A video adds time on top. Each extra “and also…” is another dimension.

Inside a neural network, almost everything reduces to one small formula, repeated billions of times:

Y equals W * X + B. Here X is the input data, W is the weight matrix, B is the bias, and Y is the output.

Imagine each layer of the network as a machine that takes your numbers (X), stretches and rotates them by some learned amounts (W), shifts them a little (B), and hands the result forward (Y). Stack enough of these simple stretch-and-shift steps and you can approximate astonishingly complicated patterns.

Step two: measure similarity by direction

Here geometry stops being triangles and becomes something stranger. If a word like king is a vector — a list of numbers — and queen is another vector, you can ask how close they point. Words with related meanings end up pointing in similar directions. King and queen sit near each other; car and banana point off in unrelated directions.

The tool for this is cosine similarity, which ignores how long two vectors are and only checks whether they aim the same way. Think of two arrows: it does not care how big they are, only the angle between them. That single idea quietly powers search engines, recommendations, and plagiarism checkers — all of them just measuring angles between meanings.

Closely related is graph theory, the maths of dots and the lines connecting them (nodes and edges). Lots of the real world is not a pile of separate data points but a web of relationships — users and the products they buy, people and their friendships. Once you draw it as a graph, you can recommend a product because people near you in the web liked it.

Step three: cope with uncertainty

Real data is messy — noisy, incomplete, never guaranteed. So AI leans on probability to reason about chances (“how likely is this email spam?”) and on statistics to summarise the past (averages, spread, correlation).

Two ideas get named. Conditional probability is the chance of something given that something else already happened. And Bayes’ theorem is the rule for updating a belief when fresh evidence arrives — start with a hunch, see new data, revise. A spam filter does exactly this, raising or lowering its suspicion word by word.

There is also a cousin called information theory, which makes a lovely observation: information and surprise are the same thing. A fact you already expected tells you nothing; a shocking one tells you a lot. Entropy is the number that measures how uncertain or random a situation is — high when anything could happen, low when one outcome is nearly certain. The same idea, dressed as “cross entropy,” becomes the scorecard that punishes a model for being confidently wrong.

Step four: learn by rolling downhill

This is the engine room, and it runs on calculus — the maths of change.

Training works like this. The model guesses, compares its guess to the right answer, and the gap is the loss (the error). The whole goal is to shrink that loss. But the model has millions of dials (weights), so which way should each one turn?

Picture the loss as a landscape — a hilly terrain where height means error. You want to reach the lowest valley. Standing anywhere on that terrain, the gradient tells you which way is steepest uphill. So to reduce error, you step the other way — downhill. That is gradient descent, captured in one rule:

new weight equals old weight minus learning rate times gradient.

The learning rate is just your step size. Tiny steps and you crawl for ages; giant steps and you overshoot the valley and never settle.

One wrinkle: the credit for a mistake has to be shared backwards across every layer that contributed to it. The chain rule — a calculus tool for change-within-change — does this accounting, and the process is called back propagation. It is the reason deep learning works at all.

The catch is that the landscape is rarely a single clean valley. It has many dips. A local minimum is a dip that looks lowest from where you stand but isn’t the true bottom. Fancier optimisers — names like SGD, Adam, RMSProp get dropped — are smarter ways of wandering this terrain without getting stuck.

Step five: make it survive a real computer

Maths on paper assumes perfect, infinitely precise numbers. Real chips have limited memory and precision. Numerical methods bridge that gap — approximating smooth curves with finite points, keeping numbers from growing too huge or too tiny (overflow and underflow), and breaking big matrices into cheaper pieces so a GPU can chew through them.

The closing message is the through-line of the whole hour. None of these fields works alone; AI is all of them braided together. And the payoff of learning them is diagnostic power. When a model misbehaves, the useful questions — Is the data normalised? Is the learning rate too high? Is the gradient vanishing? Is it overfitting? — are maths questions wearing programming clothes.

Artificial intelligence is not just code. It is mathematics expressed through code.

Key Takeaways

  • AI does not reason; it computes. A language model picks the next word by probability, not meaning.
  • Linear algebra is the data-storage layer: scalar (one number) → vector (a list) → matrix (a grid) → tensor (a stack of grids). Images are matrices; videos are tensors.
  • The core neural-network operation is Y = W·X + B — stretch the input by weights, shift by a bias, repeat across layers.
  • Cosine similarity measures meaning by the angle between vectors, ignoring their length; it underpins semantic search and recommendations.
  • Embedding space: related concepts (king/queen) sit close together as vectors; unrelated ones (car/banana) sit far apart.
  • Graph theory models relationships (users–products, people–friendships) rather than isolated points, driving recommendation engines.
  • Probability handles future uncertainty; statistics summarises past data. Bayes’ theorem updates a belief when new evidence arrives.
  • Entropy = a measure of uncertainty/surprise. Predictable events carry little information; surprising ones carry more. Cross-entropy loss punishes confident wrong answers.
  • Gradient descent trains models: new weight = old weight − learning rate × gradient. The gradient points uphill, so you step the opposite way.
  • The learning rate is step size — too small is slow, too large overshoots.
  • Back propagation uses the calculus chain rule to assign blame for error across every layer.
  • A local minimum is a false bottom; advanced optimisers (SGD, Adam, RMSProp) help escape it.
  • Numerical methods translate ideal maths onto real hardware — managing precision, overflow/underflow, and matrix decomposition on GPUs.

Claude’s Take

This is a competent classroom survey, clearly built from lecture slides, aimed squarely at students who are about to start an AI course and want the lay of the land before the equations arrive. As a map, it is genuinely good — the ordering (represent → measure → handle uncertainty → optimise → run on hardware) is the right mental scaffold, and the “AI computes, it does not think” framing is the correct deflationary starting point.

What it is not is deep. Every concept gets named and gestured at, but almost nothing gets worked through. You will leave knowing that the chain rule powers back propagation, but not what the chain rule actually does to a number. That is fine for what this is — an overview — but it means the title oversells slightly. It is “here are the maths topics AI uses,” not “here is the maths of AI.”

Two small quality notes. The transcript is clearly auto-generated and garbles a few terms (“Base theorem” is Bayes’, “atom” is Adam, “noral/newer networks” is neural networks) — the underlying lecture is correct, the captions aren’t. And the content is entirely conventional; there is nothing here a dozen other intro videos don’t also say. A 5: accurate, well-sequenced, and a fine first orientation, but it ferments nothing and surprises no one. If you already know what a vector and a gradient are, you can skip it.

Further Reading

  • 3Blue1Brown — “Essence of Linear Algebra” and “Neural Networks” series (YouTube) — the gold standard for seeing these ideas; does the visual deep-dive this lecture only points at.
  • Gilbert Strang — Introduction to Linear Algebra — the canonical text for the first pillar.
  • Michael Nielsen — Neural Networks and Deep Learning (free online) — works through back propagation and gradient descent slowly, with intuition first.
  • Goodfellow, Bengio & Courville — Deep Learning — the comprehensive reference; the early chapters cover exactly this maths foundation.