Skip to content
BENIBIX Learn

Dot Product

General🔢 Math & StatisticsLinear Algebra

Also known as Scalar Product, Inner Product

Times each pair of numbers in two lists. Then add it all up.

Think of it like

Think of it like a shop bill. You times each price by how many you got, then add it all up.

Example

A neuron has inputs [0.9, 0.8] and weights [2.0, 1.5]. The dot product is 0.9 × 2.0 + 0.8 × 1.5, which is 3.0.

Why it matters

It is the most used sum in AI. Every neuron does one, and search finds close matches with it.

Definition

The dot product turns two vectors of the same length into one number. You multiply the numbers in each matching place, then add up the results. For [1, 2] and [3, 4], that is 1 × 3 + 2 × 4, which is 11. A large result means the two vectors point the same way. Neurons use it to weigh their inputs, and search uses it to find items that are alike.
Match the places, multiply each pair, then add. Two lists go in and one number comes out.

Common mistake

Using it on lists of different lengths. Each number needs a partner in the same place in the other list.

Key takeaways

  1. 1
    Pair them up. Same place in each list.
  2. 2
    Multiply, then add. One number comes out.
  3. 3
    Measures match. Big means they point the same way.

Compare