Math Core

Lesson 1.3 · Systems of Linear Equations

Vector equations

A linear system can be read row by row, as a list of equations, or column by column, as a single question about vectors: can a target vector be built out of some given vectors? The column view is where most of the geometry of linear algebra lives, and it leads directly to the idea of a span.

Vectors in Rn\mathbb{R}^n

A vector in Rn\mathbb{R}^n is an ordered list of nn real numbers, written as a column:

u=[3−1]∈R2,v=[104]∈R3.\mathbf{u} = \begin{bmatrix} 3 \\ -1 \end{bmatrix} \in \mathbb{R}^2, \qquad \mathbf{v} = \begin{bmatrix} 1 \\ 0 \\ 4 \end{bmatrix} \in \mathbb{R}^3.

Two vectors are equal when their corresponding entries are equal. The two basic operations act entry by entry: the sum u+v\mathbf{u} + \mathbf{v} adds matching entries, and the scalar multiple cuc\mathbf{u} multiplies every entry by the number cc (a scalar). The zero vector 0\mathbf{0} has every entry equal to 00.

[12]+[3−1]=[41],−2[3−1]=[−62].\begin{bmatrix} 1 \\ 2 \end{bmatrix} + \begin{bmatrix} 3 \\ -1 \end{bmatrix} = \begin{bmatrix} 4 \\ 1 \end{bmatrix}, \qquad -2\begin{bmatrix} 3 \\ -1 \end{bmatrix} = \begin{bmatrix} -6 \\ 2 \end{bmatrix}.

These operations obey the familiar algebraic rules: addition is commutative and associative, u+0=u\mathbf{u} + \mathbf{0} = \mathbf{u}, u+(−u)=0\mathbf{u} + (-\mathbf{u}) = \mathbf{0}, c(u+v)=cu+cvc(\mathbf{u} + \mathbf{v}) = c\mathbf{u} + c\mathbf{v}, (c+d)u=cu+du(c + d)\mathbf{u} = c\mathbf{u} + d\mathbf{u}, c(du)=(cd)uc(d\mathbf{u}) = (cd)\mathbf{u} and 1u=u1\mathbf{u} = \mathbf{u}. Each follows from the corresponding rule for real numbers, applied one entry at a time.

Geometry in the plane

Picture [ab]\begin{bmatrix} a \\ b \end{bmatrix} as an arrow from the origin to the point (a,b)(a, b). Scalar multiplication stretches or shrinks the arrow (and reverses it when cc is negative). Addition follows the parallelogram rule: u+v\mathbf{u} + \mathbf{v} is the fourth corner of the parallelogram with sides u\mathbf{u} and v\mathbf{v}.

The parallelogram rule: u = (1, 2), v = (3, −1) and u + v = (4, 1).Open in grapher →

Linear combinations

Definition

Linear combination

Given vectors v1,v2,…,vp\mathbf{v}_1, \mathbf{v}_2, \dots, \mathbf{v}_p in Rn\mathbb{R}^n and scalars c1,c2,…,cpc_1, c_2, \dots, c_p, the vector

y=c1v1+c2v2+⋯+cpvp\mathbf{y} = c_1\mathbf{v}_1 + c_2\mathbf{v}_2 + \cdots + c_p\mathbf{v}_p

is a linear combination of v1,…,vp\mathbf{v}_1, \dots, \mathbf{v}_p with weights c1,…,cpc_1, \dots, c_p. The weights can be any real numbers, including zero.

The central question is the reverse one: given b\mathbf{b}, can you find weights that produce it? Write a1=[1−23]\mathbf{a}_1 = \begin{bmatrix} 1 \\ -2 \\ 3 \end{bmatrix}, a2=[210]\mathbf{a}_2 = \begin{bmatrix} 2 \\ 1 \\ 0 \end{bmatrix} and ask whether x1a1+x2a2=bx_1\mathbf{a}_1 + x_2\mathbf{a}_2 = \mathbf{b} for some x1,x2x_1, x_2. Combining the left side into one vector,

[x1+2x2−2x1+x23x1]=[b1b2b3],\begin{bmatrix} x_1 + 2x_2 \\ -2x_1 + x_2 \\ 3x_1 \end{bmatrix} = \begin{bmatrix} b_1 \\ b_2 \\ b_3 \end{bmatrix},

and two vectors are equal exactly when their entries agree. So the vector equation is the same thing as a linear system, whose augmented matrix has the vectors a1,a2,b\mathbf{a}_1, \mathbf{a}_2, \mathbf{b} as its columns.

Vector equations are linear systems

The vector equation

x1a1+x2a2+⋯+xnan=bx_1\mathbf{a}_1 + x_2\mathbf{a}_2 + \cdots + x_n\mathbf{a}_n = \mathbf{b}

has the same solution set as the linear system whose augmented matrix is

[a1a2⋯anb].\left[\begin{array}{cccc|c} \mathbf{a}_1 & \mathbf{a}_2 & \cdots & \mathbf{a}_n & \mathbf{b} \end{array}\right].

In particular, b\mathbf{b} is a linear combination of a1,…,an\mathbf{a}_1, \dots, \mathbf{a}_n if and only if this system is consistent.

Worked example: Finding the weights

Is b=[719]\mathbf{b} = \begin{bmatrix} 7 \\ 1 \\ 9 \end{bmatrix} a linear combination of a1=[1−23]\mathbf{a}_1 = \begin{bmatrix} 1 \\ -2 \\ 3 \end{bmatrix} and a2=[210]\mathbf{a}_2 = \begin{bmatrix} 2 \\ 1 \\ 0 \end{bmatrix}?

Row reduce [ a1    a2∣b ][\,\mathbf{a}_1 \;\; \mathbf{a}_2 \mid \mathbf{b}\,] with R2+2R1R_2 + 2R_1 and R3−3R1R_3 - 3R_1:

[127−211309]→[12705150−6−12].\left[\begin{array}{cc|c} 1 & 2 & 7 \\ -2 & 1 & 1 \\ 3 & 0 & 9 \end{array}\right] \to \left[\begin{array}{cc|c} 1 & 2 & 7 \\ 0 & 5 & 15 \\ 0 & -6 & -12 \end{array}\right].

Row 2 forces x2=3x_2 = 3, but row 3 forces x2=2x_2 = 2. Formally, R3+65R2R_3 + \tfrac{6}{5}R_2 gives [ 0    0∣6 ][\,0 \;\; 0 \mid 6\,]. The system is inconsistent, so b\mathbf{b} is not a linear combination of a1\mathbf{a}_1 and a2\mathbf{a}_2.

Change the target to b=[713]\mathbf{b} = \begin{bmatrix} 7 \\ 1 \\ 3 \end{bmatrix} and the same steps give rows [ 0    5∣15 ][\,0 \;\; 5 \mid 15\,] and [ 0    −6∣−18 ][\,0 \;\; {-6} \mid {-18}\,], both saying x2=3x_2 = 3. Then x1=7−6=1x_1 = 7 - 6 = 1, and indeed 1a1+3a2=[713]1\mathbf{a}_1 + 3\mathbf{a}_2 = \begin{bmatrix} 7 \\ 1 \\ 3 \end{bmatrix}.

Span

Definition

Span

If v1,…,vp\mathbf{v}_1, \dots, \mathbf{v}_p are in Rn\mathbb{R}^n, then Span⁡{v1,…,vp}\operatorname{Span}\{\mathbf{v}_1, \dots, \mathbf{v}_p\} is the set of all linear combinations of v1,…,vp\mathbf{v}_1, \dots, \mathbf{v}_p, that is, all vectors of the form c1v1+⋯+cpvpc_1\mathbf{v}_1 + \cdots + c_p\mathbf{v}_p with c1,…,cpc_1, \dots, c_p scalars.

Asking "is b\mathbf{b} in Span⁡{v1,…,vp}\operatorname{Span}\{\mathbf{v}_1, \dots, \mathbf{v}_p\}?" is the same as asking whether the system with augmented matrix [ v1  ⋯  vp∣b ][\,\mathbf{v}_1 \;\cdots\; \mathbf{v}_p \mid \mathbf{b}\,] is consistent. Every span contains 0\mathbf{0} (take all weights 00) and every cvic\mathbf{v}_i.

Geometrically:

  • If v≠0\mathbf{v} \ne \mathbf{0}, then Span⁡{v}\operatorname{Span}\{\mathbf{v}\} is the line through the origin in the direction of v\mathbf{v}.
  • If u\mathbf{u} and v\mathbf{v} are nonzero and neither is a multiple of the other, then Span⁡{u,v}\operatorname{Span}\{\mathbf{u}, \mathbf{v}\} is the plane through the origin containing them. In R2\mathbb{R}^2 that plane is all of R2\mathbb{R}^2.
  • If v\mathbf{v} is a multiple of u\mathbf{u}, adding it contributes nothing new, and the span is still just a line.
Span{v} for v = (2, 1) is the whole line y = x/2 through the origin. Every multiple of v, such as −2v, lies on it.Open in grapher →

Worked example: A span in R³

Describe Span⁡{u,v}\operatorname{Span}\{\mathbf{u}, \mathbf{v}\} for u=[102]\mathbf{u} = \begin{bmatrix} 1 \\ 0 \\ 2 \end{bmatrix} and v=[01−1]\mathbf{v} = \begin{bmatrix} 0 \\ 1 \\ -1 \end{bmatrix}, and decide whether b=[3−28]\mathbf{b} = \begin{bmatrix} 3 \\ -2 \\ 8 \end{bmatrix} lies in it.

Neither vector is a multiple of the other, so the span is a plane through the origin. A general element is

c1u+c2v=[c1c22c1−c2].c_1\mathbf{u} + c_2\mathbf{v} = \begin{bmatrix} c_1 \\ c_2 \\ 2c_1 - c_2 \end{bmatrix}.

Matching the first two entries of b\mathbf{b} forces c1=3c_1 = 3 and c2=−2c_2 = -2, and then the third entry must be 2(3)−(−2)=82(3) - (-2) = 8. It is, so b=3u−2v\mathbf{b} = 3\mathbf{u} - 2\mathbf{v} lies in the plane. (In fact the plane is exactly the set of vectors with x3=2x1−x2x_3 = 2x_1 - x_2.)

Common mistake

A span is a set of vectors, not a single vector. Writing "Span⁡{u,v}=u+v\operatorname{Span}\{\mathbf{u}, \mathbf{v}\} = \mathbf{u} + \mathbf{v}" confuses one particular combination with all of them. Also remember that the weights may be negative or zero; the span of v\mathbf{v} is the entire line, not just the ray in the direction of v\mathbf{v}.

Practice

Practice 1

Let u=[1−2]\mathbf{u} = \begin{bmatrix} 1 \\ -2 \end{bmatrix} and v=[41]\mathbf{v} = \begin{bmatrix} 4 \\ 1 \end{bmatrix}. Compute 3u−2v3\mathbf{u} - 2\mathbf{v} and give it as an ordered pair.

Enter a point like (2, -3)

Practice 2

Find weights x1,x2x_1, x_2 with x1[12]+x2[3−1]=[53]x_1\begin{bmatrix} 1 \\ 2 \end{bmatrix} + x_2\begin{bmatrix} 3 \\ -1 \end{bmatrix} = \begin{bmatrix} 5 \\ 3 \end{bmatrix}. Give (x1,x2)(x_1, x_2).

Enter a point like (2, -3)

Practice 3

Is b=[124]\mathbf{b} = \begin{bmatrix} 1 \\ 2 \\ 4 \end{bmatrix} in Span⁡{a1,a2}\operatorname{Span}\{\mathbf{a}_1, \mathbf{a}_2\}, where a1=[101]\mathbf{a}_1 = \begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix} and a2=[011]\mathbf{a}_2 = \begin{bmatrix} 0 \\ 1 \\ 1 \end{bmatrix}?

Practice 4

Let a1=[102]\mathbf{a}_1 = \begin{bmatrix} 1 \\ 0 \\ 2 \end{bmatrix}, a2=[215]\mathbf{a}_2 = \begin{bmatrix} 2 \\ 1 \\ 5 \end{bmatrix} and b=[3−1h]\mathbf{b} = \begin{bmatrix} 3 \\ -1 \\ h \end{bmatrix}. For what value of hh is b\mathbf{b} in Span⁡{a1,a2}\operatorname{Span}\{\mathbf{a}_1, \mathbf{a}_2\}?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Which best describes Span⁡{[120],[240]}\operatorname{Span}\left\{\begin{bmatrix} 1 \\ 2 \\ 0 \end{bmatrix}, \begin{bmatrix} 2 \\ 4 \\ 0 \end{bmatrix}\right\} in R3\mathbb{R}^3?

Practice 6

Write b=[51−2]\mathbf{b} = \begin{bmatrix} 5 \\ 1 \\ -2 \end{bmatrix} as x1a1+x2a2+x3a3x_1\mathbf{a}_1 + x_2\mathbf{a}_2 + x_3\mathbf{a}_3, where a1=[101]\mathbf{a}_1 = \begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix}, a2=[210]\mathbf{a}_2 = \begin{bmatrix} 2 \\ 1 \\ 0 \end{bmatrix}, a3=[013]\mathbf{a}_3 = \begin{bmatrix} 0 \\ 1 \\ 3 \end{bmatrix}. Give (x1,x2,x3)(x_1, x_2, x_3).

Enter a point like (2, -3)

Practice 7

For what value of kk is [3k]\begin{bmatrix} 3 \\ k \end{bmatrix} in Span⁡{[−12]}\operatorname{Span}\left\{\begin{bmatrix} -1 \\ 2 \end{bmatrix}\right\}?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.