---
title: "Inner products and norms"
description: "Compute x · y as the sum of xᵢyᵢ in ℝⁿ, simplify with symmetry and bilinearity, and tell the dot product apart from Hadamard and outer products."
canonical_url: "https://fanout.sh/ml-math/lessons/projection-the-dot-product-in-n-dimensional-euclidean-space-t-16dctvw"
md_url: "https://fanout.sh/ml-math/lessons/projection-the-dot-product-in-n-dimensional-euclidean-space-t-16dctvw.md"
access: "public"
---

# Inner products and norms

Compute x · y as the sum of xᵢyᵢ in ℝⁿ, simplify with symmetry and bilinearity, and tell the dot product apart from Hadamard and outer products.

Turn dot products into lengths and distances, then extend the same ideas to matrices, polynomials and functions. Keep track of which operations and which notion of length you are using.

## Multiply matching coordinates, then add

A dot product turns two vectors into one number. It is the calculation behind the lengths and perpendicularity used in the preceding matrix lessons. Start with the chosen real vectors $u=(3,4)$ and $v=(4,-3)$. Multiplying matching entries gives 12 and −12; adding gives $u\cdot v=0$. By contrast, $u\cdot u=9+16=25$. A mixed product can cancel, while a self-product adds squares.

$$x\cdot y=\sum_{i=1}^n x_i y_i=x_1y_1+\cdots+x_ny_n$$

Both vectors have n real coordinates. The sigma says to add one product for each index i, from 1 through n.

The notation $\mathbb R^n$ means all ordered lists of n real numbers, treated here as column vectors. For $x=(2,-1,3,1)$ and $y=(1,2,-1,2)$ in $\mathbb R^4$, the dot product is $2(1)+(-1)2+3(-1)+1(2)=-1$. Negative results are allowed. In matrix notation, $x^{\mathsf T}y$ multiplies a one-row transpose by a column and produces that same scalar.

| Rule for real vectors | What it lets you do |
| --- | --- |
| $x\cdot y=y\cdot x$ | Swap the two inputs. Each real coordinate product is unchanged. |
| $(ax+by)\cdot z=a(x\cdot z)+b(y\cdot z)$ | Distribute over addition and pull out real scalars a,b. |
| $x\cdot x=\sum_i x_i^2\ge0$ | A self-product is zero exactly when every coordinate is zero. |

The distributive rule follows by expanding each coordinate: $(ax_i+by_i)z_i=ax_iz_i+by_iz_i$, then summing. Symmetry gives the same rule in the second input. This is called bilinearity: linearity in each input separately. Scaling both inputs by c multiplies their dot product by $c^2$, not c.

### Use known products without reconstructing vectors

1. Suppose $a\cdot c=2$, $b\cdot c=-1$, $b\cdot d=3$ and $c\cdot d=-2$. Expand $(3a-2b)\cdot c+(b+4c)\cdot d$.
2. Distributing gives $3(a\cdot c)-2(b\cdot c)+(b\cdot d)+4(c\cdot d)=6+2+3-8=3$. If a supplied product is written in reverse order, symmetry lets you use it.
3. For the earlier four-coordinate x,y, $y\cdot y=1+4+1+4=10$. Hence $\dfrac{x\cdot(2y)}{(3y)\cdot y}=\dfrac{2(-1)}{3(10)}=-\dfrac1{15}$. The denominator is nonzero because y is nonzero.

Positive definiteness refers to self-products, not every pair. For example, if $(6a+3b)\cdot a=0$ and $a\ne0$, expanding gives $6(a\cdot a)+3(b\cdot a)=0$, so $b\cdot a=-2(a\cdot a)<0$. This is a negative mixed product, consistent with a strictly positive self-product.

Check the kind of result

The coordinatewise product of u and v is the vector (12,−12); their dot product adds those entries to get the scalar 0. The outer product $uv^{\mathsf T}$ is a matrix. A chain such as $(u\cdot v)\cdot w$ is not another dot product: its first input is a scalar. Scalar multiplication $(u\cdot v)w$ is meaningful, but it is a different operation. Lists of different lengths cannot be dotted without first specifying a map into a common space.

---
This representation contains public Fanout content only. Protected Pro lessons, account data, billing, checkout, and pricing are not included.

Browse the public content map: https://fanout.sh/sitemap.md
