Linear Algebra Book Preview
Linear Algebra Book Preview
Beginners
Open Doors to Great Careers
Richard Han
Copyright © 2018 Richard Han
PREFACE ....................................................................................... 7
1 - INTRODUCTION ..................................................................... 8
2 – SOLVING SYSTEMS OF LINEAR EQUATIONS ............... 10
GAUSSIAN ELIMINATION.............................................................................................................................. 10
3 – VECTORS ............................................................................... 29
VECTOR OPERATIONS AND LINEAR COMBINATIONS........................................................................... 29
MULTIPLICATION ........................................................................................................................................... 44
PROBLEM SET: PROPERTIES OF MATRIX OPERATIONS ......................... Error! Bookmark not defined.
SOLUTION SET: PROPERTIES OF MATRIX OPERATIONS ........................ Error! Bookmark not defined.
iv
LINEAR ALGEBRA FOR BEGINNERS
EXAMPLES OF SETS THAT ARE NOT VECTOR SPACES .......................... Error! Bookmark not defined.
PROBLEM SET: SETS THAT ARE NOT VECTOR SPACES ......................... Error! Bookmark not defined.
SOLUTION SET: SETS THAT ARE NOT VECTOR SPACES ........................ Error! Bookmark not defined.
DEFINITION OF TRIVIAL AND NONTRIVIAL SUBSPACE ........................ Error! Bookmark not defined.
SUBSETS THAT ARE NOT SUBSPACES ........................................................ Error! Bookmark not defined.
SUBSETS THAT ARE NOT SUBSPACES: ADDITIONAL EXAMPLE ......... Error! Bookmark not defined.
PROBLEM SET: SUBSETS THAT ARE NOT SUBSPACES ........................... Error! Bookmark not defined.
SOLUTION SET: SUBSETS THAT ARE NOT SUBSPACES .......................... Error! Bookmark not defined.
v
RICHARD HAN
PROBLEM SET: SPAN AND LINEAR INDEPENDENCE .............................. Error! Bookmark not defined.
SOLUTION SET: SPAN AND LINEAR INDEPENDENCE ............................. Error! Bookmark not defined.
SUMMARY: SPAN AND LINEAR INDEPENDENCE .................................... Error! Bookmark not defined.
SOLUTION SET: BASIS AND DIMENSION ................................................... Error! Bookmark not defined.
PROBLEM SET: COORDINATES AND CHANGE OF BASIS ....................... Error! Bookmark not defined.
SOLUTION SET: COORDINATES AND CHANGE OF BASIS ...................... Error! Bookmark not defined.
CONCLUSION ............................................................................. 49
INDEX ........................................................................................... 50
vi
PREFACE
Welcome to Linear Algebra for Beginners: Open Doors to Great Careers. This is a first textbook in
linear algebra. Be sure to get the companion online course Linear Algebra for Beginners here:
https://www.onlinemathtraining.com/linear-algebra/. The online course can be very helpful in
conjunction with this book.
The prerequisite for this book and the online course is a basic understanding of algebra.
I want you to succeed and prosper in your career, life, and future endeavors. I am here for you. Visit me
at: https://www.onlinemathtraining.com/
7
RICHARD HAN
1 - INTRODUCTION
Welcome to Linear Algebra for Beginners: Open Doors to Great Careers! My name is Richard Han.
This is a first textbook in linear algebra.
Ideal student:
If you're a working professional needing a refresher on linear algebra or a complete beginner who
needs to learn linear algebra for the first time, this book is for you. If your busy schedule doesn’t allow
you to go back to a traditional school, this book allows you to study on your own schedule and further
your career goals without being left behind.
If you plan on taking linear algebra in college, this is a great way to get ahead.
If you’re currently struggling with linear algebra or have struggled with it in the past, now is the time
to master it.
After reading this book, you will have refreshed your knowledge of linear algebra for your career so
that you can earn a higher salary.
You will have a required prerequisite for lucrative career fields such as Data Science and Artificial
Intelligence.
You will be in a better position to pursue a masters or PhD degree in machine learning and data
science.
8
LINEAR ALGEBRA FOR BEGINNERS
o Electrical networks. Electrical networks can be solved using systems of linear equations.
o Leontief Input-output model in economics. The necessary outputs of a list of industries
can be found using matrix operations.
o Finance. Regression analysis can be used to estimate relationships between financial
variables. For example, the relationship between the monthly return to a given stock and
the monthly return to the S&P 500 can be estimated using a linear regression model. The
model can, in turn, be used to forecast the future monthly return of the given stock.
Gaussian Elimination
Vectors
Matrix Algebra
Determinants
Vector Spaces
Subspaces
Span and Linear Independence
Basis and Dimension
I explain each definition and go through each example step by step so that you understand each topic
clearly. Throughout the book, there are practice problems for you to try. Detailed solutions are
provided after each problem set.
I hope you benefit from the book.
Best regards,
Richard Han
9
RICHARD HAN
GAUSSIAN ELIMINATION
In this section, we’re going to look at solving systems of linear equations. We’re going to look at the
process of Gaussian elimination, and it has three things that you can do. The first thing you can do is
switch two equations. The second thing is that you can multiply one equation by a nonzero number.
The third thing that you can do is add a multiple of one equation to a second equation. This set of three
things that you can do is called Gaussian elimination. This will make a lot more sense if we look at
some examples. Let’s say we had a system of equations like this:
Here, you have two equations and two variables and . So this is a system of two equations in two
variables. What we want to do here is try to get rid of the variable. So let’s do -4 times the first
equation and add that to the second equation: . If we multiply the first equation by -4 and
leave the second equation as it is, we get this:
is just . So we get . Let’s solve for . Divide both sides by . And you get .
I want to find what is; so I’ll plug the -value back in to the first equation:
( )
10
LINEAR ALGEBRA FOR BEGINNERS
Let’s multiply the first equation by and add to the second equation: .
We get:
Let’s try to get the coefficient of in the first equation to be so that the cancel out when we
add both equations. Let’s do . We get:
And so: . That doesn’t really tell me anything. If you look back at the original system of
equations, notice the second equation is just twice the first equation. So, really, we only have just one
equation, the first equation. The second equation is redundant. So, all we have is . Note
that can be anything. Let be some parameter . Let’s plug that in for and solve for :
11
RICHARD HAN
So, the set of all solutions is going to be the set of all pairs ( ) where is any real number.
We have three equations and three variables , and . Notice that, in the second equation, we have
a – ; and, if we were to add that to the first equation, the terms would cancel out. So let’s take the
first equation and add that to the second equation . Replace the second equation with like
this:
Now, let’s try to get rid the term in the third equation by multiplying the first equation by and
adding the result to the third equation like this: . Replace the third equation with
to get:
Let’s try to get rid of the term in the third equation by doing and replacing the third
equation by the result:
Look at the in the third equation. We want the coefficient of to be . So divide the third
12
LINEAR ALGEBRA FOR BEGINNERS
Look at the coefficient of in the second equation. We want that to be . So let’s divide the second
Now, notice that all the coefficients of the leading variables in each equation are . When you have a
triangular shape like the above and all the leading coefficients are , then we say that the system of
equations is in row echelon form.
Let’s do another example. Suppose we have the following system of equations:
Let’s try to get rid of the term in the second equation by performing: . Replace the
second equation by the result to get:
Looking at the second equation, notice that can be anything. So let , where is a free
variable. Plug in for in the second equation and solve for :
So we have in terms of . We have and in terms of . Now, we want to solve for . Let’s use
the first equation . Plug in what we got for and and solve for :
( )
13
RICHARD HAN
Let’s do one more example. Suppose we have the following system of equations:
If we take the first equation and subtract the second equation, we can get rid of the -term. So let’s
do . Replace the second equation with the result:
Now, look at the first equation and the third equation; we want to get rid of the -term. So, let’s do
.
Let’s look at the second and third equations; let’s get rid of the -term. Perform .
14
LINEAR ALGEBRA FOR BEGINNERS
1.
2.
3.
4.
5.
6.
7.
15
RICHARD HAN
Solve the second equation for y to get . Then plug this y value back into equation 1 to
2.
Take 4 times Equation 1 and add to 3 times Equation 2 to get our new Equation 2.
Solve for y in the second equation to get y= . Plug this value into Equation 1 to solve for x.
=3.
3.
Take 2 times Equation 1 and add to Equation 2 to get the new second equation.
Now, y is a free variable. So let y=t, where t is a parameter. The first equation gives us
. Solve for x to get
16
LINEAR ALGEBRA FOR BEGINNERS
4.
Add 2 times Equation 1 to Equation 2 to get our new Equation 2.
5.
Take -2 times the first equation and add to the second equation to get our new second equation.
Now, take -3 times the first equation and add to the third equation to get our new third equation.
Solve the third equation for z. z=-4. Plug this into the second equation and solve for y.
Plug the z and y values into the first equation and solve for x.
( )
6.
Add the first equation to 2 times the second equation to get our new second equation.
17
RICHARD HAN
Plug the z value into the second equation and solve for x.
Plug the x and z values into the first equation and solve for y.
7.
Let’s do Eq.1-Eq.2 to get our new Eq. 2.
Now, z is a free variable, so let z=t. Then plug that value into z in the second equation.
Solve for y.
Plug the values we got for y and z into the first equation and solve for x.
18
LINEAR ALGEBRA FOR BEGINNERS
( )
19
ELEMENTARY ROW OPERATIONS
We can rewrite a system of equations using a matrix. For example, look at this system of equations:
We can write a matrix that encapsulates this system of equations. We look at the coefficients of the
variables in this system of equations. For the first equation, the coefficients of the variables are 1, 1, and
1. On the right hand side, we have the constant 0. So, for the first row of the matrix, we have:
[ ]
Now, move on to the second equation. The coefficients are , , and . The constant on the right
hand side is . So fill in the second row for the matrix like so:
[ ]
Let’s move on to the third equation. The coefficients are , and . The constant is . So fill in
the third row of the matrix like so:
[ ]
Now, we can solve the system of equations using the same three operations we used earlier. Instead of
performing operations on equations, we can perform operations on rows. The operations are called
elementary row operations. The first thing you can do is switch two rows. The second thing you can
do is multiply one row by a nonzero number. The third thing you can do is add a multiple of one row to
a second row. Here is the list of the three elementary row operations:
These are exactly the same three steps that you saw earlier in Gaussian elimination.
20
LINEAR ALGEBRA FOR BEGINNERS
[ ]
Let’s look at the first two rows. If we were to add those two rows, the and the would cancel out.
So let’s add rows 1 and 2 to get a new row 2:
[ ]
[ ]
Let’s focus on the second and third rows; we want to get rid of the in the third row. So let’s do
.
[ ]
Look at the third row; we want the leading coefficient 6 to be . So divide the third row by 6 to get a
new third row:
[ ]
[ ]
Notice the triangular shape of the matrix; all the leading coefficients in each row are . Furthermore, the
leading coefficient of any row is to the right of the leading coefficient in the previous row. Also, any
row of all zeroes is at the bottom of the matrix (in our example, there is no row of all zeroes). Since
these three conditions of row-echelon form are satisfied, our matrix is in row-echelon form.
21
RICHARD HAN
Let’s write the corresponding augmented matrix. Note that, in the first equation, there is no term; so
the coefficient for is . So the coefficients for the first equation are and . The augmented
matrix so far looks like this:
[ ]
[ ]
The first coefficient in the first row is 0, and we want a there instead. So let’s switch the first row with
the second row:
[ ]
Let’s look at the third row. We want to get rid of the first and make it a 0. So let’s do
.
[ ]
[ ]
22
LINEAR ALGEBRA FOR BEGINNERS
[ ]
Notice the triangular shape and that all the leading coefficients are . So this matrix is in row echelon
form.
23
RICHARD HAN
1.
2.
3.
4.
5.
6.
24
LINEAR ALGEBRA FOR BEGINNERS
1.
[ ] -7R2+R1 R2
[ ] -7R3+R1 R3
[ ] R2 R2
[ ] -20R2+R3 R3
[ ]
The last row gives that 0=28, which is a contradiction. So there is no solution.
2.
[ ] 7R1-3R2 R2
[ ] R3 R3
[ ] 7R1-3R3 R3
[ ] R2-R3 R3
25
RICHARD HAN
[ ]
From the second row, we have Since z is a free variable, let z=t. Then
. Solve for y.
( )
So .
3.
[ ] -8R1+R2 R2
[ ] 7R1+R3 R3
[ ] R2+R3 R3
[ ]
The last row tells us that 0=-18, which is a contradiction. Therefore, there is no solution.
4.
[ ] R1-R2 R2
26
LINEAR ALGEBRA FOR BEGINNERS
[ ] R1-R3 R3
[ ] R2+R3 R3
[ ]
5.
[ ]
The second row tells us y+z=-10. Z is a free variable, so let z=t. Then y+t=-10. Y=-t-10.
The first row tells us x+z=8. So x+t=8. X=-t+8.
6.
[ ]
( )
27
RICHARD HAN
28
LINEAR ALGEBRA FOR BEGINNERS
3 – VECTORS
[ ]
This is a vector in . symbolizes all pairs of real numbers. Consider another example:
[ ]
corresponding entries. For example, suppose [ ] and [ ]. To add and , form the
vector that you get when you add the corresponding entries in each vector.
[ ]
So, if we want to add two vectors, we just add their corresponding entries. The two vectors need to
have the same number of entries.
We can also multiply a vector by a scalar . A scalar is just a real number. Let’s do an example.
29
RICHARD HAN
[ ] [ ]
[ ] [ ] ( )[ ]
[ ] [ ] [ ]
[ ]
[ ][ ]
To multiply this out, look at the first row of . We multiply the first entry in the first row with the
first entry of , multiply the second entry in the first row with the second entry of , multiply the third
entry of the first row with the third entry of , and add the results to get the first entry.:
[ ][ ] [ ] [ ]
For the second entry, we do the same thing but with the second row of :
[ ][ ] [ ( ) ] [ ]
For the third entry, we do the same thing but with the third row of :
[ ][ ] [ ( ) ] [ ]
30
LINEAR ALGEBRA FOR BEGINNERS
b. =[ ] v=[ ]
c. =[ ] v=[ ]
b. =[ ] c=-3
c. =[ ] c=-1
4. Find Av.
a. v=[ ] [ ]
b. v=[ ] [ ]
31
RICHARD HAN
c. v=[ ] [ ]
d. v=[ ] [ ]
32
LINEAR ALGEBRA FOR BEGINNERS
b. =[ ]
c. =[ ]
2. a. =[ ]
b. =[ ]
c. =[ ]
4. a. [ ]
b. [ ]
c. [ ]
d. [ ]
33
RICHARD HAN
Look at the x variables in the system of equations and think of the x terms as one column. Similarly,
think of the y terms as one column, think of the z terms as one column, and think of the constant terms
on the right hand sides as one column. We can rewrite the system of equations as:
[ ] [ ] [ ] [ ]
Now, factor out the x from the first column, the y from the second column, and the z from the third
column like this:
[ ] [ ] [ ] [ ]
So to ask if there is a solution to the system of equations is the same as asking if we can write [ ] as a
linear combination of the column vectors [ ] [ ] [ ] In this case, are the weights of the
linear combination.
Now, let’s define the span. The span of a set of vectors is the set of all linear combinations of those
vectors. Thus, we want to know if the vector [ ] lies in the {[ ] [ ] [ ]}. Note that the
vector equation
[ ] [ ] [ ] [ ]
[ ][ ] [ ]
34
LINEAR ALGEBRA FOR BEGINNERS
[ ]
We can rewrite this as the sum of the column vectors consisting of the variables:
[ ] [ ] [ ]
[ ] [ ] [ ]
So, we get the linear combination of the coefficient vectors we had earlier. So our original system of
equations can be rewritten as a matrix equation where is the coefficient matrix, is the
LINEAR INDEPENDENCE
We will now introduce the notion of linear independence. Let . Then the set
is linearly independent just in case the vector equation has only the trivial
solution . Otherwise, the set is said to be linearly dependent. Note the vector
the vector forms the first column, forms the second column, etc.
[ ] [ ] [ ]
[ ]
Now, set an arbitrary linear combination of the vectors equal to in matrix form:
35
RICHARD HAN
[ ][ ] [ ]
We want to know if this system of equations has only the trivial solution (in other words,
). Let’s form the augmented matrix:
[ ]
Let’s try to do a bunch of row operations on this augmented matrix to solve for the solution. If we get
the trivial solution, then we know that the trivial solution would be the only solution, and the original set
of vectors would be linearly independent. If we find that this system of equations has nontrivial
solutions, then we know that the original set of vectors is linearly dependent.
[ ]
[ ]
Looking at the leading coefficient in the second row, let’s make that a by doing :
[ ]
Looking at the second row, notice that the value for the variable is free; it can be anything. Let
, a free parameter. From the second row, we know that . Plugging in , solve
for :
( )
36
LINEAR ALGEBRA FOR BEGINNERS
Now we have [ ] [ ] [ ]. Our set of solutions consists of all vectors of the form
[ ]. So there are many solutions besides the trivial solution. Since the system has a nontrivial
[ ][ ] [ ]
[ ] [ ] [ ]
[ ]
Let’s try to solve this augmented matrix using row operations. Looking at the first and third rows, we
can cancel out the leading terms, so let’s do :
[ ]
Looking at the second row, notice the leading coefficient is 2. Let’s make that a by doing :
[ ]
Let’s get rid of the leading coefficient in the third row by doing :
37
RICHARD HAN
[ ]
From the third row, we know . So . From the second row, we know . But
. So ( ) . Therefore, . From the first row, we know . But
we know . So . Since , the set of vectors is linearly
independent.
38
LINEAR ALGEBRA FOR BEGINNERS
39
RICHARD HAN
Form the matrix with the given vectors as columns and the zero column on the right.
[ ] R1-R2 R2
[ ] 7R1-6R3 R3
[ ] -55R2+R3 R3
[ ]
The third row tells us 26z=0. So z=0. The second row tells us –y=0. So y=0. The first row tells us
6x-y+2z=0. So x=0. The system of equations has only the trivial solution. Therefore, the given
vectors are linearly independent.
Form the matrix with the given vectors as columns and the zero column on the right.
[ ] R1-R2 R2
[ ] R1-R3 R3
[ ] R2 R3
[ ]
The second row tells us –y+z=0. Let z=t. Then y=t. The first row tells us x+z=0. So x=-t.
40
LINEAR ALGEBRA FOR BEGINNERS
All solutions will of the form [ ] [ ], where t is any real number. Since the system has non-trivial
Form the matrix with the given vectors as columns and the zero column on the right.
[ ] R1+R2 R2
[ ]
The second and third rows tell us that z=0. The first row tells us x+2y+7z=0. So x+2y=0. Letting y=t, we find x=-
2t. So all solutions will be of the form [ ] [ ]. There are non-trivial solutions; so the given set of
41
RICHARD HAN
SUMMARY: VECTORS
We add two vectors by adding their corresponding entries. We multiply a vector by a scalar by
multiplying each entry in the vector by the scalar. We multiply matrix to a vector by taking the
first row of the matrix and multiplying each entry in the first row by the corresponding entry in
the vector, taking the second row of the matrix and multiplying each entry in the second row by
the corresponding entry in the vector, etc.
Let . Then the set is linearly independent just in case the vector
equation has only the trivial solution . Otherwise,
the set is said to be linearly dependent..
42
LINEAR ALGEBRA FOR BEGINNERS
4 – MATRIX OPERATIONS
We can add two matrices if they have the same size. For example, suppose we want to add the
following two matrices:
[ ] [ ]
To add these two matrices, we just add their corresponding entries like this:
[ ] [ ] [ ]
We can also multiply a matrix by a scalar. For example, let’s say the scalar is and the matrix is
[ ]. To find , we multiply each entry of by the scalar :
[ ] [ ]
[ ] [ ]
( ) [ ] ( )[ ]
[ ] [ ]
[ ]
43
RICHARD HAN
MULTIPLICATION
We can also multiply two matrices and as long as the number of columns of is equal to the
number of rows of . Let’s do an example. Suppose is a matrix and is a matrix as
follows:
[ ] and [ ]
[ ][ ] [ ]
Notice that the number of columns of is 3 and it matches up with the number of rows of . We need
this because we’re going to multiply each entry in the rows of with the corresponding entry in the
columns of . For instance, consider the first row of and the first column of .
[ ][ ]
The first entry in the first row of is and it corresponds to the first entry in the first column of ,
which is . The second entry in the first row of is 3 and it corresponds to the second entry in the first
column of , which is . The third entry in the first row of is and it corresponds to the third entry
in the first column of , which is .
To find the entry of in the first row and first column of , multiply out the corresponding entries
and add: ( ) ( ) . So the product looks like this so far:
[ ]
To find the entry of in the first row and second column, use the first row of and the second column
of , and perform the same procedure: ( ) . So we get:
[ ]
Now, move on to the second row of and the first column of to get:
[ ]
44
LINEAR ALGEBRA FOR BEGINNERS
[ ]
[ ][ ]
The number of columns of is 3 and the number of rows of is 2, and they don’t match up. So we
can’t multiply them.
Now, for a general matrix, if the number of rows is the same as the number of columns, then the matrix
is called a square matrix. We can multiply two square matrices, of the same dimension, in any order.
For example, suppose we had the following square matrices:
[ ] and [ ]
We can find :
[ ][ ] [ ]
[ ][ ] [ ]
45
RICHARD HAN
1. [ ] [ ]
2. [ ] [ ]
Find cA.
1. c=2 A=[ ]
2. c=8 A=[ ]
Find AB if A and B can be multiplied. Otherwise, indicate why they cannot be multiplied.
1. =[ ] [ ]
2. =[ ] =[ ]
3. =[ ] =[ ]
4. =[ ] =[ ]
5. =[ ] =[ ]
46
LINEAR ALGEBRA FOR BEGINNERS
3. [ ] [ ]
4. [ ] [ ]
Find cA.
3. [ ]
4. =[ ]
Find AB if A and B can be multiplied. Otherwise, indicate why they cannot be multiplied.
6. =[ ]
7. =[ ]
8. is 2 by 2 and is 3 by 3.
9. =[ ]
10. =[ ]
47
RICHARD HAN
When adding two matrices, we simply add the corresponding entries. When multiplying a
matrix by a scalar, we multiply each entry of the matrix by the scalar.
To multiply two matrices and , the number of columns of has to be the same as the number
of rows of . To find the -th entry of we take the entries of the -th row of and multiply
by the corresponding entries of the -th column of , then add the results.
A square matrix is a matrix with the same number of rows and columns.
48
LINEAR ALGEBRA FOR BEGINNERS
CONCLUSION
Congratulations on completing the Linear Algebra book! Here is a review of what we have
covered in this course:
Gaussian Elimination
Vectors
Matrix Algebra
Determinants
Vector Spaces
Subspaces
I hope this book has been useful to you, and I wish you the best in your career and future
endeavors. If you feel that you’ve benefitted from this course, I’d really appreciate it if you wrote
a short review for the book.
Be sure to get the companion online course Linear Algebra for Beginners here:
https://www.onlinemathtraining.com/linear-algebra/. For more online courses, visit:
http://www.onlinemathtraining.com/.
Richard Han
49
RICHARD HAN
INDEX
50