Linear Algebra · Undergraduate

Vectors in n Dimensions

Quick answer

A vector in ℝⁿ is an ordered list of n real numbers. Addition and scalar multiplication work one component at a time, exactly as they do for arrows in the plane, and they obey the same rules. Length and the dot product also carry over: the length of a vector is the square root of the sum of the squares of its entries. Any vector is the sum of its entries times the standard basis vectors e₁ through eₙ, which is the pattern every later idea in linear algebra builds on.

What you'll learn

  • Add and scale vectors in ℝⁿ
  • Compute the length of a vector and the dot product in ℝⁿ
  • Write a vector in terms of the standard basis
  • Decide when two vectors in ℝⁿ are perpendicular

Lists of numbers

In the plane, a vector is an arrow given by two numbers. Nothing in the arithmetic of those numbers cares that there are two of them. A vector in ℝⁿ is an ordered list of nn real numbers, written as a column or, to save space, as a row:

v=[v1v2⋮vn]orv=(v1,v2,…,vn)\mathbf{v} = \begin{bmatrix} v_1 \\ v_2 \\ \vdots \\ v_n \end{bmatrix} \qquad\text{or}\qquad \mathbf{v} = (v_1, v_2, \ldots, v_n)

The numbers v1,…,vnv_1, \ldots, v_n are the components. A price list for five products, the daily rainfall for a week, and the position of a point in space are all vectors. The entries mean different things; the arithmetic is the same.

Two operations define everything that follows. Both work one component at a time:

u+v=(u1+v1,…,un+vn)cv=(cv1,…,cvn)\mathbf{u} + \mathbf{v} = (u_1 + v_1, \ldots, u_n + v_n) \qquad c\mathbf{v} = (cv_1, \ldots, cv_n)

Adding needs both vectors to have the same number of components. The zero vector 0\mathbf{0} has every component 00, and −v-\mathbf{v} means (−1)v(-1)\mathbf{v}.

Why the rules carry over

Componentwise addition inherits its rules from the arithmetic of real numbers, one component at a time:

u+v=v+u(u+v)+w=u+(v+w)c(u+v)=cu+cv\mathbf{u} + \mathbf{v} = \mathbf{v} + \mathbf{u} \qquad (\mathbf{u} + \mathbf{v}) + \mathbf{w} = \mathbf{u} + (\mathbf{v} + \mathbf{w}) \qquad c(\mathbf{u} + \mathbf{v}) = c\mathbf{u} + c\mathbf{v}

Every rule for vectors in ℝⁿ is a rule about real numbers applied in each component at once. So nothing breaks when nn grows past 33 and the picture runs out.

Length and the dot product

The dot product extends the same way, by multiplying matching components and adding:

u⋅v=u1v1+u2v2+⋯+unvn\mathbf{u} \cdot \mathbf{v} = u_1v_1 + u_2v_2 + \cdots + u_nv_n

Taking v=u\mathbf{v} = \mathbf{u} gives the sum of the squares, so the length, or norm, is

∥u∥=u⋅u=u12+⋯+un2\|\mathbf{u}\| = \sqrt{\mathbf{u} \cdot \mathbf{u}} = \sqrt{u_1^2 + \cdots + u_n^2}

In ℝ² this is the Pythagorean theorem, and in ℝⁿ it is the definition. Two vectors are orthogonal, the word for perpendicular in any dimension, when their dot product is 00.

The standard basis

Let ei\mathbf{e}_i be the vector with a 11 in position ii and zeros elsewhere. In ℝ³,

e1=(1,0,0)e2=(0,1,0)e3=(0,0,1)\mathbf{e}_1 = (1, 0, 0) \qquad \mathbf{e}_2 = (0, 1, 0) \qquad \mathbf{e}_3 = (0, 0, 1)

Every vector splits into its components along these:

(3,−2,5)=3e1−2e2+5e3(3, -2, 5) = 3\mathbf{e}_1 - 2\mathbf{e}_2 + 5\mathbf{e}_3
(3, 2) as 3e₁ + 2e₂ The vector (3, 2) drawn as an arrow from the origin. Two shorter arrows along the axes show the standard basis vectors e₁ and e₂, and dashed segments run from (3, 0) and (0, 2) to the tip of (3, 2), so the arrow is three steps across and two steps up. (3, 2) e₁ e₂ -112345-11234xy
(3, 2) as 3e₁ + 2e₂

Worked examples

Common mistakes

Practice problems

  1. Find (2,−1,4)+(3,5,−2)(2, -1, 4) + (3, 5, -2).

    Answer

    (5,4,2)(5, 4, 2)

    Full solution

    Add matching components: 2+32 + 3, −1+5-1 + 5, 4+(−2)4 + (-2).

  2. Find 5(1,−2,0,3)5(1, -2, 0, 3).

    Answer

    (5,−10,0,15)(5, -10, 0, 15)

    Full solution

    Multiply every component by 55.

  3. Find 2(1,0,2)−3(4,−1,1)2(1, 0, 2) - 3(4, -1, 1).

    Answer

    (−10,3,1)(-10, 3, 1)

    Full solution

    (2,0,4)−(12,−3,3)(2, 0, 4) - (12, -3, 3), component by component.

  4. Find ∥(2,−3,6)∥\|(2, -3, 6)\|.

    Answer

    77

    Full solution

    4+9+36=49\sqrt{4 + 9 + 36} = \sqrt{49}.

  5. Find (1,2,3,4)⋅(4,3,2,1)(1, 2, 3, 4) \cdot (4, 3, 2, 1).

    Answer

    2020

    Full solution

    4+6+6+4=204 + 6 + 6 + 4 = 20.

  6. Are (3,1,−2)(3, 1, -2) and (2,−4,1)(2, -4, 1) orthogonal?

    Answer

    Yes

    Full solution

    6−4−2=06 - 4 - 2 = 0.

  7. Scale (6,8)(6, 8) to a unit vector.

    Answer

    (0.6,0.8)(0.6, 0.8)

    Full solution

    The length is 36+64=10\sqrt{36 + 64} = 10, so divide both components by 1010.

  8. Write (4,0,−7)(4, 0, -7) in terms of the standard basis vectors.

    Answer

    4e1−7e34\mathbf{e}_1 - 7\mathbf{e}_3

    Full solution

    The second component is 00, so e2\mathbf{e}_2 does not appear.

  9. Find ∥(1,1,1,1,1)∥\|(1, 1, 1, 1, 1)\|.

    Answer

    5≈2.24\sqrt{5} \approx 2.24

    Full solution

    Five components, each contributing 121^2 to the sum.

  10. A student computes (1,2,3)⋅(4,5,6)(1, 2, 3) \cdot (4, 5, 6) and reports (4,10,18)(4, 10, 18). What went wrong?

    Hint

    What kind of object is a dot product?

    Answer

    The dot product is a single number: 4+10+18=324 + 10 + 18 = 32.

    Full solution

    The student stopped after multiplying matching components. The dot product adds them, which is what makes u⋅u\mathbf{u} \cdot \mathbf{u} the squared length and what lets the dot product measure an angle.

Frequently asked questions

What is a vector in ℝⁿ?

An ordered list of n real numbers, such as (2, −1, 4, 0) in ℝ⁴. The number n is the count of entries, called components.

How do you add vectors in ℝⁿ?

Add matching components: (a₁, …, aₙ) + (b₁, …, bₙ) = (a₁ + b₁, …, aₙ + bₙ). The two vectors must have the same number of components.

How do you find the length of a vector in ℝⁿ?

Take the square root of the sum of the squares of the components. For (1, 2, 2, 4) that is √25 = 5.

Can you picture ℝ⁴?

Not directly, but every rule is algebraic and matches what you see in ℝ² and ℝ³. Reasoning in two or three dimensions and computing in n is standard practice.

What are the standard basis vectors?

e₁, …, eₙ, where eᵢ has a 1 in position i and zeros elsewhere. Every vector is a sum of its components times these.

What to learn next