Linear Algebra-1
Linear Algebra-1
Linear Algebra-1
Lecture 1
In this lecture, we will introduce linear systems and the method of row reduction to solve
them. We will introduce matrices as a convenient structure to represent and solve linear
systems. Lastly, we will discuss geometric interpretations of the solution set of a linear
system in 2- and 3-dimensions.
The numbers aij are called the coefficients of the linear system; because there are m equa-
tions and n unknown variables there are thefore m × n coefficients. The main problem with
a linear system is of course to solve it:
Problem: Find a list of n numbers (s1 , s2 , . . . , sn ) that satisfy the system of linear equa-
tions (1.1).
In other words, if we substitute the list of numbers (s1 , s2 , . . . , sn ) for the unknown
variables (x1 , x2 , . . . , xn ) in equation (1.1) then the left-hand side of the ith equation will
equal bi . We call such a list (s1 , s2 , . . . , sn ) a solution to the system of equations. Notice
that we say “a solution” because there may be more than one. The set of all solutions to a
linear system is called its solution set. As an example of a linear system, below is a linear
1
Systems of Linear Equations
x1 − 5x2 − 7x3 = 0
5x2 + 11x3 = 1
−5x1 + x2 = −1
πx1 − 5x2 = 0
√
63x1 − 2x2 = −7
Example 1.2. Verify that (1, 2, −4) is a solution to the system of equations
2x1 + 2x2 + x3 = 2
x1 + 3x2 − x3 = 11.
but
1 + 3(−1) − 2 = −4 6= 11.
Thus, (1, −1, 2) is not a solution to the system.
A linear system may not have a solution at all. If this is the case, we say that the linear
system is inconsistent:
2
Lecture 1
INCONSISTENT ⇔ NO SOLUTION
We will see shortly that a consistent linear system will have either just one solution or
infinitely many solutions. For example, a linear system cannot have just 4 or 5 solutions. If
it has multiple solutions, then it will have infinitely many solutions.
Example 1.3. Show that the linear system does not have a solution.
−x1 + x2 = 3
x1 − x2 = 1.
0=4
which is a contradiction. Therefore, there does not exist a list (s1 , s2 ) that satisfies the
system because this would lead to the contradiction 0 = 4.
s1 = − 32 − 2t
s2 = 23 + t
s3 = t.
Show that for any choice of the parameter t, the list (s1 , s2 , s3 ) is a solution to the linear
system
x1 + x2 + x3 = 0
x1 + 3x2 − x3 = 3.
Solution. Substitute the list (s1 , s2 , s3 ) into the left-hand-side of the first equation
− 32 − 2t + 32 + t + t = 0
Both equations are satisfied for any value of t. Because we can vary t arbitrarily, we get an
infinite number of solutions parameterized by t. For example, compute the list (s1 , s2 , s3 )
for t = 3 and confirm that the resulting list is a solution to the linear system.
3
Systems of Linear Equations
1.2 Matrices
We will use matrices to develop systematic methods to solve linear systems and to study
the properties of the solution set of a linear system. Informally speaking, a matrix is an
array or table consisting of rows and columns. For example,
1 −2 1 0
A= 0 2 −8 8
−4 7 11 −5
is a matrix having m = 3 rows and n = 4 columns. In general, a matrix with m rows and
n columns is a m × n matrix and the set of all such matrices will be denoted by Mm×n .
Hence, A above is a 3 × 4 matrix. The entry of A in the ith row and jth column will be
denoted by aij . A matrix containing only one column is called a column vector and a
matrix containing only one row is called a row vector. For example, here is a row vector
u = 1 −3 4
and here is a column vector
3
v= .
−1
We can associate to a linear system three matrices: (1) the coefficient matrix, (2) the
output column vector, and (3) the augmented matrix. For example, for the linear system
5x1 − 3x2 + 8x3 = −1
x1 + 4x2 − 6x3 = 0
2x2 + 4x3 = 3
the coefficient matrix A, the output vector b, and the augmented matrix [A b] are:
5 −3 8 −1 5 −3 8 −1
A= 1 4 −6 , b = 0 , [A b] = 1 4 −6 0 .
0 2 4 3 0 2 4 3
If a linear system has m equations and n unknowns then the coefficient matrix A must be a
m × n matrix, that is, A has m rows and n columns. Using our previously defined notation,
we can write this as A ∈ Mm×n .
If we are given an augmented matrix, we can write down the associated linear system in
an obvious way. For example, the linear system associated to the augmented matrix
1 4 −2 8 12
0 1 −7 2 −4
0 0 5 −1 7
is
x1 + 4x2 − 2x3 + 8x4 = 12
x2 − 7x3 + 2x4 = −4
5x3 − x4 = 7.
4
Lecture 1
We can study matrices without interpreting them as coefficient matrices or augmented ma-
trices associated to a linear system. Matrix algebra is a fascinating subject with numerous
applications in every branch of engineering, medicine, statistics, mathematics, finance, biol-
ogy, chemistry, etc.
These operations do not alter the solution set. The idea is to apply these operations itera-
tively to simplify the linear system to a point where one can easily write down the solution
set. It is convenient to apply elementary operations on the augmented matrix [A b] repre-
senting the linear system. In this case, we call the operations elementary row operations,
and the process of simplifying the linear system using these operations is called row reduc-
tion. The goal with row reducing is to transform the original linear system into one having
a triangular structure and then perform back substitution to solve the system. This is
best explained via an example.
5
Systems of Linear Equations
Example 1.6. Solve the linear system using elementary row operations.
Solution. Our goal is to perform elementary row operations to obtain a triangular structure
and then use back substitution to solve. The augmented matrix is
−3 2 4 12
1 0 −2 −4 .
2 −3 4 −3
As you will see, this first operation will simplify the next step. Add 3R1 to R2 :
1 0 −2 −4 1 0 −2 −4
3R +R2
−3 2 4 12 −−1−−→ 0 2 −2 0
2 −3 4 −3 2 −3 4 −3
Add −2R1 to R3 :
1 0 −2 −4 1 0 −2 −4
−2R1 +R3
0 2 −2 0 − −−−−→ 0 2 −2 0
2 −3 4 −3 0 −3 8 5
Multiply R2 by 12 :
1 0 −2 −4 1
R2
1 0 −2 −4
0 2 −2 0 −2−→ 0 1 −1 0
0 −3 8 5 0 −3 8 5
Add 3R2 to R3 :
1 0 −2 −4 1 0 −2 −4
3R2 +R3
0 1 −1 0 − −−−→ 0 1 −1 0
0 −3 8 5 0 0 5 5
Multiply R3 by 15 :
1 0 −2 −4 1
R3
1 0 −2 −4
0 1 −1 0 −5−→ 0 1 −1 0
0 0 5 5 0 0 1 1
We can continue row reducing but the row reduced augmented matrix is in triangular form.
So now use back substitution to solve. The linear system associated to the row reduced
6
Lecture 1
augmented matrix is
x1 − 2x3 = −4
x2 − x3 = 0
x3 = 1
The last equation gives that x3 = 1. From the second equation we obtain that x2 − x3 = 0,
and thus x2 = 1. The first equation then gives that x1 = −4 + 2(1) = −2. Thus, the solution
to the original system is (−2, 1, 1). You should verify that (−2, 1, 1) is a solution to the
original system.
Example 1.7. Using elementary row operations, show that the linear system is inconsistent.
x1 + 2x3 = 1
x2 + x3 = 0
2x1 + 4x3 = 1
Solution. The augmented matrix is
1 0 2 1
0 1 1 0
2 0 4 1
Perform the operation −2R1 + R3 :
1 0 2 1 1 0 2 1
−2R1 +R3
0 1 1 0 − −−−−→ 0 1 1 0
2 0 4 1 0 0 0 −1
The last row of the simplified augmented matrix
1 0 2 1
0 1 1 0
0 0 0 −1
7
Systems of Linear Equations
where c is a nonzero number, then the linear system is inconsistent. We will call this type
of row an inconsistent row. However, a row of the form
0 1 0 0 0
x1 − 2x2 = −1
(1.2)
−x1 + 3x2 = 3
is the intersection of the two lines determined by the equations of the system. The solution
for this system is (3, 2). The two lines intersect at the point (x1 , x2 ) = (3, 2), see Figure 1.1.
Figure 1.1: The intersection point of the two lines is the solution of the linear system (1.2)
8
Lecture 1
is the intersection of the three planes determined by the equations of the system. In this case,
there is only one solution: (29, 16, 3). In the case of a consistent system of two equations,
the solution set is the line of intersection of the two planes determined by the equations of
the system, see Figure 1.2.
x1 − 2x2 + x3 = 0
−4x1 + 5x2 + 9x3 = −9
Figure 1.2: The intersection of the two planes is the solution set of the linear system (1.3)
9
Systems of Linear Equations
10
Lecture 2
Lecture 2
In this lecture, we will get more practice with row reduction and in the process introduce
two important types of matrix forms. We will also discuss when a linear system has a unique
solution, infinitely many solutions, or no solution. Lastly, we will introduce a convenient
parameter called the rank of a matrix.
P1. All nonzero rows are above any rows of all zeros.
P2. The leftmost nonzero entry of a row is to the right of the leftmost nonzero entry of
the row above it.
11
Row Reduction and Echelon Forms
Any matrix satisfying properties P1 and P2 is said to be in row echelon form (REF). In
REF, the leftmost nonzero entry in a row is called a leading entry:
1 5 0 −2 −1 7 −4
0 2 −2 0 0 3 0
0 0 0 −9 −1 1 −1
0 0 0 0 5 1 5
0 0 0 0 0 0 0
A consequence of property P2 is that every entry below a leading entry is zero:
1 5 0 −2 −4 −1 −7
0 2 −2 0 0 3 0
0 0 0 −9 −1 1 −1
0 0 0 0 5 1 5
0 0 0 0 0 0 0
We can perform elementary row operations, or row reduction, to transform a matrix into
REF.
Example 2.1. Explain why the following matrices are not in REF. Use elementary row
operations to put them in REF.
3 −1 0 3 7 5 0 −3
M = 0 0 0 0 N = 0 3 −1 1
0 1 3 0 0 6 −5 2
Solution. Matrix M fails property P1. To put M in REF we interchange R2 with R3 :
3 −1 0 3 3 −1 0 3
R ↔R3
M = 0 0 0 0 −−2−−→ 0 1 3 0
0 1 3 0 0 0 0 0
The matrix N fails property P2. To put N in REF we perform the operation −2R2 + R3 →
R3 :
7 5 0 −3 7 5 0 −3
−2R2 +R3
0 3 −1 1 − −−−−→ 0 3 −1 1
0 6 −5 2 0 0 −3 0
Why is REF useful? Certain properties of a matrix can be easily deduced if it is in REF.
For now, REF is useful to us for solving a linear system of equations. If an augmented matrix
is in REF, we can use back substitution to solve the system, just as we did in Lecture 1.
For example, consider the system
8x1 − 2x2 + x3 = 4
3x2 − x3 = 7
2x3 = 4
12
Lecture 2
P4. All the entries above (and below) a leading 1 are all zero.
A leading 1 in the RREF of a matrix is called a pivot. For example, the following matrix
in RREF:
1 6 0 3 0 0
0 0 1 −4 0 5
0 0 0 0 1 7
has three pivots:
1 6 0 3 0 0
0 0 1 −4 0 5
0 0 0 0 1 7
Example 2.2. Use row reduction to transform the matrix into RREF.
0 3 −6 6 4 −5
3 −7 8 −5 8 9
3 −9 12 −9 6 15
Solution. The first step is to make the top leftmost entry nonzero:
0 3 −6 6 4 −5 3 −9 12 −9 6 15
R3 ↔R1
3 −7 8 −5 8 9 − −−−→ 3 −7 8 −5 8 9
3 −9 12 −9 6 15 0 3 −6 6 4 −5
Now create a leading 1 in the first row:
3 −9 12 −9 6 15 1
R1
1 −3 4 −3 2 5
3 −7 8 −5 8 9 −3−→ 3 −7 8 −5 8 9
0 3 −6 6 4 −5 0 3 −6 6 4 −5
13
Row Reduction and Echelon Forms
We have now completed the top-to-bottom phase of the row reduction algorithm. In the
next phase, we work bottom-to-top and create zeros above the leading 1’s. Create zeros
above the leading 1 in the third row:
1 −3 4 −3 2 5 1 −3 4 −3 2 5
−R3 +R2
0 1 −2 2 1 −3 − −−−−→ 0 1 −2 2 0 −7
0 0 0 0 1 4 0 0 0 0 1 4
1 −3 4 −3 2 5 1 −3 4 −3 0 −3
−2R3 +R1
0 1 −2 2 0 −7 − −−−−→ 0 1 −2 2 0 −7
0 0 0 0 1 4 0 0 0 0 1 4
Create zeros above the leading 1 in the second row:
1 −3 4 −3 0 −3 1 0 −2 3 0 −24
3R +R1
0 1 −2 2 0 −7 −−2−−→ 0 1 −2 2 0 −7
0 0 0 0 1 4 0 0 0 0 1 4
This completes the row reduction algorithm and the matrix is in RREF.
14
Lecture 2
x3 = 4.
x1 + 2x2 + 3x3 = 4
x1 + 2x2 = −8.
We now must choose one of the variables x1 or x2 to be a parameter, say t, and solve for the
remaining variable. If we set x2 = t then from x1 + 2x2 = −8 we obtain that
x1 = −8 − 2t.
We can therefore write the solution set for the linear system as
x1 = −8 − 2t
x2 = t (2.1)
x3 = 4
where t can be any real number. If we had chosen x1 to be the parameter, say x1 = t,
then the solution set can be written as
x1 = t
x2 = −4 − 12 t (2.2)
x3 = 4
Although (2.1) and (2.2) are two different parameterizations, they both give the same solution
set.
15
Row Reduction and Echelon Forms
In general, if a linear system has n unknown variables and the row reduced augmented
matrix has r leading entries, then the number of free parameters d in the solution set is
d = n − r.
Thus, when performing back substitution, we will have to set d of the unknown variables
to arbitrary parameters. In the previous example, there are n = 3 unknown variables and
the row reduced augmented matrix contained r = 2 leading entries. The number of free
parameters was therefore
d = n − r = 3 − 2 = 1.
Because the number of leading entries r in the row reduced coefficient matrix determine the
number of free parameters, we will refer to r as the rank of the coefficient matrix:
r = rank(A).
Example 2.4. Solve the linear system represented by the augmented matrix
1 −7 2 −5 8 10
0 1 −3 3 1 −5
0 0 0 1 −1 4
Solution. The number of unknowns is n = 5 and the augmented matrix has rank r = 3
(leading entries). Thus, the solution set is parameterized by d = 5 − 3 = 2 free variables,
call them t and s. The last equation of the augmented matrix is x4 − x5 = 4. We choose x5
to be the first parameter so we set x5 = t. Therefore, x4 = 4 + t. The second equation of
the augmented matrix is
x2 − 3x3 + 3x4 + x5 = −5
and the unassigned variables are x2 and x3 . We choose x3 to be the second parameter, say
x3 = s. Then
x2 = −5 + 3x3 − 3x4 − x5
= −5 + 3s − 3(4 + t) − t
= −17 − 4t + 3s.
We now use the first equation of the augmented matrix to write x1 in terms of the other
variables:
16
Lecture 2
where t and s are arbitrary real numbers.. Choose arbitrary numbers for t and s and
substitute the corresponding list (x1 , x2 , . . . , x5 ) into the system of equations to verify that
it is a solution.
Theorem 2.5: Let [A b] be the augmented matrix of a linear system. One of the following
distinct possibilities will occur:
2. All the rows of the augmented matrix are consistent and there are no free parameters.
3. All the rows of the augmented matrix are consistent and there are d ≥ 1 variables
that must be set to arbitrary parameters
In Case 1., the linear system is inconsistent and thus has no solution. In Case 2., the linear
system is consistent and has only one (and thus unique) solution. This case occurs when
r = rank(A) = n since then the number of free parameters is d = n − r = 0. In Case 3., the
linear system is consistent and has infinitely many solutions. This case occurs when r < n
and thus d = n − r > 0 is the number of free parameters.
17
Row Reduction and Echelon Forms
18
Lecture 3
Lecture 3
Vector Equations
In this lecture, we introduce vectors and vector equations. Specifically, we introduce the
linear combination problem which simply asks whether it is possible to express one vector
in terms of other vectors; we will be more precise in what follows. As we will see, solving
the linear combination problem reduces to solving a linear system of equations.
3.1 Vectors in Rn
Recall that a column vector in Rn is a n × 1 matrix. From now on, we will drop the
“column” descriptor and simply use the word vectors. It is important to emphasize that a
vector in Rn is simply a list of n numbers; you are safe (and highly encouraged!) to forget
the idea that a vector is an object with an arrow. Here is a vector in R2 :
3
v= .
−1
Here is a vector in R3 :
−3
v = 0 .
11
Here is a vector in R6 :
9
0
−3
6 .
v=
0
3
To indicate that v is a vector in Rn , we will use the notation v ∈ Rn . The mathematical
symbol ∈ means “is an element of”. When we write vectors within a paragraph, we willwrite
−1
them using list notation instead of column notation, e.g., v = (−1, 4) instead of v = .
4
19
Vector Equations
We can add/subtract vectors, and multiply vectors by numbers or scalars. For example,
here is the addition of two vectors:
0 4 4
−5 −3 −8
+ = .
9 0 9
2 1 3
And the multiplication of a scalar with a vector:
1 3
3 −3 = −9 .
5 15
And here are both operations combined:
4 −2 −8 −6 −14
−2 −8 + 3 9 = 16 + 27 = 43 .
3 4 −6 12 6
These operations constitute “the algebra” of vectors. As the following example illustrates,
vectors can be used in a natural way to represent the solution of a linear system.
Example 3.1. Write the general solution in vector form of the linear system represented
by the augmented matrix
1 −7 2 −5 8 10
A b = 0 1 −3 3 1 −5
0 0 0 1 −1 4
Solution. The number of unknowns is n = 5 and the associated coefficient matrix A has
rank r = 3. Thus, the solution set is parametrized by d = n − r = 2 parameters. This
system was considered in Example 2.4 and the general solution was found to be
where t1 and t2 are arbitrary real numbers. The solution in vector form therefore takes the
form
x1 −89 − 31t1 + 19t2 −89 −31 19
x2 −17 − 4t1 + 3t2 −17 −4 3
x3 = t2
x= = 0 + t1 0 + t2 1
x4 4 + t1 4 1 0
x5 t1 0 1 0
20
Lecture 3
Here the unknowns are the scalars x1 and x2 . After some guess and check, we find that
x1 = −2 and x2 = 3 is a solution to the problem since
4 −2 −14
−2 −8 + 3 9 = 43 .
3 4 6
In some sense, the vector b is a combination of the vectors v1 and v2 . This motivates the
following definition.
The scalars in a linear combination are called the coefficients of the linear combination.
As an example, given the vectors
1 −2 −1 −3
v1 = −2 , v2 = 4 , v3 = 5 , b = 0
3 −6 6 −27
21
Vector Equations
x1 v1 + x2 v2 + x3 v3 = b? (3.1)
For obvious reasons, equation (3.1) is called a vector equation and the unknowns are x1 ,
x2 , and x3 . To gain some intuition with the linear combination problem, let’s do an example
by inspection.
Example 3.3. Let v1 = (1, 0, 0), let v2 = (0, 0, 1), let b1 = (0, 2, 0), and let b2 = (−3, 0, 7).
Are b1 and b2 linear combinations of v1 , v2 ?
Solution. For any scalars x1 and x2
x1 0 x1 0
x1 v1 + x2 v2 = 0 + 0 = 0 6= 2
0 x2 x2 0
and thus no, b1 is not a linear combination of v1 , v2 , v3 . On the other hand, by inspection
we have that
−3 0 −3
−3v1 + 7v2 = 0 + 0 = 0 = b2
0 7 7
and thus yes, b2 is a linear combination of v1 , v2 , v3 . These examples, of low dimension,
were more-or-less obvious. Going forward, we are going to need a systematic way to solve
the linear combination problem that does not rely on pure inspection.
We now describe how the linear combination problem is connected to the problem of
solving a system of linear equations. Consider again the vectors
1 1 2 0
v1 = 2 , v2 = 1 , v3 = 1 , b = 1 .
1 0 2 −2
Does there exist scalars x1 , x2 , x3 such that
x1 v1 + x2 v2 + x3 v3 = b? (3.2)
22
Lecture 3
x1 = 0, x2 = 2, x3 = −1
and thus these coefficients solve the linear combination problem. In other words,
0v1 + 2v2 − v3 = b
In this case, there is only one solution to the linear system, so b can be written as a
linear combination of v1 , v2 , . . . , vp in only one (or unique) way. You should verify these
computations.
We summarize the previous discussion with the following:
23
Vector Equations
Applying the existence and uniqueness Theorem 2.5, the only three possibilities to the linear
combination problem are:
2. If the linear system is consistent and the solution is unique then b can be written as a
linear combination of v1 , v2 , . . . , vp in only one way.
3. If the the linear system is consistent and the solution set has free parameters, then b
can be written as a linear combination of v1 , v2 , . . . , vp in infinitely many ways.
Example 3.4. Is the vector b = (7, 4, −3) a linear combination of the vectors
1 2
v1 = −2 , v2 = 5?
−5 6
24
Lecture 3
Example 3.6. Is the vector b = (8, 8, 12) a linear combination of the vectors
2 4 6
v1 = 1 , v2 = 2 , v3 = 4?
3 6 9
Solution. The augmented matrix is
2 4 6 8 1 2 3 4
REF
1 2 4 8 −−→ 0 0 1 4 .
3 6 9 12 0 0 0 0
The system is consistent and therefore b is a linear combination of v1 , v2 , v3 . In this case,
the solution set contains d = 1 free parameters and therefore, it is possible to write b as a
linear combination of v1 , v2 , v3 in infinitely many ways. In terms of the parameter t, the
solution set is
x1 = −8 − 2t
x2 = t
x3 = 4
Choosing any t gives scalars that can be used to write b as a linear combination of v1 , v2 , v3 .
For example, choosing t = 1 we obtain x1 = −10, x2 = 1, and x3 = 4, and you can verify
that
2 4 6 8
−10v1 + v2 + 4v3 = −10 1 + 2 + 4 4 = 8 = b
3 6 9 12
Or, choosing t = −2 we obtain x1 = −4, x2 = −2, and x3 = 4, and you can verify that
2 4 6 8
−4v1 − 2v2 + 4v3 = −4 1 − 2 2 + 4 4 = 8 = b
3 6 9 12
25
Vector Equations
Thus, by construction, the vector b = (8, 8, 12) is a linear combination of {v1 , v2 , v3 }. This
discussion leads us to the following definition.
Definition 3.7: Let v1 , v2 , . . . , vp be vectors. The set of all vectors that are a linear
combination of v1 , v2 , . . . , vp is called the span of v1 , v2 , . . . , vp , and we denote it by
S = span{v1 , v2 , . . . , vp }.
26
Lecture 3
In R2 , the span of two vectors v1 , v2 ∈ R2 that are not multiples of each other is all of
R2 . That is, span{v1 , v2 } = R2 . For example, with v1 = (1, 0) and v2 = (0, 1), it is true
that span{v1 , v2 } = R2 . In R3 , the span of two vectors v1 , v2 ∈ R3 that are not multiples
of each other is a plane through the origin containing v1 and v2 , see Figure 3.2. In R3 , the
3
span{v,w}
z 0
−1
−2
−3
−4
−4
−3
−2
−1 −4
−3
0 −2
y 1 −1
0
2 1 x
3 2
3
4
Figure 3.2: The span of two vectors, not multiples of each other, in R3 .
span of a single vector is a line through the origin, and the span of three vectors that do not
depend on each other (we will make this precise soon) is all of R3 .
Example 3.8. Is the vector b = (7, 4, −3) in the span of the vectors v1 = (1, −2, −5), v2 =
(2, 5, 6)? In other words, is b ∈ span{v1 , v2 }?
27
Vector Equations
Solution. By definition, b is in the span of v1 and v2 if there exists scalars x1 and x2 such
that
x1 v1 + x2 v2 = b,
that is, if b can be written as a linear combination of v1 and v2 . From our previous
discussion
on the linear combination problem, we must consider the augmented matrix v1 v2 b .
Using row reduction, the augmented matrix is consistent and there is only one solution (see
Example 3.4). Therefore, yes, b ∈ span{v1 , v2 } and the linear combination is unique.
Example 3.9. Is the vector b = (1, 0, 1) in the span of the vectors v1 = (1, 0, 2), v2 =
(0, 1, 0), v3 = (2, 1, 4)?
Example 3.10. Is the vector b = (8, 8, 12) in the span of the vectors v1 = (2, 1, 3), v2 =
(4, 2, 6), v3 = (6, 4, 9)?
The system is consistent and therefore b ∈ span{v1 , v2 , v3 }. In this case, the solution set
contains d = 1 free parameters and therefore, it is possible to write b as a linear combination
of v1 , v2 , v3 in infinitely many ways.
Example 3.11. Answer the following with True or False, and explain your answer.
(a) The vector b = (1, 2, 3) is in the span of the set of vectors
−1 2 4
3 , −7 , −5 .
0 0 0
(b) The solution set of the linear system whose augmented matrix is v1 v2 v3 b is the
same as the solution set of the vector equation
x1 v1 + x2 v2 + x3 v3 = b.
(c) Suppose that the augmented matrix v1 v2 v3 b has an inconsistent row. Then
either b can be written as a linear combination of v1 , v2 , v3 or b ∈ span{v1 , v2 , v3 }.
(d) The span of the vectors {v1 , v2 , v3 } (at least one of which is nonzero) contains only the
vectors v1 , v2 , v3 and the zero vector 0.
28
Lecture 3
29
Vector Equations
30
Lecture 4
Lecture 4
In this lecture, we introduce the operation of matrix-vector multiplication and how it relates
to the linear combination problem.
For the product Ax to be well-defined, the number of columns of A must equal the number
of components of x. Another way of saying this is that the outer dimension of A must equal
the inner dimension of x:
(m × n) · (n × 1) → m × 1
31
The Matrix Equation Ax = b
(a)
2
−4
A = 1 −1 3 0 , x=
−3
(b)
1
3 3 −2
A= , x= 0
4 −4 −1
−1
(c)
−1 1 0
4 −1
1 −2
3 −3 3 ,
A= x= 2
−2
0 −2 −3
Solution. We compute:
(a)
2
−4
Ax = 1 −1 3 0 −3
8
= (1)(2) + (−1)(−4) + (3)(−3) + (0)(8) = −3
(b)
1
3 3 −2
Ax = 0
4 −4 −1
−1
(3)(1) + (3)(0) + (−2)(−1)
=
(4)(1) + (−4)(0) + (−1)(−1)
5
=
5
32
Lecture 4
(c)
−1 1 0
4 −1
1 −2
Ax =
2
3 −3 3
−2
0 −2 −3
(−1)(−1) + (1)(2) + (0)(−2)
(4)(−1) + (1)(2) + (−2)(−2)
=
(3)(−1) + (−3)(2) + (3)(−2)
(0)(−1) + (−2)(2) + (−3)(−2)
3
2
=−15
A(u + v) = Au + Av.
A(cu) = c(Au).
Example 4.4. For the given data, verify that the properties of Theorem 4.3 hold:
3 −3 −1 2
A= , u= , v= , c = −2.
2 1 3 −1
33
The Matrix Equation Ax = b
Ax = x1 v1 + x2 v2 + · · · + xn vn .
In summary, the vector Ax is a linear combination of the columns of A where the scalar
in the linear combination are the components of x! This (important) observation gives an
alternative way to compute Ax.
Equation (⋆) is a matrix equation where the unknown variable is x. If u is a vector such
that Au = b, then we say that u is a solution to the equation Ax = b. For example,
34
Lecture 4
suppose that
1 0 −3
A= , b= .
1 0 7
x
Does the equation Ax = b have a solution? Well, for any x = 1 we have that
x2
1 0 x1 x
Ax = = 1
1 0 x2 x1
and thus any output vector Ax has equal entries. Since b does not have equal entries then
the equation Ax = b has no solution.
We now describe a systematic way to solve matrix equations. As we have seen, the vector
Ax is a linear combination of the columns of A with the coefficients given by the components
of x. Therefore, the matrix equation problem is equivalent to the linear combination problem.
In Lecture 2, we showed that the linear combination problem can be solved by solving
a
system of linear equations. Putting all this together then, if A = v1 v2 · · · vn and
b ∈ Rm then:
Ax = b
Theorem 4.6: Let A ∈ Mm×n and b ∈ Rm . The following statements are equivalent:
(a) The equation Ax = b has a solution.
(b) The vector b is a linear combination of the columns of A.
(c) The linear system represented by the augmented matrix A b is consistent.
35
The Matrix Equation Ax = b
36
Lecture 4
The last row is inconsistent and therefore there is no solution to the matrix equation Ax = b.
In other words, b is not a linear combination of the columns of A.
Solution. First note that the unknown vector x is in R3 because A has n = 3 columns. The
linear system Ax = b has m = 2 equations and n = 3 unknowns. The coefficient matrix A
has rank r = 2, and therefore
the solution set will contain d = n − r = 1 parameter. The
augmented matrix A b is
1 −1 2 2
A b = .
0 3 6 −1
Let x3 = t be the parameter and use the last row to solve for x2 :
x2 = − 13 − 2t
x1 = 2 + x2 − 2x3 = 2 + (− 31 − 2t) − 2t = 5
3
− 4t.
x1 = 53 − 4t
x2 = − 13 − 2t
x3 = t
37
The Matrix Equation Ax = b
Recall from Definition 3.7 that the span of a set of vectors v1 , v2 , . . . , vp , which we denoted
by span{v1 , v2 , . . . , vp }, is the space of vectors that can be written as a linear combination
of the vectors v1 , v2 , . . . , vp .
Example 4.10. Is the vector b in the span of the vectors v1 , v2 ?
0 3 −5
b = 4 , v1 = −2 , v2 = 6
4 1 1
x1 v1 + x2 v2 = b.
2.5v1 + 1.5v2 = b
38
Lecture 4
which does indeed have r = 3 leading entries. Therefore, regardless of the choice of b ∈ R3 ,
the augmented matrix [A b] will be consistent. Therefore, the vectors v1 , v2 , v3 span R3 :
span{v1 , v2 , v3 } = R3 .
39
The Matrix Equation Ax = b
40
Lecture 5
Lecture 5
A homogeneous system Ax = 0 always has at least one solution, namely, the zero solution
because A0 = 0. A homogeneous system is therefore always consistent. The zero solution
x = 0 is called the trivial solution and any non-zero solution is called a nontrivial
solution. From the existence and uniqueness theorem (Theorem 2.5), we know that a
consistent linear system will have either one solution or infinitely many solutions. Therefore,
a homogeneous linear system has nontrivial solutions if and only if its solution set has at
least one parameter.
Recall that the number of parameters in the solution set is d = n − r, where r is the rank
of the coefficient matrix A and n is the number of unknowns.
Example 5.2. Does the linear homogeneous system have any nontrivial solutions?
3x1 + x2 − 9x3 = 0
x1 + x2 − 5x3 = 0
2x1 + x2 − 7x3 = 0
Solution. The linear system will have a nontrivial solution if the solution set has at least one
free parameter. Form the augmented matrix:
3 1 −9 0
1 1 −5 0
2 1 −7 0
41
Homogeneous and Nonhomogeneous Systems
x1 = 2t
x2 = 3t
x3 = t
span{v}.
Example 5.3. Find the general solution of the homogenous system Ax = 0 where
1 2 2 1 4
A = 3 7 7 3 13 .
2 5 5 2 9
42
Lecture 5
where t1 , t2 , t3 are arbitrary parameters. In other words, any solution x is in the span of
v1 , v2 , v3 :
x ∈ span{v1 , v2 , v3 }.
The form of the general solution in Example 5.3 holds in general and is summarized in
the following theorem.
Theorem 5.4: Consider the homogenous linear system Ax = 0, where A ∈ Mm×n and
0 ∈ Rm . Let r be the rank of A.
x = t1 v1 + t2 v2 + · · · + tp vd .
43
Homogeneous and Nonhomogeneous Systems
x ∈ span{v1 , v2 , . . . , vd }.
x = t1 v1 + t2 v2 + · · · + tp vd
Aq = A(p + v)
= Ap + Av
=b+0
= b.
Theorem 5.5: Suppose that the linear system Ax = b is consistent and let p be a
solution. Then any other solution q of the system Ax = b can be written in the form
q = p + v, for some vector v that is a solution to the homogeneous system Ax = 0.
Another way of stating Theorem 5.5 is the following: If the linear system Ax = b is consistent
and has solutions p and q, then the vector v = q−p is a solution to the homogeneous system
Ax = 0. The proof is a simple computation:
Av = A(q − p) = Aq − Ap = b − b = 0.
q = p + t1 v1 + t2 v2 + · · · + tp vd
where p is one particular solution of Ax = b and the vectors v1 , v2 , . . . , vd span the solution
set of the homogeneous system Ax = 0.
44
Lecture 5
There is a useful geometric interpretation of the solution set of a general linear system.
We saw in Lecture 3 that we can interpret the span of a set of vectors as a plane containing
the zero vector 0. Now, the general solution of Ax = b can be written as
x = p + t1 v1 + t2 v2 + · · · + tp vd .
Therefore, the solution set of Ax = b is a shift of the span{v1 , v2 , . . . , vd } by the vector p.
This is illustrated in Figure 5.1.
p + span{v}
p + tv
b
p span{v}
b
b
tv
b
v
b
Example 5.6. Write the general solution, in parametric vector form, of the linear system
3x1 + x2 − 9x3 = 2
x1 + x2 − 5x3 = 0
2x1 + x2 − 7x3 = 1.
Solution. The RREF of the augmented matrix is:
3 1 −9 2 1 0 −2 1
1 1 −5 0 ∼ 0 1 −3 −1
2 1 −7 1 0 0 0 0
The system is consistent and the rank of the coefficient matrix is r = 2. Therefore, there
are d = 3 − 2 = 1 parameters in the solution set. Letting x3 = t be the parameter, from the
second row of the RREF we have
x2 = 3t − 1
And from the first row of the RREF we have
x1 = 2t + 1
Therefore, the general solution of the system in parametric vector form is
2t + 1 1 2
x = 3t − 1 = −1 +t 3
t 0 1
| {z } |{z}
p v
45
Homogeneous and Nonhomogeneous Systems
You should check that p = (1, −1, 0) solves the linear system Ax = b, and that v = (2, 3, 1)
solves the homogeneous system Ax = 0.
Example 5.7. Write the general solution, in parametric vector form, of the linear system
represented by the augmented matrix
3 −3 6 3
−1 1 −2 −1 .
2 −2 4 2
Solution. Write the general solution, in parametric vector form, of the linear system repre-
sented by the augmented matrix
3 −3 6 3
−1 1 −2 −1
2 −2 4 2
Here n = 3, r = 1 and therefore the solution set will have d = 2 parameters. Let x3 = t1
and x2 = t2 . Then from the first row we obtain
x1 = 1 + x2 − 2x3 = 1 + t2 − 2t1
Ap = b
Av1 = Av2 = 0
46
Lecture 5
5.3 Summary
The material in this lecture is so important that we will summarize the main results. The
solution set of a linear system Ax = b can be written in the form
x = p + t1 v1 + t2 v2 + · · · + td vd
or
47
Homogeneous and Nonhomogeneous Systems
48
Lecture 6
Lecture 6
Linear Independence
x = t1 v1 + t2 v2 + · · · + tn vn .
A natural question that arises is whether or not there are multiple ways to express x as a
linear combination of the vectors v1 , v2 , . . . , vn . For example, if v1 = (1, 2), v2 = (0, 1),
v3 = (−1, −1), and x = (3, −1) then you can verify that x ∈ span{v1 , v2 , v3 } and x can be
written in infinitely many ways using v1 , v2 , v3 . Here are three ways:
The fact that x can be written in more than one way in terms of v1 , v2 , v3 suggests that there
might be a redundancy in the set {v1 , v2 , v3 }. In fact, it is not hard to see that v3 = −v1 +v2 ,
and thus v3 ∈ span{v1 , v2 }. The preceding discussion motivates the following definition.
49
Linear Independence
2v1 − v2 + v3 = 0.
Hence, because {v1 , v2 v3 } is a linearly dependent set, it is possible to write the zero vector
0 as a linear combination of {v1 , v2 v3 } where not all the coefficients in the linear
combination are zero. This leads to the following characterization of linear independence.
Theorem 6.3: The set of vectors {v1 , v2 , . . . , vn } is linearly independent if and only if 0
can be written in only one way as a linear combination of {v1 , v2 , . . . , vn }. In other words,
if
t1 v1 + t2 v2 + · · · + tn vn = 0
then necessarily the coefficients t1 , t2 , . . . , tn are all zero.
t1 v1 + t2 v2 + · · · + tn vn = 0
r1 v1 + r2 v2 + · · · + rn vn = x
s1 v1 + s2 v2 + · · · + sn vn = x.
50
Lecture 6
Theorem 6.4: The set {v1 , v2 , . . . , vn } is linearly independent if and only if the the rank
of A is r = n, that is, if the number of leading entries r in the REF (or RREF) of A is
exactly n.
51
Linear Independence
52
Lecture 6
spans the solution set of the system Ax = 0. Choosing for instance t = 2 we obtain the
solution
2 4
x = t −1 = −2 .
1 2
Therefore,
4v1 − 2v2 + 2v3 = 0
is a non-trivial linear combination of v1 , v2 , v3 that gives the zero vector 0. And, for instance,
v3 = −2v1 + v2
Below we record some simple observations on the linear independence of simple sets:
• A set consisting of two non-zero vectors {v1 , v2 } is linearly independent if and only if
neither of the vectors is a multiple of the other. For example, if v2 = tv1 then
tv1 − v2 = 0
• Any set {v1 , v2 , . . . , vp } containing the zero vector, say that vp = 0, is linearly depen-
dent. For example, the linear combination
53
Linear Independence
Proof. Let A = v1 v2 · · · vp . Thus, A is a n × p matrix. Since A has n rows, the
maximum rank of A is n, that is r ≤ n. Therefore, the number of free parameters d = p − r
is always positive because p > n ≥ r. Thus, the homogeneous system Ax = 0 has non-trivial
solutions. In other words, there is some non-zero vector x ∈ Rp such that
Ax = x1 v1 + x2 v2 + · · · + xp vp = 0
−2 6 1 3 7
0 0 0 1 −2
One solution to the linear system Ax = 0 is x = (−1, 1, 0, −2, −1) and therefore
Example 6.9. Suppose that the set {v1 , v2 , v3 , v4 } is linearly independent. Show that the
set {v1 , v2 , v3 } is also linearly independent.
Solution. We must argue that if there exists scalars x1 , x2 , x3 such that
x1 v1 + x2 v2 + x3 v3 = 0
then necessarily x1 , x2 , x3 are all zero. Suppose then that there exists scalars x1 , x2 , x3 such
that
x1 v1 + x2 v2 + x3 v3 = 0.
Then clearly it holds that
x1 v1 + x2 v2 + x3 v3 + 0v4 = 0.
But the set {v1 , v2 , v3 , v4 } is linearly independent, and therefore, it is necessary that x1 , x2 , x3
are all zero. This proves that v1 , v2 , v3 are also linearly independent.
54
Lecture 6
55
Linear Independence
56