Jump to content

Exercises: Matrices – "Math for Non-Geeks"

From Wikibooks, open books for an open world

Introduction

[edit | edit source]
Exercise

Determine the (4×4) matrix ℳ=(mjk) whose entries satisfy:

mjk={1 for j=k,0 for j=k−2,3 for j=k+2,2 else. 

Solution

The matrix ℳ is of the form (m11m12m13m14m21m22m23m24m31m32m33m34m41m42m43m44).

So the result is: ℳ=(1202212032122321)

Exercises on the vector space structure of matrices

[edit | edit source]
Exercise (Derivation of matrix addition)

Let L1,L2:ℝ2→ℝ2 be linear maps with

L1(xy):=(2xy−x)L2(xy):=(yx)

Determine the matrices of A1,A2 with respect to the standard basis. How can you define A1+A2 such that the result corresponds to the matrix of L1+L2?

In this case, the standard basis corresponds to E={e1,e2} with e1=(10),e2=(01).

How to get to the proof? (Derivation of matrix addition)

Write the two maps in the same tabular form as used for L above.

You can apply the same method to directly find the matrix representing L1+L2.

There is now a very obvious way to define the matrix addition. If you try this, you should get the right result.

Proof (Derivation of matrix addition)

We first determine A1 by writing down the table and summarizing it as a matrix. For the map L1(xy):=(2xy−x) we have

L1(e1)=(2−1),L1(e2)=(01)

This gives us

A1=(20−11)

Now we do the same with L2(xy):=(yx) to obtain A2:

L2(e1)=(01),L2(e2)=(10)

We conclude the table into a matrix

A2=(0110)

We are now looking for the matrix of L1+L2:

(L1+L2)(e1)=L1(e1)+L2(e1)=(2−1)+(01)=(20)(L1+L2)(e2)=L1(e2)+L2(e2)=(01)+(10)=(11)

This results in the desired matrix

A=(2101)

We now want to define the addition of two matrices in such a way that A1+A2=A. Remember that we have already defined the vector addition in ℝn component by component - so this definition is a good first attempt. And indeed, with this rule we obtain

A1+A2=(20−11)+(0110)=(2+00+1−1+11+0)=(2101)=A

Solution (Derivation of matrix addition)

If we define the addition of matrices as the addition of the respective components, we arrive at the desired result.

Let L1:ℝ2→ℝ2 be the above linear map with

L1(xy):=(2xy−x)

Exercise (Derivation of scalar multiplication)

Determine the matrix A1 with respect to the standard basis for the map L1 and the matrix M1 for the mapping β⋅L1. How can you define the multiplication of a matrix by a scalar such that M1=β⋅A1?

Solution (Derivation of scalar multiplication)

We already know from the previous exercise that

L1(xy)=(2xy−x)⟹A1=(20−11)

If we now multiply L1 by the scalar β, we get

(β⋅L1)(10)=β⋅L1(10)=β⋅(2−1)=(2β−β)(β⋅L1)(01)=β⋅L1(01)=β⋅(01)=(0β)

Whence M1=(2β0−ββ). Here you can quickly see that we can also define scalar multiplication element by element. Then

β⋅A1=β⋅(20−11)=(2β0−ββ)=M1

Exercises on matrix multiplication

[edit | edit source]
Exercise (Derivation of matrix multiplication)

Let K be a field and let A,A′∈K2×2. Furthermore, let f:K2→K2;x↦A⋅x and g:K2→K2;x↦A′⋅x. Let B={(1,0)T,(0,1)T} be the standard basis of K2. Describe MBB(g∘f) as a function of the entries of A and A′.

Solution (Derivation of matrix multiplication)

We already know from the article on matrices of linear maps that MBB(f)=A and MBB(g)=A′. If we write

A=(abcd)andA′=(efgh)

then

f(xy)=(ax+bycx+dy)andg(xy)=(ex+fygx+hy)

Now we calculate:

(g∘f)(xy)=g(f(xy))=g(ax+bycx+dy)=(e(ax+by)+f(cx+dy)g(ax+by)+h(cx+dy))=((ae+cf)x+(be+df)y(ag+ch)x+(bg+dh)y)=(ae+cfbe+dfag+dfbg+dh)⋅(xy)

Using the same argument as at the beginning of this solution, we now know that

MBB(g∘f)=(ae+cfbe+dfag+dfbg+dh)

Exercise

We are given the matrix ℳ=(321231132). Calculate the expression ℳ0+ℳ+12ℳ2.

Solution

We first consider each summand of the expression to be calculated individually:

ℳ0=(100010001)=I3,ℳ=(321231132)

and because

ℳ2=(321231132)⋅(321231132)=(141571316711178)

we get

12ℳ2=(12⋅1412⋅1512⋅712⋅1312⋅1612⋅712⋅1112⋅1712⋅8)=(77.53.56.583.55.58.54)

Together, this results in:

ℳ0+ℳ+12ℳ2=(100010001)+(321231132)+(77.53.56.583.55.58.54)=(1+3+70+2+7.50+1+3.50+2+6.51+3+80+1+3.50+1+5.50+3+8.51+2+4)=(119.54.58.5124.56.511.57)

Exercise

Use matrix multiplication to prove the addition theorems for the cosine and the sine, i.e.,

cos⁡(α+β)=cos⁡(α)⋅cos⁡(β)−sin⁡(α)⋅sin⁡(β)

sin⁡(α+β)=sin⁡(α)⋅cos⁡(β)+cos⁡(α)⋅sin⁡(β)

Solution

We consider the rotation matrix (cos⁡(α+β)−sin⁡(α+β)sin⁡(α+β)cos⁡(α+β)) and remember that rotations in the plane can be understood as linear maps. Accordingly, it does not matter whether we rotate directly by an angle α+β, or first by an angle α and then by β. Therefore, we have

(cos⁡(α+β)−sin⁡(α+β)sin⁡(α+β)cos⁡(α+β))=(cos⁡(α)−sin⁡(α)sin⁡(α)cos⁡(α))⋅(cos⁡(β)−sin⁡(β)sin⁡(β)cos⁡(β))=(cos⁡(α)⋅cos⁡(β)−sin⁡(α)⋅sin⁡(β)−cos⁡(α)⋅sin⁡(β)−sin⁡(α)⋅cos⁡(β)sin⁡(α)⋅cos⁡(β)+cos⁡(α)⋅sin⁡(β)cos⁡(α)⋅cos⁡(β)−sin⁡(α)⋅sin⁡(β))

A comparison of the entries of the matrices provides the addition theorems to be shown.

Exercises on representative and basis change matrices

[edit | edit source]
Exercise (Calculating coordinate vectors with respect to a basis)

Let v=(3,2)T∈ℝ2. Calculate the coordinate vector of v with respect to the basis B={(1,−1)T,(1,1)T}.

Solution (Calculating coordinate vectors with respect to a basis)

We wish to find out what the coordinate vector of v looks like with respect to the basis B={(1,−1)T,(1,1)T}. This gives us a system of equations that needs to be solved:

v=(32)=a1⋅(1−1)+a2⋅(11)

We now have two equations. On the one hand

3=a1+a2

and on the other

2=−a1+a2.

Solving this linear system gives a1=0.5 and a2=2.5. This results in the following for the coordinate vector

[v]B=(0.52.5).

Exercises on the rank of a matrix

[edit | edit source]
Exercise

Determine the rank of the following matrix: ℳ1=(1200510102)

Solution

We transform the matrix ℳ1 into row-level form and read off the rank of the matrix using the number of zero rows. We obtain:

(1200510102)⇝Add3,2(−2)(120051000)

We have created a zero row by converting to row-step form. The rank of our matrix is therefore rank(ℳ1)=2.

In this case, the shorthand Add3,2(−2) indicates that we have added the third row of the matrix with −2 times the second row

Exercise

Determine the rank of the following matrix: ℳ2=(120305123161−2040−1)

Solution

We transform the matrix ℳ2 into row-level form and read off the rank of the matrix using the number of zero rows. We obtain:

(120305123161−2040−1)⇝Add3,4(−4)(120305123012040−1)⇝Add3,1(−3)(120305120−61−7040−1)⇝Mult3(46)(120305120−446−286040−1)⇝Add3,4(1)(120305120046−173040−1)⇝Mult2(−45)(12030−4−45−850046−173040−1)⇝Add4,2(1)(12030445850046−17300−45−135)⇝Mult3(65)(12030445850045−34500−45−135)⇝Add4,3(1)(12030445850045−345000−475)

By converting to row-level form, we have thus shown that for ℳ2 we have rank(ℳ2)=4.

However, we could have seen much more quickly at this point that rank(ℳ2)=4. It is also sufficient to show that the column vectors (or equivalently the row vectors) are linearly independent. In this example, we decide to use the column vectors and show their linear independence. Let λ,μ,θ,ϕ∈ℝ.

0=!λ⋅(1030)+μ⋅(25164)+θ⋅(0110)+ϕ⋅(32−2−1)

This gives us the linear system:

1⋅λ+2⋅μ+0⋅θ+3⋅ϕ=00⋅λ+5⋅μ+1⋅θ+2⋅ϕ=03⋅λ+16⋅μ+1⋅θ−2⋅ϕ=00⋅λ+4⋅μ+0⋅θ−1⋅ϕ=0

with the unique solution λ=μ=θ=ϕ=0, which shows the linear independence of the column vectors. However, the rank of a matrix describes the maximum number of linearly independent column vectors of the matrix. So rank(ℳ2)=4.

The exercise therefore shows that it is not always advantageous to convert the matrix into row-level form in order to read off the rank of the matrix.

Exercises on matrix inversion

[edit | edit source]
Exercise

Let ℳ∈ℝn×n be invertible. Furthermore, let ℳ3=ℳ. Show that ℳ is self-inverse, i.e., ℳ=ℳ−1.

Solution

Since ℳ∈ℝn×n is invertible, there exists an ℳ−1∈ℝn×n with ℳ⋅ℳ−1=In. Thus, we can write

ℳ3=ℳ↓ multiplication from the right by ℳ−1ℳ3⋅ℳ−1=ℳ⋅ℳ−1↓ ℳ⋅ℳ−1=Inℳ2=In↓ multiplication from the right by ℳ−1ℳ2⋅ℳ−1=In⋅ℳ−1ℳ=ℳ−1