Jump to content

Linear Algebra/Matrix Multiplication/Solutions

From Wikibooks, open books for an open world

A=(285)

Solutions

[edit | edit source]
This exercise is recommended for all readers.
Problem 1

Compute, or state "not defined".

  1. (31−42)(0500.5)
  2. (11−1403)(2−1−1311311)
  3. (2−774)(105−111384)
  4. (5231)(−123−5)
Answer
  1. (015.50−19)
  2. (2−1−117−1−1)
  3. Not defined.
  4. (1001)
This exercise is recommended for all readers.
Problem 2

Where

A=(1−120)B=(5244)C=(−23−41)

compute or state "not defined".

  1. AB
  2. (AB)C
  3. BC
  4. A(BC)
Answer
  1. (1−2104)
  2. (1−2104)(−23−41)=(61−3634)
  3. (−1817−2416)
  4. (1−120)(−1817−2416)=(61−3634)
Problem 3

Which products are defined?

  1. 3×2 times 2×3
  2. 2×3 times 3×2
  3. 2×2 times 3×3
  4. 3×3 times 2×2
Answer
  1. Yes.
  2. Yes.
  3. No.
  4. No.
This exercise is recommended for all readers.
Problem 4

Give the size of the product or state "not defined".

  1. a 2×3 matrix times a 3×1 matrix
  2. a 1×12 matrix times a 12×1 matrix
  3. a 2×3 matrix times a 2×1 matrix
  4. a 2×2 matrix times a 2×2 matrix
Answer
  1. 2×1
  2. 1×1
  3. Not defined.
  4. 2×2
This exercise is recommended for all readers.
Problem 5

Find the system of equations resulting from starting with

h1,1x1+h1,2x2+h1,3x3=d1h2,1x1+h2,2x2+h2,3x3=d2

and making this change of variable (i.e., substitution).

x1=g1,1y1+g1,2y2x2=g2,1y1+g2,2y2x3=g3,1y1+g3,2y2
Answer

We have

h1,1⋅(g1,1y1+g1,2y2)+h1,2⋅(g2,1y1+g2,2y2)+h1,3⋅(g3,1y1+g3,2y2)=d1h2,1⋅(g1,1y1+g1,2y2)+h2,2⋅(g2,1y1+g2,2y2)+h2,3⋅(g3,1y1+g3,2y2)=d2

which, after expanding and regrouping about the y's yields this.

(h1,1g1,1+h1,2g2,1+h1,3g3,1)y1+(h1,1g1,2+h1,2g2,2+h1,3g3,2)y2=d1(h2,1g1,1+h2,2g2,1+h2,3g3,1)y1+(h2,1g1,2+h2,2g2,2+h2,3g3,2)y2=d2

The starting system, and the system used for the substitutions, can be expressed in matrix language.

(h1,1h1,2h1,3h2,1h2,2h2,3)(x1x2x3)=H(x1x2x3)=(d1d2)(g1,1g1,2g2,1g2,2g3,1g3,2)(y1y2)=G(y1y2)=(x1x2x3)

With this, the substitution is d→=Hx→=H(Gy→)=(HG)y→.

Problem 6

As Definition 2.3 points out, the matrix product operation generalizes the dot product. Is the dot product of a 1×n row vector and a n×1 column vector the same as their matrix-multiplicative product?

Answer

Technically, no. The dot product operation yields a scalar while the matrix product yields a 1×1 matrix. However, we usually will ignore the distinction.

This exercise is recommended for all readers.
Problem 7

Represent the derivative map on 𝒫n with respect to B,B where B is the natural basis ⟨1,x,…,xn⟩. Show that the product of this matrix with itself is defined; what the map does it represent?

Answer

The action of d/dx on B is 1↦0, x↦1, x2↦2x, ... and so this is its (n+1)×(n+1) matrix representation.

RepB,B(ddx)=(01000020⋱000n0000)

The product of this matrix with itself is defined because the matrix is square.

(01000020⋱000n0000)2=(0020000060⋱000n(n−1)00000000)


The map so represented is the composition

p⟼ddxdpdx⟼ddxd2pdx2

which is the second derivative operation.

Problem 8

Show that composition of linear transformations on ℝ1 is commutative. Is this true for any one-dimensional space?

Answer

It is true for all one-dimensional spaces. Let f and g be transformations of a one-dimensional space. We must show that g∘f(v→)=f∘g(v→) for all vectors. Fix a basis B for the space and then the transformations are represented by 1×1 matrices.

F=RepB,B(f)=(f1,1)G=RepB,B(g)=(g1,1)

Therefore, the compositions can be represented as GF and FG.

GF=RepB,B(g∘f)=(g1,1f1,1)FG=RepB,B(f∘g)=(f1,1g1,1)

These two matrices are equal and so the compositions have the same effect on each vector in the space.

Problem 9

Why is matrix multiplication not defined as entry-wise multiplication? That would be easier, and commutative too.

Answer

It would not represent linear map composition; Theorem 2.6 would fail.

This exercise is recommended for all readers.
Problem 10
  1. Prove that HpHq=Hp+q and (Hp)q=Hpq for positive integers p,q.
  2. Prove that (rH)p=rp⋅Hp for any positive integer p and scalar r∈ℝ.
Answer

Each follows easily from the associated map fact. For instance, p applications of the transformation h, following q applications, is simply p+q applications.

This exercise is recommended for all readers.
Problem 11
  1. How does matrix multiplication interact with scalar multiplication: is r(GH)=(rG)H? Is G(rH)=r(GH)?
  2. How does matrix multiplication interact with linear combinations: is F(rG+sH)=r(FG)+s(FH)? Is (rF+sG)H=rFH+sGH?
Answer

Although these can be done by going through the indices, they are best understood in terms of the represented maps. That is, fix spaces and bases so that the matrices represent linear maps f,g,h.

  1. Yes; we have both r⋅(g∘h)(v→)=r⋅g(h(v→))=(r⋅g)∘h(v→) and g∘(r⋅h)(v→)=g(r⋅h(v→))=r⋅g(h(v→))=r⋅(g∘h)(v→) (the second equality holds because of the linearity of g).
  2. Both answers are yes. First, f∘(rg+sh) and r⋅(f∘g)+s⋅(f∘h) both send v→ to r⋅f(g(v→))+s⋅f(h(v→)); the calculation is as in the prior item (using the linearity of f for the first one). For the other, (rf+sg)∘h and r⋅(f∘h)+s⋅(g∘h) both send v→ to r⋅f(h(v→))+s⋅g(h(v→)).
Problem 12

We can ask how the matrix product operation interacts with the transpose operation.

  1. Show that (GH)trans=HtransGtrans.
  2. A square matrix is symmetric if each i,j entry equals the j,i entry, that is, if the matrix equals its own transpose. Show that the matrices HHtrans and HtransH are symmetric.
Answer

We have not seen a map interpretation of the transpose operation, so we will verify these by considering the entries.

  1. The i,j entry of GHtrans is the j,i entry of GH, which is the dot product of the j-th row of G and the i-th column of H. The i,j entry of HtransGtrans is the dot product of the i-th row of Htrans and the j-th column of Gtrans, which is the dot product of the i-th column of H and the j-th row of G. Dot product is commutative and so these two are equal.
  2. By the prior item each equals its transpose, e.g., (HHtrans)trans=HtranstransHtrans=HHtrans.
This exercise is recommended for all readers.
Problem 13

Rotation of vectors in ℝ3 about an axis is a linear map. Show that linear maps do not commute by showing geometrically that rotations do not commute.

Answer

Consider rx,ry:ℝ3→ℝ3 rotating all vectors π/2 radians counterclockwise about the x and y axes (counterclockwise in the sense that a person whose head is at e→1 or e→2 and whose feet are at the origin sees, when looking toward the origin, the rotation as counterclockwise).

Rotating rx first and then ry is different than rotating ry first and then rx. In particular, rx(e→3)=−e→2 so ry∘rx(e→3)=−e→2, while ry(e→3)=e→1 so rx∘ry(e→3)=e→1, and hence the maps do not commute.

Problem 14

In the proof of Theorem 2.12 some maps are used. What are the domains and codomains?

Answer

It doesn't matter (as long as the spaces have the appropriate dimensions).

For associativity, suppose that F is m×r, that G is r×n, and that H is n×k. We can take any r dimensional space, any m dimensional space, any n dimensional space, and any k dimensional space— for instance, ℝr, ℝm, ℝn, and ℝk will do. We can take any bases A, B, C, and D, for those spaces. Then, with respect to C,D the matrix H represents a linear map h, with respect to B,C the matrix G represents a g, and with respect to A,B the matrix F represents an f. We can use those maps in the proof.

The second half is done similarly, except that G and H are added and so we must take them to represent maps with the same domain and codomain.

Problem 15

How does matrix rank interact with matrix multiplication?

  1. Can the product of rank n matrices have rank less than n? Greater?
  2. Show that the rank of the product of two matrices is less than or equal to the minimum of the rank of each factor.
Answer
  1. The product of rank n matrices can have rank less than or equal to n but not greater than n. To see that the rank can fall, consider the maps πx,πy:ℝ2→ℝ2 projecting onto the axes. Each is rank one but their composition πx∘πy, which is the zero map, is rank zero. That can be translated over to matrices representing those maps in this way.
    Repℰ2,ℰ2(πx)⋅Repℰ2,ℰ2(πy)=(1000)(0001)=(0000)
    To prove that the product of rank n matrices cannot have rank greater than n, we can apply the map result that the image of a linearly dependent set is linearly dependent. That is, if h:V→W and g:W→X both have rank n then a set in the range ℛ(g∘h) of size larger than n is the image under g of a set in W of size larger than n and so is linearly dependent (since the rank of h is n). Now, the image of a linearly dependent set is dependent, so any set of size larger than n in the range is dependent. (By the way, observe that the rank of g was not mentioned. See the next part.)
  2. Fix spaces and bases and consider the associated linear maps f and g. Recall that the dimension of the image of a map (the map's rank) is less than or equal to the dimension of the domain, and consider the arrow diagram.
    V⟼fℛ(f)⟼gℛ(g∘f)
    First, the image of ℛ(f) must have dimension less than or equal to the dimension of ℛ(f), by the prior sentence. On the other hand, ℛ(f) is a subset of the domain of g, and thus its image has dimension less than or equal the dimension of the domain of g. Combining those two, the rank of a composition is less than or equal to the minimum of the two ranks. The matrix fact follows immediately.
Problem 16

Is "commutes with" an equivalence relation among n×n matrices?

Answer

The "commutes with" relation is reflexive and symmetric. However, it is not transitive: for instance, with

G=(1234)H=(1001)J=(5678)

G commutes with H and H commutes with J, but G does not commute with J.

This exercise is recommended for all readers.
Problem 17

(This will be used in the Matrix Inverses exercises.) Here is another property of matrix multiplication that might be puzzling at first sight.

  1. Prove that the composition of the projections πx,πy:ℝ3→ℝ3 onto the x and y axes is the zero map despite that neither one is itself the zero map.
  2. Prove that the composition of the derivatives d2/dx2,d3/dx3:𝒫4→𝒫4 is the zero map despite that neither is the zero map.
  3. Give a matrix equation representing the first fact.
  4. Give a matrix equation representing the second.

When two things multiply to give zero despite that neither is zero, each is said to be a zero divisor.

Answer
  1. Either of these.
    (xyz)⟼πx(x00)⟼πy(000)(xyz)⟼πy(0y0)⟼πx(000)
  2. The composition is the fifth derivative map d5/dx5 on the space of fourth-degree polynomials.
  3. With respect to the natural bases,
    Repℰ3,ℰ3(πx)=(100000000)Repℰ3,ℰ3(πy)=(000010000)
    and their product (in either order) is the zero matrix.
  4. Where B=⟨1,x,x2,x3,x4⟩,
    RepB,B(d2dx2)=(00200000600000120000000000)RepB,B(d3dx3)=(00060000024000000000000000)
    and their product (in either order) is the zero matrix.
Problem 18

Show that, for square matrices, (S+T)(S−T) need not equal S2−T2.

Answer

Note that (S+T)(S−T)=S2−ST+TS−T2, so a reasonable try is to look at matrices that do not commute so that −ST and TS don't cancel: with

S=(1234)T=(5678)

we have the desired inequality.

(S+T)(S−T)=(−56−56−88−88)S2−T2=(−60−68−76−84)
This exercise is recommended for all readers.
Problem 19

Represent the identity transformation id:V→V with respect to B,B for any basis B. This is the identity matrix I. Show that this matrix plays the role in matrix multiplication that the number 1 plays in real number multiplication: HI=IH=H (for all matrices H for which the product is defined).

Answer

Because the identity map acts on the basis B as β→1↦β→1, ..., β→n↦β→n, the representation is this.

(100001000010⋱0001)

The second part of the question is obvious from Theorem 2.6.

Problem 20

In real number algebra, quadratic equations have at most two solutions. That is not so with matrix algebra. Show that the 2×2 matrix equation T2=I has more than two solutions, where I is the identity matrix (this matrix has ones in its 1,1 and 2,2 entries and zeroes elsewhere; see Problem 19).

Answer

Here are four solutions.

T=(±100±1)
Problem 21
  1. Prove that for any 2×2 matrix T there are scalars c0,…,c4 that are not all 0 such that the combination c4T4+c3T3+c2T2+c1T+c0I is the zero matrix (where I is the 2×2 identity matrix, with 1's in its 1,1 and 2,2 entries and zeroes elsewhere; see Problem 19).
  2. Let p(x) be a polynomial p(x)=cnxn+…+c1x+c0. If T is a square matrix we define p(T) to be the matrix cnTn+…+c1T+I (where I is the appropriately-sized identity matrix). Prove that for any square matrix there is a polynomial such that p(T) is the zero matrix.
  3. The minimal polynomial m(x) of a square matrix is the polynomial of least degree, and with leading coefficient 1, such that m(T) is the zero matrix. Find the minimal polynomial of this matrix.
    (3/2−1/21/23/2)
    (This is the representation with respect to ℰ2,ℰ2, the standard basis, of a rotation through π/6 radians counterclockwise.)
Answer
  1. The vector space ℳ2×2 has dimension four. The set {T4,…,T,I} has five elements and thus is linearly dependent.
  2. Where T is n×n, generalizing the argument from the prior item shows that there is such a polynomial of degree n2 or less, since {Tn2,…,T,I} is a n2+1-member subset of the n2-dimensional space ℳn×n.
  3. First compute the powers
    T2=(1/2−3/23/21/2)T3=(0−110)T4=(−1/2−3/23/2−1/2)
    (observe that rotating by π/6 three times results in a rotation by π/2, which is indeed what T3 represents). Then set c4T4+c3T3+c2T2+c1T+c0I equal to the zero matrix
    (−1/2−3/23/2−1/2)c4+(0−110)c3+(1/2−3/23/21/2)c2+(3/2−1/21/23/2)c1+(1001)c0
    =(0000)
    to get this linear system.
    −(1/2)c4+(1/2)c2+(3/2)c1+c0=0−(3/2)c4−c3−(3/2)c2−(1/2)c1=0(3/2)c4+c3+(3/2)c2+(1/2)c1=0−(1/2)c4+(1/2)c2+(3/2)c1+c0=0
    Apply Gaussian reduction.
    →−ρ1+ρ4→ρ2+ρ3−(1/2)c4+(1/2)c2+(3/2)c1+c0=0−(3/2)c4−c3−(3/2)c2−(1/2)c1=00=00=0→−3ρ1+ρ2−(1/2)c4+(1/2)c2+(3/2)c1+c0=0−c3−3c2−2c1−3c0=00=00=0
    Setting c4, c3, and c2 to zero makes c1 and c0 also come out to be zero so no degree one or degree zero polynomial will do. Setting c4 and c3 to zero (and c2 to one) gives a linear system
    (1/2)+(3/2)c1+c0=0−3−2c1−3c0=0
    that can be solved with c1=−3 and c0=1. Conclusion: the polynomial m(x)=x2−3x+1 is minimal for the matrix T.
Problem 22

The infinite-dimensional space 𝒫 of all finite-degree polynomials gives a memorable example of the non-commutativity of linear maps. Let d/dx:𝒫→𝒫 be the usual derivative and let s:𝒫→𝒫 be the shift map.

a0+a1x+…+anxn⟼s0+a0x+a1x2+…+anxn+1

Show that the two maps don't commute d/dx∘s≠s∘d/dx; in fact, not only is (d/dx∘s)−(s∘d/dx) not the zero map, it is the identity map.

Answer

The check is routine:

a0+a1x+…+anxn⟼sa0x+a1x2+…+anxn+1⟼d/dxa0+2a1x+…+(n+1)anxn

while

a0+a1x+…+anxn⟼d/dxa1+…+nanxn−1⟼sa1x+…+anxn

so that under the map (d/dx∘s)−(s∘d/dx) we have a0+a1x+…+anxn↦a0+a1x+…+anxn.

Problem 23

Recall the notation for the sum of the sequence of numbers a1,a2,…,an.

∑i=1nai=a1+a2+…+an

In this notation, the i,j entry of the product of G and H is this.

pi,j=∑k=1rgi,khk,j

Using this notation,

  1. reprove that matrix multiplication is associative;
  2. reprove Theorem 2.6.
Answer
  1. Tracing through the remark at the end of the subsection gives that the i,j entry of (FG)H is this ∑t=1s(∑k=1rfi,kgk,t)ht,j=∑t=1s∑k=1r(fi,kgk,t)ht,j=∑t=1s∑k=1rfi,k(gk,tht,j)
    =∑k=1r∑t=1sfi,k(gk,tht,j)=∑k=1rfi,k(∑t=1sgk,tht,j)
    (the first equality comes from using the distributive law to multiply through the h's, the second equality is the associative law for real numbers, the third is the commutative law for reals, and the fourth equality follows on using the distributive law to factor the f's out), which is the i,j entry of F(GH).
  2. The k-th component of h(v→) is
    ∑j=1nhk,jvj
    and so the i-th component of g∘h(v→) is this
    ∑k=1rgi,k(∑j=1nhk,jvj)=∑k=1r∑j=1ngi,khk,jvj=∑k=1r∑j=1n(gi,khk,j)vj
    =∑j=1n∑k=1r(gi,khk,j)vj=∑j=1n(∑k=1rgi,khk,j)vj
    (the first equality holds by using the distributive law to multiply the g's through, the second equality represents the use of associativity of reals, the third follows by commutativity of reals, and the fourth comes from using the distributive law to factor the v's out).