Math 110: Linear Algebra Homework #8: David Zywina
Math 110: Linear Algebra Homework #8: David Zywina
HOMEWORK #8
DAVID ZYWINA
First set of problems
Problem 6. If P is a permutation matrix, and Y = XP, show that Y has the same columns
as X but in a permuted order.
For each j {1, , n}, let (j) be the unique element of {1, , n} such that P
(j),j
= 1
(i.e. the unique 1 in the jth column of X occurs in the (j)th row). Since P is a permutation
matrix, the numbers (1), , (n) are a permutation of the numbers 1, , n.
Fix a j {1, , n}. For each i,
(XP)
i,j
=
n
k=1
X
i,k
P
k,j
= X
i,(j)
P
(j),j
= X
i,(j)
.
This shows that the jth column of XP is the (j)th column of X. Therefore Y has the
same columns as X but in a permuted order.
Problem 7. Show that if P
1
and P
2
are permutation matrices, then so is P
1
P
2
.
The previous problem (with X = P
1
and P = P
2
) shows that P
1
P
2
has the same columns
as P
1
but in a permuted order. Since P
1
has the same columns as the identity matrix I
(possibly permuted), this shows that the columns of P
1
P
2
are just a permutation of those of
I. Thus P
1
P
2
is a permutation matrix.
Problem 8. Show that if P is a permutation matrix, so is P
t
, and P
t
= P
1
.
A permutation matrix, by denition, is an n n matrix with exactly one 1 in each row,
one 1 in each column, and the other entries equal to 0. Since P
t
is the matrix where the
rows are swapped with columns, and columns are swapped with rows it is immediate that
P
t
must also be a permutation matrix.
We can write P =
_
c
1
c
2
c
n
, where {c
1
, , c
n
} = {e
1
, , e
n
} (e
i
is the ith
column of I). The transpose of P can be expressed as
P
t
=
_
_
c
t
1
c
t
2
.
.
.
c
t
n
_
_
.
Date: October 27th.
1
2 DAVID ZYWINA
For 1 i, j n,
(P
t
P)
i,j
= c
t
i
c
j
=
i,j
(the last equality follows from the observation that for 1 i, j n, e
t
i
e
j
=
i,j
). So P
t
P = I
and hence P is invertible with inverse P
t
.
Problem 9. Use LU decomposition to compute an LU decomposition of
A =
_
_
0 2 4
0 1 2
3 2 1
_
_
and use it to describe the complete solution set of Ax =
_
_
8
4
4
_
_
and Ax =
_
_
0
1
0
_
_
.
We need to have a non-zero element in the top left corner of our matrix to start, so we
multiply A by the permutation matrix P =
_
_
0 0 1
0 1 0
1 0 0
_
_
which interchanges the rst and
third row; we get
PA =
_
_
3 2 1
0 1 2
0 2 4
_
_
.
The rst column of PA is already done, so we now work on the second column. Subtracting
2 times the second row from the third row, gives us the matrix:
U
=
_
_
3 2 1
0 1 2
0 0 0
_
_
.
We let
L
=
_
_
1 0 0
0 1 0
0 2 1
_
_
(where the 2 is there because we multiplied the 2nd row by 2 before subtracting it from the
3rd row).
You can now check that we indeed have PA = L
=
_
_
0 0 1
0 1 0
1 0 0
_
_
_
_
1 0 0
0 1 0
0 2 1
_
_
_
_
3 2 1
0 1 2
0 0 0
_
_
.
You might argue (rightly) that this is not the LU decomposition dened in class. Since A
has rank 2, L should be a 32 matrix and U should be a 23 matrix. This can be achieved
by simply removing the last column of L
=
_
e
1
e
2
e
n
= I.
So computing A
1
=
_
c
1
c
2
c
n
i=1
[(ni+1)
2
+(ni+1)] =
n
i=1
[i
2
+i] =
n(n + 1)(2n + 1)
6
+
n(n + 1)
2
=
n
3
3
+ lower order terms
1
Recall: 1 + 2 + +n =
n(n+1)
2
and 1
2
+2
2
+ +n
2
=
n(n+1)(2n+1)
6
MATH 110: HOMEWORK #8 7
The cost of the subsequent solves with U does not change (n
3
) for a total inversion cost of
2
3
n
3
+
1
3
n
3
+ n
3
= 2n
3
(plus lower order terms).
(3b) Now suppose A is mn with rank r (the general case). How many arithmetic opera-
tions are needed to compute the LU decomposition?
Let C(m, n, r) be the number of arithmetic operations required to compute the LU de-
composition of an mn matrix with rank r.
The following argument will be done using the inductive algorithm done in lecture. First
of all, multiplying by permutation matrices requires no arithmetic operations (this just swaps
rows and columns); so we can ignore the contributions from the permutation matrices since
they do not aect the value of C(m, n, r).
Let A be an mn matrix of rank r. After a possible permuation, we may assume that
A =
_
A
1,1
A
1,2
A
2,1
A
2,2
_
,
where A
1,1
is a non-zero scalar. We then dene X = A
2,1
/A
1,1
and S = A
2,2
XA
1,2
. (For
future reference: A
1,2
is 1 (n 1), A
2,1
is (m1) 1, and A
2,2
is (m1) (n 1))
It takes m1 divisions to calculate X.
It takes (m 1)(n 1) arithmetic operations (all multiplications) to compute XA
1,2
, then
(m1)(n 1) subtractions to compute S.
Note: So far we have done (m1) + 2(m1)(n 1) arithmetic operations.
We then have
A =
_
1 0
X I
m1
__
A
1,1
A
1,2
0 S
_
.
The matrix S is (m 1) (n 1). Since A has rank r and A
1,1
= 0 we see that S has
rank r 1. Thus it takes C(m 1, n 1, r 1) arithmetic operations to compute an LU
decomposition
S = P
LS
L
S
U
S
P
RS
.
In the lecture notes, it is then derived that
A =
_
1 0
0 P
LS
__
1 0
P
t
LS
X L
S
__
A
1,1
A
1,2
P
t
RS
0 U
S
__
1 0
0 P
RS
_
.
This is the desired LU decomposition of A. Note that all of the multiplications in these
matrices are by permutation matrices and, as explained earlier, take no arithmetic operations
to perform.
Thus we have proven the recursive equation,
C(m, n, r) = (m1) + 2(m1)(n 1) + C(m1, n 1, r 1).
The base case for our recursion is C(m, n, 0) = 0 (the zero matrix is the only mn matrix
with rank 0).
8 DAVID ZYWINA
By repeated using the recursive relation until we get to our base case, we get the explicit
formula:
C(m, n, r) = (m1) + (m2) + ... + (mr)
+ 2(m1)(n 1) + 2(m2)(n 2) + ... + 2(mr)(n r)
We now write this in a more explicit form
C(m, n, r) =
r
i=1
(mi) + 2
r
i=1
(mi)(n i)
= rm
r
i=1
i + 2rmn 2(m + n)
r
i=1
i + 2
r
i=1
i
2
= rm
r(r + 1)
2
+ 2rmn 2(m + n)
r(r + 1)
2
+ 2
r(r + 1)(2r + 1)
6
To get a better idea on the growth of this value we collect all the higher order terms (the
terms of degree 3).
C(m, n, r) = 2rmn (m + n)r
2
+
2
3
r
3
+ lower order terms .
For the special case where m = r = n, we get
C(n) := C(n, n, n) =
2
3
n
3
+ lower order terms
as in lecture.