The dot product begins as multiply matching coordinates and add. Geometrically, the same number measures alignment -- and that second reading is the one machine learning keeps using.
One operation, read from both sides. Algebraically it is a sum of coordinate products and the weighted score inside a linear model. Geometrically it carries length, angle, orthogonality and projection.
The final boards remove length with cosine similarity, then hold one dot product fixed to draw the line that leads directly into systems of equations.
There is no timer. Calculate when the board asks for arithmetic and reason from the picture when it asks for geometry. Every answer is computed from the vectors, and a miss shows which interpretation broke.
This lesson
0 of 7 challenges cleared
1 of 6
Multiply matching coordinates, then add
Two equal-length vectors go in; one scalar comes out.
The dot product pairs corresponding coordinates, multiplies each pair, and adds the products: u · v = u₁v₁ + ... + u_dv_d. For (2, -1) · (3, 4), that is 2×3 + (-1)×4 = 2.
The dimensions must match because every coordinate needs a partner. For one-dimensional NumPy arrays, u @ v, np.dot(u, v), and (u * v).sum() compute the same number.
The most common mistake is stopping after the coordinatewise products. u * v is still a vector; the final sum is what makes it a dot product.
Challenge
Multiply, Then Add
1 of 3
Compute a dot product without losing a sign.
Pair matching coordinates. The distractors stop one step early or mishandle a negative.
2 of 6
A dot product is a weighted sum
Features times weights is the smallest useful model score.
Let x hold an example's features and w hold one weight per feature. Then w · x multiplies every feature by its importance and adds the contributions into one score.
This is the arithmetic at the center of linear regression, logistic regression, and every neuron in a dense layer. Those models add a bias and possibly a nonlinear function, but the weighted sum is the part doing the combining.
If x = [hours, projects] and w = [2, 5], then w · x says one project contributes as much to the score as two and a half hours. The weights encode that tradeoff.
Challenge
Weighted Score
1 of 2
Read a model score as feature contributions.
Each row contributes value times weight. Add the signed contributions.
3 of 6
The sign tells you which way the pair leans
Positive is broadly together, zero is perpendicular, and negative is opposed.
For nonzero vectors, a positive dot product means the angle between them is acute; zero means 90 degrees; and a negative value means the angle is obtuse. The sign is often enough when the exact angle is not.
Perpendicular vectors are called orthogonal. Their positive and negative coordinate contributions cancel exactly. The zero vector has dot product zero with everything, but it has no direction, so it is not evidence of a right angle.
(2, 1) · (1, -2) = 2 - 2 = 0. Rotate either arrow even a little and the cancellation disappears.
Challenge
Read the Angle
1 of 4
Predict the sign from the geometry.
Broadly together is positive, a right angle is zero, and broadly apart is negative. Calculate only after you commit.
Challenge
Make It Perpendicular
1 of 3
Drag a nonzero vector until the dot product is zero.
The coordinate contributions must cancel. The live dot product tells you when they do.
4 of 6
Length and angle share one number
The geometric identity is u · v = ||u|| ||v|| cos θ.
The dot product grows for two reasons: the vectors may be longer, or they may point more closely together. The identity u · v = ||u||₂ ||v||₂ cos(θ) separates those effects.
When the directions agree, cos(θ) = 1. At a right angle it is zero. In opposite directions it is -1. This is the algebraic calculation and the geometric picture saying the same thing.
Doubling one vector doubles the raw dot product without changing the angle. That is why raw dot products are not pure measures of directional similarity.
5 of 6
Projection asks how much lies along a direction
Dot against a unit direction to read the component along it.
If q is a unit vector, u · q is the signed length of u along that direction. Multiply that scalar by q and you get the projected vector.
When the direction vector v is not unit length, the coefficient is (u · v) / (v · v). The extra division removes the scale that v brought with it.
Projecting onto (1, 0) keeps the horizontal coordinate and drops the vertical one. The formula is a general version of that familiar shadow.
Challenge
Read the Shadow
1 of 2
Find the coefficient of one vector along another.
Compute (u · v) / (v · v). The answer is a scalar coefficient, not a vector.
6 of 6
Remove length, then draw a level set
Cosine similarity compares direction; a · x = c collects equal scores.
Cosine similarity divides the dot product by both norms. Its range is from -1 to 1, and scaling either vector by a positive amount does not change it. Embedding search often uses it when direction matters more than magnitude.
Now hold one vector a and one score c fixed. Every point x satisfying a · x = c lies on a line perpendicular to a. Written out, that is a₁x₁ + a₂x₂ = c: exactly the equation form used in the next systems lesson.
Cosine similarity is undefined for a zero vector because its norm is zero. Embedding pipelines normally guard or filter zero vectors before ranking.
Challenge
Cosine Match
1 of 2
Choose the candidate pointing most like the query, regardless of length.
The vectors are synthetic. Compare direction; scores are revealed after your choice.
Challenge
One Score, One Line
1 of 3
Find the point whose dot product lands on the stated level.
Every point on the drawn line has the same score against its normal vector.