Linear algebra part 5 - Vector lengths

The length, or magnitude, of a vector is the length of the vector line on a graph. If you need a refresher, look at the post on plotting vectors. We denotes the length of a vector v\mathbf{v} as v||\mathbf{v}||. The length of a vector, v\mathbf{v}, is calculated using this formula:

v=[v1v2v3vn]\mathbf{v} = \begin{bmatrix} v_1 \\ v_2 \\ v_3 \\ \vdots \\ v_n \end{bmatrix}
v=v12+v22+v32++vn2||\mathbf{v}|| = \sqrt{v_1^2 + v_2^2 + v_3^2 + \cdots + v_n^2}

What we are saying here is that you calculate the length of a vector by squaring each component, adding them up, then taking the square root of the result. I hope that might sound familiar to some of you. If you look at a two-dimensional vector on a graph, it is essentially a right-angle triangle. The formula we have just stated is Pythagoras’ theorem. To prove to ourselves that this is true, let us look at an example in two-dimensions.

v=[34]\mathbf{v} = \begin{bmatrix} 3 \\ 4 \end{bmatrix}

If we plot the vector v\mathbf{v} we can see that it is the hypotenuse of a right-angle triangle.

Pythagoras’ theorem tells us that a2+b2=c2a^2 + b^2 = c^2 where aa and bb are the two sides at right angles to each other, and cc is the hypotenuse. The length of the hypotenuse is therefore c=a2+b2c = \sqrt{a^2 + b^2}. Looking at our graph, we can see that aa is the x-axis component of our vector and bb is the y-axis component of our vector. We can therefore calculate the length of the vector v\mathbf{v} as follows:

v=32+42=5||\mathbf{v}|| = \sqrt{3^2 + 4^2} = 5

Vector lengths in more than two dimensions

As we showed in the formula at the top of the post, this format works in as many dimensions as you like. Let us walk through an example in five demensions:

v=[171314]\mathbf{v} = \begin{bmatrix} 1 \\ 7 \\ 1 \\ 3 \\ 14 \end{bmatrix}
v=12+72+12+32+142=1+49+1+9+196=256=16 \begin{aligned} ||\mathbf{v}|| &= \sqrt{1^2 + 7^2 + 1^2 + 3^2 + 14^2} \\ &= \sqrt{1 + 49 + 1 + 9 + 196} \\ &= \sqrt{256} \\ &= 16 \end{aligned}
v=12+72+12+32+142=1+49+1+9+196=256=16 ||\mathbf{v}|| = \sqrt{1^2 + 7^2 + 1^2 + 3^2 + 14^2} = \sqrt{1 + 49 + 1 + 9 + 196} = \sqrt{256} = 16

Problems

If you can solve this problem you have understood how to calculate the length of vectors.

  1. Calculate the length of vector v\mathbf{v}:
v=[151871]\mathbf{v} = \begin{bmatrix} 1 \\ 5 \\ 18 \\ 7 \\ 1 \end{bmatrix}

Solutions

  1. The length of a vector is calculated by squaring each component of the vector, adding up the resulting components, then square routing the result.
v=12+52+182+72+12=1+25+324+49+1=400=20 \begin{aligned} ||\mathbf{v}|| &= \sqrt{1^2 + 5^2 + 18^2 + 7^2 + 1^2} \\ &= \sqrt{1 + 25 + 324 + 49 + 1} \\ &= \sqrt{400} \\ &= 20 \end{aligned}
v=12+52+182+72+12=1+25+324+49+1=400=20 ||\mathbf{v}|| = \sqrt{1^2 + 5^2 + 18^2 + 7^2 + 1^2} = \sqrt{1 + 25 + 324 + 49 + 1} = \sqrt{400} = 20

Subscribe to 15 Minute Finance

Be the first to know when new posts are published

Buy me a coffee

If you have learnt something today, please consider supporting me