Math 218D-1: Homework #2
due Wednesday, January 21, at 11:59pm
Once you are comfortable doing the Gauss–Jordan elimination algo-
rithm(s) by hand, please start using SymPy on the Sage cell on the course
webpage to do the computations! Just write “used SymPy” so that you
don’t confuse the graders. This class is about formulating linear algebra
problems that a computer can solve, not mastering computations that a
computer can do better than you. (You will still need to do computations
by hand on exams.)
Sage cell tips:
# Specify a matrix
A = Matrix([[1, 1, 0],
[1, 2, 1],
[0, 1, 2]])
# Shorthand for specifying a column vector
b = Matrix([1, 2, 3])
# Solve Ax=b (only works when there’s a unique solution)
pprint([Link](b))
# Or, augment [A|b] and find the rref:
pprint(A.row_join(b).rref(pivots=False))
1. In the table below, a linear system is expressed as a system of equations, as a matrix
equation, as a vector equation, or as an augmented matrix. Fill in the rows of the
table with the other three equivalent ways of writing each system of equations.
System of Equations Matrix Equation Vector Equation Augmented Matrix
3x 1 + 2x 2 + 4x 3 = 9
→x 1 + 4x 3 = 2
3 →5 % & 1
2 x 1
4 = 1
x2
→1 1 2
1 2 1
x 1 4 + x 2 1 = 2
→1 2 3
1 0 1 1 2
0 3 →1 →2 4
1 →3 →4 →3 2
6 5 →1 →8 1
2. Consider the following system of equations:
x 1 → 2x 2 + x 3 = 1
→2x 1 + 5x 2 + 5x 3 = 2
3x 1 → 7x 2 → 7x 3 = 2.
a) Rewrite the system as an augmented matrix.
b) Use row replacements to eliminate x 1 from the second and third equations.
c) Use a row replacement to eliminate x 2 from the third equation (with x 1 still
only appearing in the first).
d) Translate your augmented matrix back into a system of equations.
e) Solve for x 3 , then for x 2 , then for x 1 . What is the solution?
Show your work.
3. (Internalizing a Definition) Which of the following matrices are not in row eche-
lon form? Why not?
) * ) * ) * ) *
1 3 0 0 3 0 1 0 2 3 4 1 2 3 4 1
0 2 0 0 1 0 2 3 0 9 3 1 0 0 0 0
0 0 3 4 0 0 0 4 0 0 0 1 0 0 0 1
1 0 2 1
+ , + , 0
1 0 2
1 0 2 4 0 1 2 4 2 0 0 4
4 0 0 0
4. The matrix below can be transformed into row echelon form using exactly two row
operations. What are they?
) *
2 4 →2 4
→1 →2 1 →2
0 2 0 3
5. (Internalizing a Definition) Which of the following matrices are not in reduced
row echelon form? Why not?
) * ) * ) * ) *
1 0 0 0 3 0 1 0 1 0 4 0 1 3 4 0
0 1 0 0 1 0 2 3 0 1 3 0 0 0 0 0
0 0 3 4 0 0 0 4 0 0 0 1 0 0 0 1
0 ) * ) *
1 2 1 0 1 0 0 2
1
0 0 0 1 0 0 1 0 1
0 0 0 1 0 0 1 9
0
6. (Practicing a Procedure) Use Gaussian elimination to reduce the following ma-
trices into REF, and then Jordan substitution to reduce to RREF. Circle the first
REF matrix that you produce, and circle the pivots in your REF and RREF matri-
ces. You’re welcome to use Rabinoff’s Reliable Row Reducer, but write out all row
operations you perform.
) * ) * ) * ) *
1 1 0 1 1 0 1 1 2 0 0 0 2 2
a) 1 2 1 b) 1 1 1 1 c) 1 2 0 d) 1 →1 3 →1
0 1 2 0 1 2 2 0 1 2 →1 1 1 8
Check your work using SymPy. For instance, in a) you would do something like:
A = Matrix([[1, 1, 0],
[1, 2, 1],
[0, 1, 2]])
pprint(A.echelon_form())
pprint([Link](pivots=False))
(Omitting pivots=False would cause Sympy to print the pivot locations as well.
Note that Sympy may produce a different REF than you.)
By the way, Sympy has no notion of an augmented matrix—the augmentation
line only exists to help a human remember that it came from a system of equations.
To solve b) in Sympy, you would do something like:
A = Matrix([[1, 1, 0, 1],
[1, 2, 1, 1],
[0, 1, 2, 2]])
# or even fancier:
A = Matrix([[1, 1, 0],
[1, 2, 1],
[0, 1, 2]]).row_join(Matrix([1, 1, 2]))
7. (Practicing a Procedure) Solve each of the following systems of equations (they
all have a unique solution).
→x 1 + 4x 3 = 2 ) * ) *
0 3 2 11
a) 3x 1 + 2x 2 + 4x 3 = 8 b) 1 3 →3 x = →7
2x 1 + x 2 + 3x 3 = 0 4 9 →16 →47
2 1 →2 →1 5
6 6 →5 →1 15
c) x 1 + x 2 + x 3 + x 4 =
4 →4 →5 →7 7
→2 →1 5 0 →12
8. The parabola y = ax 2 + b x + c passes through the points (1, 4), (2, 9), (→1, 6). Find
the coefficients a, b, c.
9. Find values of a and b such that the following system has a) zero, b) exactly one,
and c) infinitely many solutions.
2x + a y = 4
x→ y =b
[Find the relevant criterion involving pivots in the notes.]
10. Give examples of matrices A in reduced row echelon form for which the number of
solutions of Ax = b is:
a) 0 or 1, depending on b
b) ↑ for every b
c) 0 or ↑, depending on b
d) 1 for every b.
Is there a square matrix satisfying b)? Why or why not?
11. (Practicing a Procedure) For each matrix A and vector b, decide if the system
Ax = b is consistent. If so, find the parametric vector form of the general solution
of Ax = b. For instance,
- .- . - . - . - . - .
1 →1 x1 1 x1 1 1
= = + x2
2 →2 x2 2 x2 0 1
Also answer the following questions (for the systems that have solutions): Which
variables are free? How many solutions does the system have? What is the dimen-
sion of the solution set?
- . - .
2 1 1 4 1
a) A= b=
4 2 1 7 1
) * ) *
2 2 →1 3
b) A = →4 →5 5 b= 2
6 1 12 49
) * ) *
2 2 →1 3
c) A = →4 →5 5 b= 2
6 1 12 48
1 2 3 →1 1 2
→2 →4 →5 4 1 4
d) A= b=
1 2 2 →3 →1 →6
→3 →6 →7 7 6 10
) * ) *
1 1 0 2
e) A= 1 2 1 b= 5
0 1 2 4
You can check your work again using SymPy. When Ax = b has infinitely many
solutions, [Link](b) will throw an error; instead, try this:
A = Matrix([[2, 1, 1, 4],
[4, 2, 1, 7]])
b = Matrix([1, 1])
# Find the parametric form (free variables are labelled
# tau0, tau1, ...)
pprint(A.gauss_jordan_solve(b))
# Or, form the augmented matrix (A|b) and find its rref,
# then do the rest by hand:
pprint(A.row_join(b).rref(pivots=False))
) * ) * ) * ) *
3 1 4 7
12. Is 3 a linear combination of 2 , 5 , 8 ? If so, what are the weights?
3 3 6 9
[Translate the problem into a linear algebra problem that you can solve.]
13. (Foreshadowing) Find the parametric vector form of the solution sets of the fol-
lowing systems of equations:
/ /
2x 1 + x 2 + x 3 = 0 2x 1 + x 2 + x 3 = 1
4x 1 + 2x 2 + x 3 = 0 4x 1 + 2x 2 + x 3 = 1
How are the solution sets related to each other geometrically?
14. Find a 2 ↓ 3 matrix A in RREF and a vector b such that the solution set of Ax = b
consists of all vectors of the form
) *
1+ t
2→ t t ↔ R.
t
15. Suppose that A is a 3↓3 matrix and b is a vector such that the solution set of Ax = b
is a line in R3 . How many pivots does A have?
16. (Examples Problem) In each part, find an example of a matrix with the stated
property, or explain why no such matrix exists.
a) A 3 ↓ 3 matrix with one free variable.
b) An invertible 3 ↓ 3 matrix with one free variable.
c) A 2 ↓ 3 matrix with 3 pivots.
d) A 2 ↓ 3 matrix with no free variables.
e) A 3 ↓ 2 matrix A such that Ax = (1, 1, 1) has infinitely many solutions.
f) An invertible 2 ↓ 2 matrix A such that A3 is not invertible.
17. (Practicing a Procedure) Use the formula for the 2 ↓ 2 inverse to compute the
inverses of the following matrices. If the matrix is not invertible, explain why.
- . - . - .
1 2 3 7 1 2
a) b) c)
3 4 2 4 2 4
18. (Practicing a Procedure) Compute the inverses of the following matrices by Gauss–
Jordan elimination. If the matrix is not invertible, explain why. You’re welcome to
use Rabinoff’s Reliable Row Reducer, but write out all row operations you perform.
) * ) * ) *
1 1 0 1 0 →2 1 2 3
a) 1 2 1 b) 2 →3 4 c) 4 5 6
0 1 2 →3 1 4 7 8 9
6 →4 →7 →1
7 0 1 3
d)
→1 2 3 1
2 0 1 1
Check your answers in SymPy, as in:
A = Matrix([[1, 1, 0],
[1, 2, 1],
[0, 1, 2]])
pprint([Link]())
19. Consider the linear system
x1 + x2 = b1
x 1 + 2x 2 + x 3 = b2
x 2 + 2x 3 = b3 .
Use the Problem 18(a) to solve for x 1 , x 2 , x 3 in terms of b1 , b2 , b3 . Do not use
Gauss–Jordan elimination!
[Find the relevant big red box in the notes.]
20. Suppose that
) * ) * ) * ) * ) * ) *
1 1 →1 0 2 0
A 2 = 0 A 3 = 1 A →1 = 0 .
4 0 2 0 3 1
What is A→1 ?
[Hint: multiply both sides by A→1 . This requires no computations.]
21. Suppose that A, B, and C are invertible 3 ↓ 3 matrices. Simplify the following ex-
pressions (write them without parentheses or unnecessary identity matrices):
a) (ABC)→1 b) C(A → 2I3 )C →1 c) AT (A→1 ) T d) A3 (A→1 )2
11
E a
f at sc 1
II [Link] ta
1
i list it
[Link] I I E e [Link] nl tl
2
3 7 7
b
1 2 1
0 1 7 4
0 1 10 1
1 0 3
4
3
d x 222 23 1
x2 723 4
3 2 3 3
e 323 3
23 1
a 2 7223 4
22 7 1 4
22 11
x 222 23 1
2 2 11 1 1
x 24
solution
I
x
x x x
Not REF because 2ⁿᵈ row
pivot is in same column as 1ˢᵗ
row
pivot
Not REF because zero row
is not at the bottom
Pivots in the same column
zero row not at the bottom
zero rows not at the bottom
Second and third pivot are all in
the same column
1 Row Replacement
Rat ER
2 Row Swap
Rc r
All pivots I
Not in REF pivots not to the
rightbe
of each other Not REF cannot
RREF
Not in REF zero row above
non zero column cannot be RREF
zero row above non zero not
REF not RREF
second pivot is not the only
non zero value in the column
1 23.1.1
1 at
4 let t
1 l 1
11
I l
1 1
l l
1
1
tie it it
R R 3R2 R3
a x 42 3 2
x 4 3 2
3h 222 423 8 3 423 2 222 423 8
1223 6 222 423 8
1623 222 14
22 212 323 0 2 423 2 22 323 0
823 4 22 323 0
il k 3 a 2 4
16213 222 14
3 242 8
623 6 2 1
11 1 22 4
2 15
se 423 2 4 1 2 6
6 15 1
a
Eng
Rabinoff REF
Row reducer
1,0 RREF using
Row
Rabinoff
reducer
x 2
22 1
23 4
I It
REF by Rabinagy
1 1 Row reducer
f k3
24
2
1
8 a b c 4
4 a 2b C 9
a b c 6
[Link] l l
1
a 2
b 1
c 3
19 22 ay 4
x b
y
915
a
1 diatal 2b
a 2 0 a 2
b any number
b 2
b Pivot in every non augmented
column
care's 4 b
a
at 2 0
a 2
b any number
c b
o at 2 4 2b need to make this
a zero row
a 2
b 2
110
88 8
1
1 1
No there is no
square matrix because in an non
matrix if there are n pivots there are no free variables
and so ion't be α if less than n pivots must
be a zero row which means can be 0 solutions so
doesn't work
111
a
a 2 b i
Ili 36 1 41 1
consistent
o T1
0 0 1
1 1
1
Free variables
x 22 Z x 4 0
R 3 I 1
12 822
us x Y R2 24
24 24
Solution set is 2 dimensional
plane there are
isoffitens
1 0 19
2
o s s
0 0 0 0
free nor
usingbinaft consistent
Row reducer
x 5223
22 323 f
x 5223
8 23
a 323
23 23
Solution set is 1 dimension
line there are infinite
solutions
t L C
inconsistent
d 2 3 1 1 2 7 0 22
I
free consistent
2 222 7214 22 variables
8
23 2214
0
see
x 22 222 724
22 22
23 8 224
ay 2 4
25 0
f
a
The solution set is 2 D there are infinite solutions
e
se 0
a 2
Nz 0
solution set is
o dimensional i.e it is a
point and there is only
one solution
12
a
5 a
E a
1 I
2 23 1
2 2 223 1
x 1 23
x2 1 22 3
23 23
weights are dependent on 23
13 22 22 23 0
42 222 213 0
iii 1 1
free var
2 22 0
23 0
x 22
23
me a
0
at
1
x 22 0
x 3 1
t
É JÉ 22
Geometrically both lines are parallel
14
I
E [Link] 23 t free variable
ii i a d B d
15 A has 2 line the solution
pivots a means
set is 1 dimensional and so the matrix has
a free variable Hence 2 pivots
16
b Not possible because if a matrix is
invertible its RREF is Matrix
the Identity In
which has no free variables and you can
only have a free variable if in RREF there
is a column with no pivot
c Not possible there must be atleast as
many rows as there are pivots so
there cannot be 3 pivots in a 2 3
matrix
d Not possible There be 2
can max pivots
in 2 3 matrix column
a
leaving a
without a pivot therefore leaving a
free variable
e N solutions atleast 1 free variable
3 2 matrix
i
1
f Not possible powers of invertible
matrices are also invertible
17
at
d
5 12
1
1 51
Not invertible belause RREF form is
not Iz
18
I
R2 R2 Ri
R3 R3 Ri
R R R2
R2 R2 P3
R IR R3
0 0 1
R3 R3 3R
R2 R2 2R
Re Rz 3R3
R2 Rs
R R R3
R2 R2 R3
R3 R3
8 1 3
Iniesta
1
R2 R2 4R
Rs Rz 7R
R3 Rz 2R2
R2 R2
R R 282
1 l
Not invertible RREF Is
III
R R 3Ry R2 R2 7R3 Ru Ru 2R3
Ry Ry 2R3 Rs R R R ER
Ry RytR R3 R3 R2 R R 3384
R3 7R R2 R2 R4 Ry Ry R3
R 3R R2 3R2 Ry 13R4
R R R4 R2 R2 8R4 Rs R3 8R4
R JR R2 R2 Rs R3
Ry Ry
I
i i
1191 Ax b
se A b
11
EE
20
a a a a
E a a
1 a i A
21
a ABC AB c
B A c
C B A I
b C A 213 C
A 2CI3 C
CA 2C C
CAC 2CC
CAC 213
At A AA A A A Is
d A A AAAA A
AAISA
AAA
AI3
A