Matrices and Determinants Project
Matrices and Determinants Project
Matrices and Determinants Project
An m × n matrix is a rectangular array of numbers which has m rows and n columns. We usually
put brackets or parentheses around them. Here is a 2 × 3 matrix.
1 4 π
−2 3 0
We locate entries in a matrix by specifying its row and column entry. The 1-2 entry (first row,
second column) of the above matrix is 4. In general we index the entries of an arbitrary n × k matrix
like this:
a11 a12 . . . a1k
a21 a22 . . . a2k
A := .
.. ..
.. . ... .
an1 an2 . . . ank
Then the i-j entry of A is denoted by aij , and we can denotetheentire matrix by A = (aij ). Note
x1
x2
that a vector ~x ∈ Rn can be interpreted as the n × 1 matrix . .
..
xn
Definition: Two matrices are said to be equal if their corresponding entries are equal.
There are two basic binary operations which we will define on matrices – matrix addition and
matrix multiplication.
Definition: Take two matrices A = (aij ) and B = (bij ). The sum of A and B, is defined to be the
following:
a11 a12 . . . a1k b11 b12 . . . b1k a11 + b11 a12 + b12 . . . a1k + b1k
a21 a22 . . . a2k b21 b22 . . . b2k a21 + b21 a22 + b22 . . . a2k + b2k
A+B = . .. + .. .. =
.. .. .. .. ..
..
. ... . . . ... . . . ... .
an1 an2 . . . ank bn1 bn2 . . . bnk an1 + bn1 an2 + bn2 . . . ank bnk
Problem 1 What can you say about the sizes of the matrices A and B as compared to the size of
the matrix A + B? Are there any restrictions?
Problem 2 Prove that matrix addition is both commutative and associative.
This project is adapted from material generously supplied by Prof. Elizabeth Thoren at UC Santa Barbara.
1
We now turn our attention to matrix multiplication. The motivation for our definition comes
from our desire to represent a system of linear equations as a matrix multiplication. Consider the
following system of linear equations
x1 + 2x2 + 3x3 = 1
x1 + x2 + x3 = 2
x1 + 4x2 + 7x3 = 1.
From this system we can form the matrix equation A~x = ~b as follows. Note that the multiplication
of a matrix and a vector returns another vector.
1 2 3 x1 1
1 1 1 x2 = 2
1 4 7 x3 1
We wish to define matrix multiplication such that the above equation is valid (i.e. that the original
system of equations can be recovered from this matrix equation). As another example, the system
x1 + 2x2 + 3x3 + 4x4 = 1
2x1 + 4x2 + 6x3 + 8x4 = 2
can be expressed as the matrix multiplication
x1
1 2 3 x2 = 1
4
2 4 6 8 x3 2
x4
The idea is that a row of the first matrix, times a column of the second matrix gives the corresponding
row-column entry of the product matrix. Notice that the additions become implicit once we write a
system in terms of a matrix.
Here are some more examples.
1 2 5 17 1 2 5 1 17 1
= , =
3 4 6 39 3 4 6 0 39 3
Definition: Let A be an m × n matrix and B be an n × p matrix. Then the product of A and B,
denoted AB is the m × p matrix whose i-j entry, denoted (AB)ij , is the sum of the products of
corresponding entries from row i of A and column j of B. Thus, we have that
(AB)ij = ai1 b1j + ai2 b2j + · · · + ain bnj .
Optional (but recommended) Problem: Re-write the definition of matrix multiplication as a
statement involving summation symbols.
Example: Matrix multiplication for 2 × 2 matrices. Let
a1 a2 b1 b2
A= and B =
a3 a4 b3 b4
Then
a1 b1 + a2 b3 a1 b2 + a2 b4
AB =
a3 b1 + a4 b3 a3 b2 + a4 b4
b b
and notice that the columns of AB are A 1 and A 2 .
b3 b4
In fact, given a matrix A and a matrix B whose columns are b~1 , b~2 , . . . , b~p , if the product AB is
defined then it’s columns are Ab~1 , Ab~2 , . . . , Ab~p .
2
7
1 2 3
Problem 3: Let A = and ~x = 8. Compute A~x
4 5 6
9
Problem 4 What can you say about the sizes of the matrices A and B as compared to the product
AB? Are there any restrictions?
Problem 5 Compute the following matrix products:
5 1
1 1 3 1 2 0
=? , 6 0 =?
−1 0 3 3 4 0
1 0
3
3 Determinants
Every square matrix, A, has a numerical value associated with it called its determinant, denoted
det(A). We will denote the determinant of a matrix by putting absolute value bars around the
matrix. In this section, we will define the determinant and explore some of its uses.
Definition: The determinant of a 2 × 2 matrix is the product of the diagonal elements minus the
product of the off-diagonal elements:
a a12
det(A) = 11 = a11 a22 − a12 a21 .
a21 a22
3 −1
Problem 8 Let ~u = and ~v = .
−2 4
a
(a) To show that {~u, ~v} spans R you must show that any vector ~a = 1 can be represented as
2
a2
a linear combination of ~u and ~v. Write the system of linear equations that you need to solve,
then write this system as a matrix equation.
(b) Solve the system. Does {~u, ~v} span R2 ?
(c) Compute det(A) from your matrix equation.
−1 2
Problem 9 Same problem as Problem 8, but with ~u = and ~v = .
4 −8
u v
Problem 10 Now let ~u = 1 and ~v = 1 . Similarly to the last two problems, to show that
u2 v2
{~u, ~v} spans R2 , you must solve the following system for x and y
u1 x + v1 y = a1
u2 x + v2 y = a2
u v1
Use this idea to prove that 1 6= 0 if and only if {~u, ~v} spans R2 .
u2 v2
We usually express the 3 × 3 determinant in terms of the cofactor expansion. The idea is to
compute the determinant by computing the determinants of smaller 2 × 2 submatrices. Notice that
a1 b1 c1
b c a c a b
det a2 b2 c2 = a1 · det 2 2 − b1 · det 2 2 + c1 · det 2 2 .
b3 c3 a3 c3 a3 b3
a3 b3 c3
Problem 11 Verify that computing the determinant of a 3 × 3 matrix using cofactor expansion
matches the definition of its determinant found in our textbook.
The cofactor expansions for the determinant give det(A) in terms of the determinants of the
maximal submatrices of A taken along a specific row or column. It turns out that all of the cofactor
expansions give they same value, which is the determinant. So, for example the determinant can
4
be expressed as the cofactor expansion along the third column or the cofactor expansion along the
second row and both computations will give the same value:
a11 a12 a13
det(A) = det a21 a22 a23 = a13 det(A(1|3)) − a23 det(A(2|3)) + a33 det(A(3|3))
a31 a32 a33
= −a21 det(A(2|1)) + a22 det(A(2|2)) − a23 det(A(2|3)).
Notice that the sign in front of the term aij det(Ai|j) is (−1)i+j .
Problem 12 (a) Conjecture a general formula for the cofactor expansion along the 2nd column of
a 3 × 3 matrix.
(b) Test your formula by using it to compute the determinants of the following matrices:
1 0 1 1 0 1 1 0 3
(i) 1 3 0 (ii) 1 1 0 (iii) 2 1 4
3 −1 0 0 0 2 1 0 1
Problem 13 Use cofactor expansion to compute the following
4 0 −7 3 −5
1 4 −2 3
0 0 2 0 0
−4 5 −1 2
and 7 3 −6 4 −8
3 3 3 1
−2 3 7 2
5 0 5
2 −3
0 0 9 −1 2
In order to make sense of cofactor expansion along a column of a matrix, we need to explore
what happens to the determinant when we flip the entries - i.e. take the transpose of the matrix:
Problem 16 Say you have a set, S, of n vectors in Rn , and you are interested in whether or not
they span Rn . Let ~b be an arbitrary vector in Rn and form the matrix equation A~x = ~b where the
columns of A are the vectors in S. How does this equation relate determinants and the question of
whether or not S spans Rn ? What about whether or not S is a basis for Rn ?