Most of us tend to use AI frequently as part of our everyday lives. But do you know how it works? Behind the curtain of ChatGPT’s seemingly human brilliance isn’t a thinking, feeling mind – it’s applied mathematics at work.
Artificial Intelligence runs entirely on four foundational mathematical pillars: Linear Algebra, Calculus, Probability, and Statistics. Together, they allow an AI model to structure complex data, learn from its own mistakes, handle real-world uncertainty, and make accurate predictions.
Linear Algebra in AI
Linear Algebra studies vectors, matrices and linear equations including how they relate to one another. AI uses vectors and matrices to store, structure and manipulate data. For example, AI can use vectors to convert words into a list of numbers, or matrices to store digital pictures where each pixel is an element.
To represent videos, you use tensors. A scalar is a 0D tensor, a vector is a 1D tensor, a matrix is a 2D tensor and 3D tensor is like a 3D array which you can capture every feature of a video.
Calculus in AI
Calculus studies continuous change and motion. Calculus is how AI improves its performance. When a model is first built, its settings, called weights, are completely random, meaning its answers are mostly wrong. Calculus is used to systematically reduce those errors.
To do this AI uses:
- Loss functions – formulas that calculate how far off the AI’s prediction was from the true answer.
- Derivatives and Gradients – Help calculate for what values of the weight you’ll get the lowest margin for error.
- Gradient Descent – The ultimate optimisation algorithm. It works like hiking down a foggy mountain in the dark. By checking the steepness, slope, of the ground under your feet using derivatives, you can take small steps downward until you reach the lowest point – the valley of minimal error.
Probability in AI:
Probability measures how likely an event is to happen. Real-world data is inherently messy, incomplete, and full of random noise. AI uses probability to manage this uncertainty and make calculated guesses. It can use probability distributions, which are graphs that show the likelihood of different outcomes, as well as Bayes’ Theorem to update its beliefs when it encounters new evidence.
For instance, when an AI classifies an image, it outputs a distribution: 85% chance it’s a cat, 10% chance it’s a dog, 5% chance it’s a fox.
Or for Bayes’ Theorem, if an autonomous vehicle sees a blurry circular shape ahead, it updates its probability calculations as it gets closer and receives sharper camera data.
Statistics in AI:
A key use of using statistics in AI is to help optimise the Bias-Variance problem.
When an AI model has too much bias, it makes errors caused by overly simplistic assumptions, for example trying to fit a straight line to curved data, leading to underfitting.
When an AI model has too much variance, it makes errors caused by a model being overly sensitive to small fluctuations and noise in the training set, leading to overfitting.
Usually, a higher bias means lower variance and vice versa. Therefore, we need to use statistics to find the precise balance of both of these concepts that will ensure the AI model picks up patterns and can generalise them to apply it outside the training data and onto real data.
Another way statistics is used in AI is to simplify a dataset with a huge number of variables, dimensions, and shrinking it down to a smaller, more manageable number of variables while keeping as much of the original information and pattern as possible. This is known as dimensionality reduction and is most commonly solved with a statistical technique known as PCA, Principal Component Analysis.

As we look toward an era of increasingly autonomous systems, it is comforting to remember that AI is not a ghost in the machine. It is a mirror. Every breakthrough in artificial intelligence is, at its core, a breakthrough in human mathematics. The ‘magic’ we see today is simply the spectacular result of humanity using the oldest tool it has – numbers – to build the newest world it can imagine!