Linear Algebra & Optimization
Foundations
7 min

Vectors & Dot Products

Vectors encode direction and magnitude; the dot product measures alignment and drives projections, correlation and factor exposures.

1. The idea

A vector is an ordered list of numbers that can represent a position, a portfolio of weights, or a set of factor exposures. Its length measures magnitude, and direction is what remains after normalizing by that length.

The dot product links algebra to geometry: it is zero exactly when vectors are orthogonal, positive when they point in similar directions, and negative when they oppose each other.

In quant work, dot products appear constantly: portfolio return is a dot product of weights and asset returns, and correlation is a normalized dot product of centered return vectors.

2. Why it matters

Every covariance matrix, regression and PCA computation reduces to dot products, so fluency here is a prerequisite for every later topic in this section.

3. Core mathematics

Dot product

bilinear, symmetric

Norm

Angle

Cauchy-Schwarz

equality iff parallel

4. How to recognize it

Think of this when…

  • Portfolio return as a weighted sum of asset returns
  • Questions about correlation, cosine similarity or orthogonal signals
  • Any phrase like 'weighted sum' or 'linear combination'

5. Worked example

Worked example

Let and . Find , , and the angle between them.

  1. 1

    Compute the dot product.

  2. 2

    Compute norms.

  3. 3

    Solve for the angle.

  4. Answer: u·v = 4, ‖u‖ = 3, θ ≈ 53.4°

6. Common mistakes

  • Confusing the dot product (a scalar) with elementwise multiplication (a vector)
  • Forgetting to normalize before interpreting a dot product as a correlation or cosine
  • Assuming orthogonal implies independent — true only jointly with distributional assumptions

7. Quick check

If for nonzero vectors, they are:

Cauchy-Schwarz says is at most:

8. Practice

6 QuantSolve questions use this concept.

Practice this concept

9. Related methods

This lesson is conceptual; see the topic hub for methods.