Linear AlgebraVectors and Matrix Equations

Vectors in Rⁿ and Linear Combinations

Scale and add vectors to reach new ones.

Not started Jump to practice

The column picture turned a system into a question about combining vectors. This topic sets up the language for that, in any number of dimensions.

A vector in $\mathbb{R}^n$ is an ordered list of $n$ real numbers, written as a column: $\mathbf{v} = \begin{bmatrix} v_1 \\ \vdots \\ v_n \end{bmatrix}$. Two vectors are equal when every entry matches. We add vectors entry by entry and multiply a vector by a number (a scalar) by multiplying every entry. For $n = 2$ or $3$ you can draw them as arrows from the origin; for larger $n$ the algebra works the same even though the picture runs out.

In the plane, adding $\mathbf{u} + \mathbf{v}$ means walking along $\mathbf{u}$ and then along $\mathbf{v}$ (tip to tail); the sum is the diagonal of the parallelogram the two arrows make. Scaling by $c$ stretches an arrow by $|c|$ and flips it when $c < 0$. The usual rules hold because they hold in each entry: $\mathbf{u} + \mathbf{v} = \mathbf{v} + \mathbf{u}$, $c(\mathbf{u} + \mathbf{v}) = c\mathbf{u} + c\mathbf{v}$, $(c + d)\mathbf{u} = c\mathbf{u} + d\mathbf{u}$, and $\mathbf{u} + \mathbf{0} = \mathbf{u}$.

Given vectors $\mathbf{v}_1, \dots, \mathbf{v}_p$ and scalars $c_1, \dots, c_p$, the vector $$c_1\mathbf{v}_1 + c_2\mathbf{v}_2 + \cdots + c_p\mathbf{v}_p$$ is a linear combination of the $\mathbf{v}$'s with weights $c_1, \dots, c_p$. Weights can be any real numbers, including $0$ and negatives.

Dashed arrows show $c_1\mathbf{u}$ and then $c_2\mathbf{v}$ added tip to tail. The dots are the combinations with whole-number weights.

Worked example: Computing a combination

Let $\mathbf{u} = \begin{bmatrix} 2 \\ -1 \\ 0 \end{bmatrix}$ and $\mathbf{v} = \begin{bmatrix} 1 \\ 3 \\ -2 \end{bmatrix}$. Compute $3\mathbf{u} - 2\mathbf{v}$.
  1. Scale: $3\mathbf{u} = \begin{bmatrix} 6 \\ -3 \\ 0 \end{bmatrix}$ and $-2\mathbf{v} = \begin{bmatrix} -2 \\ -6 \\ 4 \end{bmatrix}$.
  2. Add entry by entry: $\begin{bmatrix} 4 \\ -9 \\ 4 \end{bmatrix} = \begin{bmatrix} 4 \\ -9 \\ 4 \end{bmatrix}$.

Answer: $\begin{bmatrix} 4 \\ -9 \\ 4 \end{bmatrix}$

Why it works

Why is "is $\mathbf{b}$ a combination of $\mathbf{a}_1, \dots, \mathbf{a}_p$?" a question about a linear system? Write $x_1\mathbf{a}_1 + \cdots + x_p\mathbf{a}_p = \mathbf{b}$ and compare entry $i$ on both sides: it says $x_1a_{i1} + \cdots + x_pa_{ip} = b_i$, a linear equation. All the entries together form a system whose augmented matrix is $[\,\mathbf{a}_1\ \cdots\ \mathbf{a}_p \mid \mathbf{b}\,]$. So $\mathbf{b}$ is a combination exactly when that system is consistent, and the solutions are the weights.

Worked example: Finding the weights

Is $\mathbf{b} = \begin{bmatrix} 1 \\ -1 \\ 7 \end{bmatrix}$ a linear combination of $\mathbf{a}_1 = \begin{bmatrix} 1 \\ 0 \\ 2 \end{bmatrix}$ and $\mathbf{a}_2 = \begin{bmatrix} 2 \\ 1 \\ -1 \end{bmatrix}$? If so, find the weights.
  1. Row reduce $\left[\begin{array}{cc|c} 1 & 2 & 1 \\ 0 & 1 & -1 \\ 2 & -1 & 7 \end{array}\right]$.
  2. $R_3 \to R_3 - 2R_1$ gives row 3 $= (0, -5 \mid 5)$; then $R_3 \to R_3 + 5R_2$ gives $(0, 0 \mid 0)$; then $R_1 \to R_1 - 2R_2$: $\left[\begin{array}{cc|c} 1 & 0 & 3 \\ 0 & 1 & -1 \\ 0 & 0 & 0 \end{array}\right]$.
  3. Consistent, with $x_1 = 3$ and $x_2 = -1$.
  4. Check: $3\begin{bmatrix} 1 \\ 0 \\ 2 \end{bmatrix} - \begin{bmatrix} 2 \\ 1 \\ -1 \end{bmatrix} = \begin{bmatrix} 1 \\ -1 \\ 7 \end{bmatrix}$. ✓

Answer: Yes: $\mathbf{b} = 3\mathbf{a}_1 - \mathbf{a}_2$.

The zero vector is a combination of any vectors (all weights $0$), and each $\mathbf{v}_i$ is a combination of the set (weight $1$ on it, $0$ on the rest). Vectors with many entries are everyday objects: a store's sales of 50 products in one week is a vector in $\mathbb{R}^{50}$, and the sales over a month are a combination of the weekly vectors with weights $1$.

Key idea

A linear combination scales vectors and adds them. Asking whether $\mathbf{b}$ is a combination of $\mathbf{a}_1, \dots, \mathbf{a}_p$ is the same as asking whether the system with augmented matrix $[\,\mathbf{a}_1\ \cdots\ \mathbf{a}_p \mid \mathbf{b}\,]$ has a solution.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 1 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • Margalit and Rabinoff, Interactive Linear Algebra (Georgia Tech), §2.1 Vectors and §2.2 Vector Equations and Spans
  • MIT OpenCourseWare 18.06 Linear Algebra (Gilbert Strang, Spring 2010), Lecture 1: The Geometry of Linear Equations
@teddyrookbook GitHub