Intuitive Understanding of Dot Product & Matrix Multiplication
We use a simple house investment example to explain what a dot product means, why matrix multiplication is row × column, and what the result represents.
1. Problem
Many people struggle with three questions:
- Why is matrix multiplication row × column?
- What does a dot product really mean?
- What does the result represent?
We will explain everything using a house investment example.
2. Represent Houses as Vectors
Suppose we have 3 houses, and each house has 4 features: location, age, area, years occupied.
X =
851203
6159010
921501
(3 houses × 4 features)
| House |
Location |
Age |
Area |
Years Occupied |
| House 1 | 8 | 5 | 120 | 3 |
| House 2 | 6 | 15 | 90 | 10 |
| House 3 | 9 | 2 | 150 | 1 |
Meaning:
Each row = one house
Each column = one feature
3. Introduce a "Perspective"
Different people evaluate houses differently. For example, an investor may care more about location and area, and dislike an old house.
winvest =
0.8
−0.5
1.2
−0.1
(4 features × 1 perspective)
This means:
- location → positive
- age → negative
- area → positive
- years occupied → slightly negative
This vector is a scoring rule.
4. Dot Product (Core Idea)
Now compute House 1 · winvest:
851203
·
0.8
−0.5
1.2
−0.1
=
8×0.8 + 5×(−0.5) + 120×1.2 + 3×(−0.1)
=
147.6
Meaning of dot product:
Use one perspective to score one object.
So here, House · Investor perspective means: How valuable is this house from an investor's view?
5. Multiple Perspectives → Matrix W
In real life, we may have multiple ways to evaluate the same house, such as investment value and living comfort.
W =
0.80.6
−0.5−0.2
1.20.9
−0.10.3
(4 features × 2 perspectives)
Each column is one perspective:
- Column 1 → investment value
- Column 2 → living comfort
6. Matrix Multiplication: X @ W
Now we compute:
Y =
851203
6159010
921501
@
0.80.6
−0.5−0.2
1.20.9
−0.10.3
=
147.6112.7
104.384.6
186.1140.3
(3 houses × 2 scores)
| House |
Investment Value |
Living Comfort |
| House 1 | 147.6 | 112.7 |
| House 2 | 104.3 | 84.6 |
| House 3 | 186.1 | 140.3 |
7. Key Insight
Matrix multiplication = a batch of dot products.
Y[i][j]
=
xi1xi2···xin
·
w1j
w2j
⋮
wnj
=
housei · perspectivej
So:
- row → house
- column → perspective
- value → score
8. Why "Row × Column"?
Because we are doing this: a house (row) vs a perspective (column).
Each number in the result is one dot product between one row from X and one column from W:
851203
6159010
921501
@
0.80.6
−0.5−0.2
1.20.9
−0.10.3
→
Y[2][2] = 84.6
So row × column is not arbitrary. It naturally matches:
object × evaluation rule.
9. Unified View
- Embedding (X) → what you are
- Weights (W) → how I evaluate you
- Dot product → how valuable you are under this view
objects
851203
6159010
921501
@
0.80.6
−0.5−0.2
1.20.9
−0.10.3
perspectives
=
147.6112.7
104.384.6
186.1140.3
scores
Matrix multiplication = evaluate many objects under many perspectives.