The mathematics of machine learning becomes easier when every symbol has a job. Begin by checking vector shapes, follow a small derivative through a computation, and use probability to express uncertainty. Each lesson connects a calculation to model behaviour.
Check the shape and meaning of a vector operation.
Explain a gradient as a direction for changing a parameter.
Interpret conditional probability with a concrete example.
Spot a mathematical assumption that may fail.
[ READ · TRY · CHECK ]
Your lessons are ready.
Everything below is available without an account. Pause at each question and make a prediction before opening the answer.
01
LESSON 01 / 03
Vectors and shapes
Represent features as vectors and check whether a weighted sum is defined.
The idea
A vector groups features; its shape must match the operation.
Suppose an input has two features: hours studied and practice questions completed. Represent it as x = [3, 5]. A weight vector w = [2, 1] gives a score by multiplying matching entries and adding: 3×2 + 5×1 = 11.
The dot product needs the same number of entries in both vectors. Shapes are a useful debugging tool: write them beside every operation before calculating.
WORKED EXAMPLE
Calculate a dot product
For x = [3, 5] and w = [2, 1], x · w = 11. The score is a number, not another two-entry vector.
YOUR TURN
Can x = [3, 5, 2] use w = [2, 1] in the same dot product?
Need a hint?
Count the entries that need to be paired.
Check your answer
No. Three features need three matching weights for this dot product.
Try it further: Can a three-feature input be multiplied by a two-weight vector?
02
LESSON 02 / 03
Gradients and learning
Trace a one-parameter squared-error loss and use its derivative to make one update.
The idea
A gradient tells us how a small parameter change affects loss.
Take a tiny model prediction p = w × x and squared error L = (p − y)². If x = 2, y = 6, and w = 2, then p = 4 and L = 4. The derivative with respect to w is 2(p − y)x = −8.
A negative derivative says a small increase in w should reduce loss locally. With learning rate 0.1, one update gives w = 2 − 0.1(−8) = 2.8. This is one step, not a promise that every large step will help.
WORKED EXAMPLE
Take one learning step
At w = 2 the gradient is −8. The update increases w to 2.8, bringing the prediction closer to six.
YOUR TURN
What happens to w when the gradient is positive?
Need a hint?
Use new w = old w − learning rate × gradient.
Check your answer
For a positive learning rate, w decreases.
Try it further: If a prediction is too high, which way should a positive weight move?
03
LESSON 03 / 03
Probability and uncertainty
Distinguish a prior, a conditional probability, and the result of observing evidence.
The idea
Conditional probability asks how likely an event is after observing evidence.
A test result is not the same as the condition being tested. Imagine 100 people: 10 have a condition, and 90 do not. If a test correctly flags 8 of the 10 but also flags 9 healthy people, then 17 people test positive and only 8 of those have the condition.
So P(condition | positive) is 8/17, about 47%. This example shows why the starting frequency and false positives matter. The numbers are illustrative, not medical advice.
WORKED EXAMPLE
Count positive cases
Among 17 positive results, eight are true positives and nine are false positives.
YOUR TURN
Why is 80% sensitivity not the probability of having the condition after a positive result?
Need a hint?
Which group is in the denominator of each fraction?
Check your answer
Sensitivity uses people with the condition as its denominator. The after-positive probability uses everyone who tested positive.
Try it further: Why can a positive test still leave uncertainty when a condition is rare?
[ PUT IT TO WORK ]
Explain a tiny classifier
Build a one-page explanation of a two-feature classifier: show feature meanings, calculate a score, and describe one failure case.
Check your work
The vector and weight shapes match.
Each arithmetic step is visible.
The uncertainty or limitation is stated.
[ GO DEEPER / FOLLOW THE SOURCE ]
Further reading
These sources support further study. The lessons above are original AI Ka School material.