Projection and Components
Projection answers a simple question:
How much of one vector lies
along another direction?
If is a unit vector, the projection of onto is:
The number is the scalar component of along .
Scalar Component Versus Projected Vector
The scalar component is a number.
The projected vector is a vector.
For:
a = [4, 3]
u = [1, 0]
the scalar component is:
and the projected vector is:
Let a = [4, 3] and let u = [1, 0].
What is proj_u(a)?
Compute it first, then check your number.
HintHorizontal axis
u is already a unit vector along the horizontal axis.
SolutionHorizontal projection
The direction u = [1, 0] is already unit length. First measure the scalar
component:
Then multiply by the direction to get the projected vector:
For a = [4, 3] and u = [1, 0], what is the scalar component ?
Compute it first, then check your number.
HintOne number
Compute the dot product .
SolutionScalar component
The scalar component is the dot product with the unit direction:
This answer is a number. The projected vector would be [4, 0].
Projection Onto a Non-Unit Vector
If the direction vector is not unit length, use:
The denominator corrects for the length of .
Let a = [6, 2] and b = [2, 0]. What is ?
Compute it first, then check your number.
HintUse the full formula
Compute and , then multiply the ratio by .
SolutionProjection with non-unit b
Because b is not unit length, divide by b dot b:
The scalar multiplier is 12 / 4 = 3, so:
Why Projection Matters
Projection appears whenever we keep one part of a signal and ignore another.
In ML, projections appear in:
- linear layers
- attention query, key, and value maps
- dimensionality reduction
- components of a vector along a direction
Projection is not just a picture. It is a way to extract a measurable part.
Projection also tells you what is left out. If you subtract the projected vector from the original vector, the remainder is the residual. For ordinary Euclidean projection, that residual is orthogonal to the direction you kept.
This matters because many ML operations keep a useful component and discard the rest. A good projection question is therefore two-sided:
What did we keep?
What did we remove?
Let a = [4, 3] and let u = [1, 0]. The projection of a onto u is
[4, 0].
What is the residual a - proj_u(a)?
Compute it first, then check your number.
HintOriginal minus kept part
Compute [4, 3] - [4, 0].
SolutionThe discarded component
The projection kept the horizontal component. The residual is the vertical component.
Before Moving On
Projection turns direction into measurement. It tells how much of a vector is visible from a chosen direction.