Tech News
← Back to articles

An Illustrated Introduction to Linear Algebra, Chapter 2: The Dot Product

read original related products more articles

Back to chapter 1

Picking a city

When my wife and I were deciding which city to live in, we made a list of cities, and scored each city based on some criteria. Here’s San Francisco and Minneapolis, for example, on weather and affordability.

You can see we loved the weather in San Francisco, but Minneapolis was way cheaper to live in. After this was done, we just added up the columns to figure out which city to live in!

Here’s the thing, though: I really liked the weather in San Francisco. I wanted some way to do this calculation, but have the weather matter more. Well, I could do that by using weights.

If I wanted the weather to matter 10% more, I could multiply by 1.1 before doing the addition.

(I also multiplied the affordability by 1 to show that I’m keeping it the same).

This is the essence of what a dot product is! Earlier I was adding up the numbers. Now I’m weighting the numbers before I add them

A dot product is a type of weighted sum.

Dot product using vectors

... continue reading