Practice Problems 4

Lecture 4: Matrix Multiplication, Vectors, and Special Matrices

Problem numbers refer to the textbook (Chiang & Wainwright, 4th edition). These are not graded, but you should attempt them all before the quiz. Try each part yourself first, then expand the Solution to check.

Exercise 4.4

5. (e) Find (i) C=AB, and (ii) D=BA, if A=[−247]B=[36−2]

Solution

C=AB=[−6−1241224−82142−14]3×3D=BA=[3×(−2)+6×4+(−2)×7]=[4]1×1

7. If the matrix A in Example 5 had all its four elements nonzero, would xTAx still give a weighted sum of squares? Would the associative law still apply?

Solution

In Example 5, x=[x1x2] and A=[a1100a22], in which case xTAx=[x1x2][a1100a22][x1x2]=a11x12+a22x22⏟weighted sum of squares=∑i=12aiixi2

But if all four elements of A are nonzero, xTAx=[x1x2][a11a12a21a22][x1x2]=a11x12+(a21+a12)x1x2+a22x22 which is no longer a weighted sum of squares. The associative law (xTA)x=xT(Ax) applies in both cases (after all, it’s a law!) as all the products are possible.

Exercise 4.5

1. Given A=[−1570−24],b=[960],x=[x1x2], calculate the following, indicating the dimension of the identity matrix used in each case.

  1. AI
Solution

AI=[−1570−24][100010001]3×3=[−1570−24]=A

  1. IA
Solution

IA=[1001]2×2[−1570−24]=[−1570−24]=A

  1. Ix
Solution

Ix=[1001]2×2[x1x2]=[x1x2]=x

  1. xTI
Solution

xTI=[x1x2][1001]2×2=[x1x2]=xT

4. Show that the diagonal matrix [a110⋯00a22⋯0⋯⋯⋯⋯00⋯ann] can be idempotent only if each diagonal element is either 1 or 0. How many different numerical idempotent diagonal matrices of dimension n×n can be constructed altogether from such a matrix?

Solution

Start with a 2×2 diagonal matrix: [a1100a22][a1100a22]=[a11200a222]

x=x2 only for x=0,1, so a11 and a22 can each be 0 or 1. The 2×2 idempotent diagonal matrices are [1000],[1001],[0000],[0001]

More generally, an n×n matrix allows 2n such matrices: there are n diagonal elements, each of which can take two values.

Exercise 4.6

2. Given A=[04−13],B=[3−801], and C=[109611], verify that

  1. (A+B)T=AT+BT
Solution

A+B=[3−4−14], so (A+B)T=[3−1−44] AT+BT=[0−143]+[30−81]=[3−1−44]✓

  1. (AC)T=CTAT
Solution

AC=[04−13]2×2[109611]2×3=[2444173−6]2×3 CTAT=[160191]3×2[0−143]2×2=[2417434−6]3×2=(AC)T✓

6. Let A=I−X(XTX)−1XT.

  1. Must A be square? Must (XTX) be square? Must X be square?
Solution

Say the dimension of X is m×n. Then the dimension of Xn×mTXm×n is n×n, so the dimension of (XTX)−1 is also n×n. This implies that the dimension of Xm×n(XTX)n×n−1Xn×mT is m×m. Hence, XTX and A must be square matrices, but X need not be square.

  1. Show that matrix A is idempotent.
Solution

To prove a matrix is idempotent, we need to show AA=A: AA=(I−X(XTX)−1XT)(I−X(XTX)−1XT)=I−X(XTX)−1XT−X(XTX)−1XT+X(XTX)−1XTX⏟I(XTX)−1XT=I−X(XTX)−1XT=A

Exercise 5.1

3. Are the rows linearly independent in each of the following?

  1. [2489−3]
  2. [2002]
  3. [0432]
  4. [−152−10]
Solution
  1. Yes
  2. Yes
  3. Yes
  4. No; the second row =−2× the first row.

4. Check whether the columns of each matrix in Prob. 3 are also linearly independent. Do you get the same answer as for row independence?

Solution

Yes, we get the same answer.