
Series: The Sequentia Lectures: Unlocking the Math of AI
Part 1: The Foundation – Thinking Like a Machine
Lecture 4: The Core Puzzle of AI: Learning a Function from Data
In our journey so far, we’ve established three key ideas:
- An AI model is a recipe that turns inputs into outputs.
- All inputs, from images to text, are first translated into numbers.
- These numbers can be visualized as points in a vast data landscape.
Now, we arrive at the central puzzle that drives a huge portion of modern AI, particularly “supervised learning.” What is the ultimate goal of training an AI? It’s to solve a grand game of “Guess the Rule.”
The Mystery Function: f(x) = y
In mathematics, a function is a rule that establishes a relationship between an input and a unique output. We can write this relationship as:
y = f(x)
Where:
- x is our input (the ingredients).
- y is our output (the finished dish).
- f is the function itself—the secret recipe, the set of rules, the “black box” that transforms x into y.
If we know the function, making predictions is easy. If the function is f(x) = 2x + 1, and we get an input x = 3, we can immediately calculate the output: y = 2(3) + 1 = 7.
But in the world of AI, the situation is reversed. We don’t know the function f. We don’t know the secret recipe. All we have are a lot of examples.
Learning as “Guess the Rule”
Imagine a number sequence puzzle, the very heart of Sequentia. I give you a series of pairs:
- When the input is x = 1, the output is y = 3.
- When the input is x = 2, the output is y = 5.
- When the input is x = 3, the output is y = 7.
Your brain immediately starts searching for the underlying rule, the hidden function f that connects these x and y values. You hypothesize, test, and deduce that the function is likely f(x) = 2x + 1. Once you’ve discovered this rule, you can confidently predict the output for any new input, like x = 10 (the output would be 21).
This is exactly what supervised machine learning does, but on a massive scale. The “learning” process is nothing more than this game of “Guess the Rule.”
- Training Data: The list of known examples ((x, y) pairs) that we provide to the AI. This is like the first few numbers in a sequence puzzle.
- Example: Thousands of images of cats (x) labeled with the word “cat” (y).
- Example: Historical weather data (x) paired with the actual weather that occurred the next day (y).
- Example: Details of past loan applications (x) paired with whether they were approved or denied (y).
- The AI’s Task: To analyze all this training data and find a single, consistent mathematical function, f, that best approximates the relationship between all the x’s and y’s.
What Does “Learning” Actually Mean?
When we say an AI “learns,” we mean it is running an algorithm that systematically adjusts its own internal recipe (f) to minimize errors. It makes a guess for the function, tests it against all the examples in the training data, measures how “wrong” its predictions are, and then tweaks its function to be slightly less wrong. It repeats this process millions of time, gradually refining its recipe until it becomes highly accurate at mapping the given inputs to the correct outputs.
So, when an AI “learns to identify cats,” it’s not gaining consciousness or understanding “cattiness.” It is discovering a hugely complex mathematical function, f, that takes a grid of pixel values (x) as input and, after a massive number of calculations, produces the output y = “cat”.
This reframes the entire concept of AI. It’s not magic; it’s a computational quest to solve for the unknown function f. The core puzzle of AI is to reverse-engineer the rules of the universe, one dataset at a time.
In our next lecture, we’ll finally begin this quest by looking at the simplest possible function we can learn: a straight line, in a process known as Linear Regression.