~/writing/math-foundations-for-reasoning-models $ ls
Geometry of Data
Dot Product
The dot product combines two vectors into one number that reflects alignment.
~/writing/math-foundations-for-reasoning-models $ cat topic.md
Dot Product
Definition
The dot product combines two vectors into one scalar.
Example:
a = [2, 3]
b = [4, 5]
Multiply matching components and add:
dot(a, b) = 2*4 + 3*5
= 8 + 15
= 23
Dot product = multiply matching components, then add.
Same Dimension Requirement
The dot product requires vectors with the same dimension.
Valid:
dot([2, 3], [4, 5])
Invalid:
dot([2, 3], [4, 5, 6])
The components do not match.
Dot product requires aligned components.
Dot Product As Component Agreement
The dot product grows when matching components point in the same sign direction.
Example:
dot([2, 3], [4, 5]) = 23
Both vectors have positive components, so their component products add positively.
Opposite signs reduce the dot product:
dot([2, 3], [-4, -5])
= 2*(-4) + 3*(-5)
= -8 - 15
= -23
Dot product reflects component-level agreement or opposition.
Dot Product And Alignment
The dot product is connected to direction.
If two vectors point in similar directions, the dot product tends to be positive.
Example:
dot([1, 0], [2, 0]) = 2
If they point in opposite directions, it tends to be negative.
Example:
dot([1, 0], [-2, 0]) = -2
If they are perpendicular, it is 0.
Example:
dot([1, 0], [0, 1]) = 0
Dot product helps measure directional alignment.
Dot Product Depends On Magnitude
Dot product is affected by vector size.
Example:
dot([1, 0], [2, 0]) = 2
dot([1, 0], [20, 0]) = 20
Both second vectors point in the same direction.
But the larger one gives a larger dot product.
Dot product mixes direction and magnitude.
Dot Product With Unit Vectors
When vectors are normalized to unit length, the dot product focuses on direction.
Example:
dot([1, 0], [1, 0]) = 1
dot([1, 0], [0, 1]) = 0
dot([1, 0], [-1, 0]) = -1
These values represent:
same direction
perpendicular direction
opposite direction
Unit vectors make dot product easier to interpret as alignment.
Why Dot Product Matters
Dot product is one of the simplest ways to compare vectors.
It answers:
How much do these vectors point together?
How much does one vector align with another?
How much does one vector contribute in another direction?
This leads into angle, orthogonality, projection, and similarity.
Dot product turns vector alignment into a number.
Final Summary
- Dot product multiplies matching components and adds.
- It returns one scalar.
- It requires vectors with the same dimension.
- Positive values suggest alignment.
- Negative values suggest opposition.
- Zero can indicate perpendicular directions.
- Dot product depends on both direction and magnitude.
~/writing/math-foundations-for-reasoning-models $ open
Continue the series.
Angle Between Vectors