Homework 5 - Solutions

Homework 5 - Solutions
Exercise 1 (1 pt.)
Let T : R2 → R4 and S : R4 → R3 be the the linear transformations given by the matrices




4 −1
1 0 0
4
 0

2 
 2 6 −1 −3  ,
A=
 −1 3  and B =
−1 7 2
2
5
0
respectively. Find the matrix associated to the linear transformation S ◦ T .
Solution
The matrix associated to the composition S ◦ T is



1 0 0
4

BA =  2 6 −1 −3  

−1 7 2
2
the product BA. This is



4 −1
24 −1

0
2  
= −6 7 
−1 3 
4 21
5
0
Exercise 2 (1 pt.)
Let T : R2 → R2 be the linear transformation that rotates a vector by an angle of θ. Let R : R2 → R2
be the linear transformation that reflects a vector about the x-axis. Find the matrix associated
to the composition R ◦ T ◦ R (which is a linear transformation R2 → R2 ). What is its geometric
interpretation?
Solution
The transformations T and R are given by the matrices
1 0
cos θ − sin θ
,
and B =
A=
0 −1
sin θ cos θ
respectively. Then the composition R ◦ T ◦ R is given by the matrix
1 0
cos θ − sin θ
1 0
cos θ − sin θ
1 0
BAB =
=
0 −1
sin θ cos θ
0 −1
− sin θ − cos θ
0 −1
cos θ sin θ
cos(−θ) − sin(−θ)
=
=
− sin θ cos θ
sin(−θ) cos(−θ)
This matrix describes rotation by an angle of −θ, hence R ◦ T ◦ R is the linear transformation that
rotates vectors by an angle of −θ (or equivalently it rotates vectors clockwise by an angle of θ).
Exercise 3 (2 pt.)
We define the square of an n × n matrix A to be A2 = A · A.
(a) Consider the matrices
A=
5 −1
1 2
,
Calculate (A + B)2 and A2 + 2AB + B 2 .
1
B=
1 0
4 −3
.
(b) We know that (a + b)2 = a2 + 2ab + b2 for any two real numbers a, b, but we have seen
in (a) that if A and B are arbitrary square matrices, then (A + B)2 may be different from
A2 +2AB +B 2 , so the identity (A+B)2 = A2 +2AB +B 2 does not hold for (square) matrices.
Explain why this identity works for numbers but not for matrices.
(c) If A and B are arbitrary square matrices (not the ones given above), use the properties of
matrix multiplication to show that (A + B)2 + (A − B)2 = 2A2 + 2B 2 .
Solution
6 −1
(a) A + B =
+
=
5 −1
6 −1
6 −1
31 −5
2
(A + B) = (A + B)(A + B) =
=
5 −1
5 −1
25 −4
5 −1
5 −1
24 −7
A2 = A · A =
=
1 2
1 2
7
3
5 −1
1 0
1 3
2
6
2AB = 2
=2
=
1 2
4 −3
9 −6
18 −12
1 0
1 0
1 0
=
B2 = B · B =
−8 9
4 −3
4 −3
24 −7
2
6
27 −1
1 0
2
2
A + 2AB + B =
=
+
+
17 0
−8 9
7
3
18 −12
5 −1
1 2
1 0
4 −3
(b) The proof of the identity (a + b)2 = a2 + 2ab + b2 is as follows:
(a + b)2 = (a + b)(a + b) = a2 + ab + ba + b2 = a2 + ab + ab + b2 = a2 + 2ab + b2 .
The proof uses the commutative property of numbers, i.e. ab = ba, which does not hold for
matrices. So, one can use the distributive property of matrices to get
(A + B)2 = (A + B)(A + B) = A2 + AB + BA + B 2 ,
but commutativity does not hold for matrix multiplication, so that, in general, AB 6= BA,
which implies A2 + AB + BA + B 2 6= A2 + 2AB + B 2 .
(c) From the definition of the square of a matrix and the distributive property of matrix multiplication we know that (A + B)2 = A2 + AB + BA + B 2 (see the solution of part (b)).
Similarly,
(A − B)2 = (A − B)(A − B) = A2 − AB − BA + B 2 .
Adding these two together we get
(A + B)2 + (A − B)2 = A2 + AB + BA + B 2 + A2 − AB − BA + B 2 = 2A2 + 2B 2 .
Exercise 4 (2 pt.)
Using Theorem 2.1.3 from the book, prove that if T : Rn → Rm and S : Rk → Rn are linear
transformations with associated matrices A and B, respectively, then the composition T ◦ S :
Rm → Rk is a linear transformation given by the matrix AB.
2
Solution
We show that T ◦ S is a linear transformation using Theorem 2.1.3. We need to show that T ◦ S
satisfies properties (i) and (ii) of that theorem. For (i), let ~x, ~y ∈ Rk . Since T and S are linear,
they do satisfy property (i). Therefore,
(T ◦ S)(~x + ~y ) = T (S(~x + ~y )) = T (S(~x) + S(~y )) = T (S(~x)) + T (S(~y )) = (T ◦ S)(~x) + (T ◦ S)(~y ).
This is property (i). For property (ii), let ~x ∈ Rk and c ∈ R. Then, since T and S are linear, they
do satisfy property (ii), and so
(T ◦ S)(c~x) = T (S(c~x)) = T (c S(~x)) = c T (S(~x)) = c (T ◦ S)(~x).
This is property (ii). We deduce that T ◦ S is indeed a linear transformation.
Now we show that the matrix associated to T ◦ S is the product AB. The matrix of T ◦ S is


|
|
|
 (T ◦ S)(~e1 ) (T ◦ S)(~e2 ) . . . (T ◦ S)(~ek ) 
|
|
|
We calculate the (T ◦ S)(~ei ) for i = 1, 2, . . . , k. If ~vi is the i-th column of B, so that


|
|
|
B =  ~v1 ~v2 . . . ~vk 
|
|
|
then
B~ei = 0 · ~v1 + · · · + 0 · ~vi−1 + 1 · ~vi + 0 · ~vi+1 + · · · + 0 · ~vk = ~vi ;
recall that B~x = x1~v1 + x2~v2 + · · · + xk~vk for any ~x ∈ Rk . Therefore,
(T ◦ S)(~ei ) = T (S(~ei )) = T (B~ei ) = T (~vi ) = A~
vi .
So, the matrix associated to T ◦ S is


|
|
|
 A~v1 A~v2 . . . A~vk  = AB,
|
|
|
as required.
Exercise 5 (1 pt.)
Show that matrix multiplication is an associative operation, i.e. show that (AB)C = A(BC) for
all A ∈ Mm×n (R), B ∈ Mn×k (R), C ∈ Mk×l (R).
Solution
Pick any matrices A ∈ Mm×n (R), B ∈ Mn×k (R), C ∈ Mk×l (R). Let
T : Rn → Rm ,
S : Rk → Rn ,
R : Rl → Rk
be the linear transformations given by the matrices A, B, and C, respectively. Consider the
compositions (T ◦ S) ◦ R and T ◦ (S ◦ R); they are both linear transformations Rl → Rm . The
matrix associated to T ◦ S is AB, and so the one associated to (T ◦ S) ◦ R is (AB)C. Similarly, the
matrix associated to S ◦ R is BC, and so the one associated to T ◦ (S ◦ R) is A(BC).
3
Recall that if M, N ∈ Mm×l (R) are arbitrary matrices, then M~x = N~x for all ~x ∈ Rl if and
only if M = N . Pick any vector ~x ∈ Rl . Then
((T ◦ S) ◦ R) (~x) = (T ◦ S)(R(~x)) = T (S(R(~x))) = T ((S ◦ R)(~x)) = (T ◦ (S ◦ R)) (~x).
We see that ((T ◦ S) ◦ R) (~x) = (T ◦ (S ◦ R)) (~x) for every vector ~x ∈ Rl . Since the matrix associated to (T ◦ S) ◦ R is (AB)C, and the one associated to T ◦ (S ◦ R) is A(BC), we get that
((AB)C)~x = (A(BC))~x for all ~x ∈ Rl . It follows that (AB)C = A(BC), which is what we wanted
to show.
Exercise 6 (1 pt.)
Show the following properties of matrix products:
(i) Im A = A and AIn = A for all A ∈ Mm×n (R), where Im and In are the m × m and n × n
identity matrices, respectively.
(ii) (A + B)C = AC + BC for all A, B ∈ Mm×n (R), C ∈ Mn×k (R).
(iii) (cA)B = c(AB) = A(cB) for all A ∈ Mm×n (R), B ∈ Mn×k (R), c ∈ R.
Solution
(i) Pick matrices A, B ∈ Mm×n (R) and C ∈ Mn×k (R). Let ~v1 , ~v2 , . . . , ~vk be the columns of C, so
that


|
|
|
C =  ~v1 ~v2 . . . ~vk  .
|
|
|
Recall that (A + B)~x = A~x + B~x for any ~x ∈ Rn . Then


|
|
|
(A + B)C =  (A + B)~v1 (A + B)~v2 . . . (A + B)~vk 
|
|
|


|
|
|
=  A~v1 + B~v1 A~v2 + B~v2 . . . A~vk + B~vk 
|
|
|

 

|
|
|
|
|
|
=  A~v1 A~v2 . . . A~vk  +  B~v1 B~v2 . . . B~vk  = AC + BC
|
|
|
|
|
|
Therefore (A + B)C = AC + BC, as required.
(ii) Let A ∈ Mm×n (R), B ∈ Mn×k (R), and c ∈ R. Let ~v1 , ~v2 , . . . , ~vk be the columns of B, so that


|
|
|
B =  ~v1 ~v2 . . . ~vk  .
|
|
|
Recall that (cA)~x = c(A~x) for any ~x ∈ Rn . We have

 

|
|
|
|
|
|
(cA)B =  (cA)~v1 (cA)~v2 . . . (cA)~vk  =  c(A~v1 ) c(A~v2 ) . . . c(A~vk ) 
|
|
|
|
|
|


|
|
|
= c  A~v1 A~v2 . . . A~vk  = c(AB)
|
|
|
4
Therefore (cA)B = c(AB).
The matrix cB has columns c~v1 , c~v2 , . . . , c~vk , so that


|
|
|
cB =  c~v1 c~v2 . . . c~vk  .
|
|
|
Using that (cA)~x = A(c~x) for all ~x ∈ Rn , we get

 

|
|
|
|
|
|
(cA)B =  (cA)~v1 (cA)~v2 . . . (cA)~vk  =  A(c~v1 ) A(c~v2 ) . . . A(c~vk )  = A(cB).
|
|
|
|
|
|
5