Dot product of vectors

  • linear algebra (vectors)

Given two vectors of the same length, their dot product is the result of multiplying the vectors component-wise and summing all the products.

Given vectors u:=(u1,u2,,un) and v:=(v1,v2,,vn), the dot product uv is

u1×v1+u2×v2++un×vn

where × represents multiplication.

For u:=(1,3,5) and v:=(2,4,6), we have uv=1×2+3×4+5×6=44.

Alternatively, we could have also written this as follows using column vectors:

(135)(246)=1×2+3×4+5×6=44

Calculate all of the following dot products. If the dot product is not defined, say so.

  1. (1,2)(1,2)
  2. (1,1,1,1)(2,3,4,5)
  3. (1,2)(1,True)
  4. (1,2)(7)
  5. (1)(7)