[PDF] Matrix Multiplication University of Plymouth




Loading...







[PDF] Matrix multiplication - The University of Sydney

Multiplying matrices We can multiply matrices A and B together to form the product AB provided the number of columns in A equals the number of rows in B

[PDF] Multiplying matrices 1 Mathcentre

One of the most important operations carried out with matrices is matrix Matrix multiplication is based on combining rows from the first matrix

[PDF] Matrix Multiplication

Matrices with compatible dimensions can be multiplied using row-by-column multiplication If you want to buy four $12 pizzas, you find the total cost by

[PDF] Matrix-mult-perspectives

7 sept 2017 · Abstractly, the rules for matrix multiplication are determined once you define how to multiply matrices by vectors Ax, the central linear 

[PDF] Matrix Multiplication University of Plymouth

2 nov 2005 · to learn how to multiply matrices Quiz on Matrix Multiplication The rule for the multiplication of two matrices is the

[PDF] Matrix Multiplication - Statpower

Matrix multiplication is an operation with properties quite different from its scalar counterpart To begin with, order matters in matrix multiplication

[PDF] Patterns of matrix multiplication

Linear Algebra Grinshpan Patterns of matrix multiplication When the number of columns of a matrix A agrees with the number of rows of a matrix

[PDF] M3 Matrix Multiplication

M3 Matrix Multiplication Matrices may be added and subtracted if they have the same shape That is, the number of rows and columns is the same

[PDF] Matrix Multiplication  University of Plymouth 1032_6PlymouthUniversity_MathsandStats_matrix_multiplication.pdf

BasicMathematics

MatrixMultiplication

R Horan & M LavelleTheaim of this document is to provide a short, self assessment programme for students who wish to learn how to multiply matrices.Copyright c?2005Email: rhoran,mlavelle@plymouth.ac.uk

LastRevision Date: November 2, 2005Version 1.0

Table of Contents

1.Introduction

2.Matrix Multiplication 1

3.Matrix Multiplication 2

4.The Identity Matrix

5.Quiz on Matrix Multiplication

Solutions to Exercises

Solutions to Quizzes

The full range of these packages and some instructions, should they be required, can be obtained from our web pageMathematics Support Materials.

Section 1: Introduction 3

1. Introduction

In the packageIntroduction to Matricesthe basic rules ofaddi- tionandsubtractionof matrices, as well asscalar multiplication, were introduced. The rule for themultiplication of two matricesis the subject of this package. The first example is the simplest. Recall that ifMis a matrix then the transpose ofM, written M T, is the matrix obtained fromMby writing the rows ofMas the columns ofM T.

IfA= (a1a2... an)is a1×n(row) matrix andB= (b1b2... bn)Tis an×1(column) matrix then the productABis defined as

AB=(a1a2... an)(

( ((b 1 b

2···b

n) ) ))=a 1b 1+a 2b

2+···+a

nb nThis general rule is sometimes called theinner product. N.B.Therow matrixis on the left and thecolumn matrixis on the right.

Section 1: Introduction 4

Example 1In each of the following cases, find the productAB. (a)A= (1 2),B= (4 3)T.(b)A= (1 1 1),B= (2 3 4)T. (c)A= (1-1 2 3),B= (1 1-3 2)T.

Solution

(a)AB=(1 2)? 4

3?=1×4 +2×3 = 4 + 6 = 10.

(b)AB=(1 1 1)( (2 3 4) )=1×2 +1×3 +1×4 = 2 + 3 + 4 = 9. (c)AB=(1-1 2 3)( ( ((1 1 -3 2) ) ))=1×1 +1×(-1) +2×(-3) +3×2= 1 + (-1) + (-6) + 6 = 0.

Section 1: Introduction 5

Exercise 1.For each of the cases below, calculateAB. (Click on the greenletters for solutions.) (a)A= (-2 4),B= (3 2)T, (b)A= (5 3-2),B= (3-4 2)T, (c)A= (4 4-2-3),B= (5-4 32)T.

The following observations are worth noting.•The row matrix is on the left, the column matrix is on the right.

•Therowandcolumnhave the same number of elements. •The inner productABis a1×1matrix, i.e. anumber. •Nothing has yet been said about a matrix productBA. QuizIfA= (x x1)andB= (x6 9)T, which of the following values ofxwill result inAB= 0? (a)x= 1,(b)x= 3,(c)x=-3,(d)x=-2.

Section 2: Matrix Multiplication 1 6

2. Matrix Multiplication 1

The previous section gave the rule for the multiplication of a row vectorAwith a column vectorB, theinner productAB. This section will extend this idea to more general matrices.

Suppose thatA=?a1a2... an

c

1c2... cn?andB= (b1b2... bn)T.

ThenAB=?

a1a2... an c

1c2... cn?(

( ((b 1 b

2···b

n) ) ))= ?a 1b 1+a 2b

2+...+a

nb nc 1b 1+c 2b

2+...+c

nb n?Example 2FindABfor each of the following cases. (a)A=?1 2

3-1?,B= (4 3)T.

(b)A=?1 1 1 -2 1-3?,B= (2 3 4)T.

Section 2: Matrix Multiplication 1 7

Solution

(a)AB=? 1 2 3-1?? 4

3?=?1×4 +2×33×4 +(-1)×3?=?

10

9?(b)AB=?

1 1 1 -2 1-3?( (2 3 4) )=?1×2 +1×3 +1×4(-2)×2 +1×3 +(-3)×4? =?9 -13?The following observations onABare worth noting. •The element in thefirst rowofABis theinner productof the first rowofAwith the column matrixB. •The element in thesecond rowofABis theinner productofthe second rowofAwith the column matrixB. •The number ofcolumnsofAmust be equal to the number of rowsofB. •IfAis2×nandBisn×1thenABis2×1.

Section 2: Matrix Multiplication 1 8

This rule for multiplication may be extended to matrices,A, which have more than two rows. For example, ifAhad3rows then the resulting matrix,AB, would have a third row; the value of this element would be theinner productof thethird rowofAwith the column matrixB. Exercise 2.For each of the cases below, calculateAB. (Click on the greenletters for solutions.) (a)A=?-2 4

5 3?,B= (4 3)T.

(b)A=?5 3 2

4-1-1?,B= (2 3 4)T.

(c)A=( (-2 4 5 3 4-1) ),B= (4 3)T. (d)A=?4 4-2-3

3-1-1 2?,B= (5-4 3 2)T.

Section 3: Matrix Multiplication 2 9

3. Matrix Multiplication 2

The extension of the concept of matrix multiplication to matrices, A,B, in whichAhas more than one row andBhas more than one column is now possible. The product matrixABwill have the same number of columns asBand each column is obtained by taking the product ofAwith each column ofB, in turn, as shown below.

LetA=(

(4 1 2 3 -1 2) )andB=?2-1

3 2?and letb

1,b

2be the first and

second columns ofBrespectively. Then Ab 1=( (4 1 2 3 -1 2) )? 2 3?=( (11 13 4) )andAb 2=( (4 1 2 3 -1 2) )? -1 2?=( (-2 4 5) ).

ThusAB=(

(4 1 2 3 -1 2) )? 2-1 3 2? =( (11-2 13 4 4 5) ).

Section 3: Matrix Multiplication 2 10

Exercise 3.For each of the cases below, calculateAB. (Click on the greenletters for solutions.) (a)A=?-2 4

5 3?,B=?-2 4

5 3?. (b)A=?3 2

7 5?,B=?5-2

-7 3?. (c)A=( (-2 4 5 3 4-1) ),B=?-2 4 5 3?. (d)A=?5 3 2

4-1-1?,B=(

(-2 4 5 3 4-1) ). NBThe rules for finding the product of two matrices are summarised on the next page.

Section 3: Matrix Multiplication 2 11

•IfAism×nandBisn×rthen the productABexists. •The resulting matrix ism×r.((m×n)(n????×r)=m×r) •The element in theithrow,jthcolumn of the matrixABis the inner productof theithrow ofAwith thejthcolumn ofB. Example 3Find the element in the2ndrow3rdcolumn ofABif

A=?1 2

-1 3?andB=?1 4-2

3-1 2?.

SolutionSinceAis2×2andBis2×3, the productABexists and is a2×3matrix. The required element is the inner product of the second rowofAwith thethird columnofB, i.e. (-1)×(-2) +3×2 = 2 + 6 = 8.

Section 3: Matrix Multiplication 2 12

Exercise 4.If

A=( (1-2 4 5

7-8-6 2

2 3-1-2)

)andB=( ( ((-2 1-3 0-2-5 4-3-7

0 0 6)

) ))find theijelement,i.e.the element in theith rowjth column, of ABfor the following cases. (Click on thegreenletters for solutions.) (a)i= 3,j= 2,(b)i= 2,j= 3,(c)i= 1,j= 2, (d)i= 2,j= 1,(e)i= 3,j= 1,(f)i= 1,j= 3, QuizWhich of the following is the element in the3rd row,3rd column, of the matrixABin the above exercise? (a)26,(b)-26,(c)-12,(d)12.

Section 4: The Identity Matrix 13

4. The Identity Matrix

IfAandBare two matrices, the productABcan be found if the number ofcolumnsofAequals the number ofrowsofB. IfAis2×3 andBis3×5thenABcan be calculated butBAdoes not exist. The orderin which matrices are multiplied together matters. Even when ABandBAboth exist it is usually the case thatAB?=BA. There is one particular matrix, theidentity matrix, which has very special multiplication properties. Then×nidentity matrixis the n×nmatrix with1s and0sas shown below. Example 4The2×2,3×3and4×4identity matrices are ? 1 0

0 1?,(

(1 0 0 0 1 0

0 0 1)

),( ( ((1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1)

) )).

Section 4: The Identity Matrix 14

The most important property of the identity matrix is revealed in the following exercise.Exercise 5.If theidentity matrixis denoted byIand the matrixM is

M=?1 2 4

7 8 6?,

use the appropriate identity matrix to calculate the following matrix products. (Click on thegreenletters for solutions.) (a)IM, whereIis the2×2identity matrix,(b)MI, whereIis the3×3identity matrix. In matrix multiplication the identity matrix,I, behaves exactly like the number1in ordinary multiplication. This was seen in the previous exercise. For part(a),the matrixIis the2×2identity matrix; in part(b),Iwas3×3; they satisfy the equationIM=M=MI.

Section 4: The Identity Matrix 15

Example 5The matricesA,Bare

A=( (4 3 2 5 6 3

3 5 2)

)andB=( (3-4 3 1-2 2 -7 11-9) ).

CalculateABandBA.

SolutionUsing the rules of matrix multiplication,

AB=( (4 3 2 5 6 3

3 5 2)

)( (3-4 3 1-2 2 -7 11-9) )=( (1 0 0 0 1 0

0 0 1)

)=I. BA=( (3-4 3 1-2 2 -7 11-9) )( (4 3 2 5 6 3

3 5 2)

)=( (1 0 0 0 1 0

0 0 1)

)=I. The matrixBis theinverseof the matrixA, and this is usually written asA -1. Equally, the matrixAis theinverseof the matrixB.

The equationAA

-1=A-1A=Iis always true.

Section 5: Quiz on Matrix Multiplication 16

5. Quiz on Matrix Multiplication

LetA=(

(1 1 1 0 2 1

1 0 1)

),B=( (2-1-1 1 0-1 -2 1 2) ),C=( (3 1 4 2 1 3

2 2 1)

).

Choose the correct option from the following.

Begin Quiz

1.The2×3element ofABis

(a)-1,(b)1,(c)0,(d)2.

2.The3×1element ofCBis

(a)3,(b)-1,(c)4,(d)-6.

3.The2×2element ofCAis

(a)4,(b)-3,(c)0,(d)2.

4.(a)B=C-1,(b)A=B-1,(c)C=A-1End Quiz

Solutions to Exercises 17

Solutions to Exercises

Exercise 1(a)

If the row matrixA= (-2 4)and the column matrix

B=?3

2?are multiplied, the resultinginner productis

AB=(-2 4)?

3

2?=-2×3 +4×2=-6 + 8= 2.Click on the green square to return?

Solutions to Exercises 18

Exercise 1(b)

If the row matrixA= (5 3-2)and the column matrix

B=( (3 -4 2) )are multiplied, the resultinginner productis

AB=(5 3-2)(

(3 -4 2) )=5×3 +3×(-4) +(-2)×2=15-12-4 =-1.Click on the green square to return?

Solutions to Exercises 19

Exercise 1(c)

If the row matrixA= (44-2-3)and the column matrix

B=( ( ((5 -4 3 -2) ) ))are multiplied, theirinner productABis (44-2-3)( ( ((5 -4 3 -2) ) ))=4×5 +4×(-4) +(-2)×3 +(-3)×(-2)=20-16-6 + 6 = 4.Click on the green square to return?

Solutions to Exercises 20

Exercise 2(a)

For the2×2matrix

A=?-2 4

5 3?and the columnB= (4 3)T, the productABis

AB=? -2 4 5 3?? 4

3?=?(-2)×4 +4×35×4 +3×3?=?

4 29?.

Click on the green square to return?

Solutions to Exercises 21

Exercise 2(b)

If the2×3matrix

A=?5 3 2

4-1-1?and the column matrixB= (2 3 4)Tare multiplied together, then

the resulting productABis

AB=?5 3 2

4-1-1?(

(2 3 4) )=?5×2 +3×3 +2×44×2(-1)×3 +(-1)×4? =? 27
1?.

Click on the green square to return?

Solutions to Exercises 22

Exercise 2(c)

If the3×2matrix is

A=( (-2 4 5 3 4-1) )and the column matrix isB= (4 3)T, then the productABis AB=( (-2 4 5 3 4-1) )? 4 3?=( ((-2)×4 +4×35×4 +3×34×4 +(-1)×3) )=( (4 29
13) )Click on the green square to return?

Solutions to Exercises 23

Exercise 2(d)

If the2×4matrix

A=?4 4-2-3

3-1-1 2?is multiplied with the column matrixB= (5-4 3 2)T, the resulting

product,AB, is AB=?

4 4-2-3

3-1-1 2?(

( ((5 -4 3 2) ) ))=?4×5 +4×(-4) +(-2)×3 +(-3)×23×5 +(-1)×(-4) +(-1)×3 +2×2?=? -8 20? .Click on the green square to return?

Solutions to Exercises 24

Exercise 3(a)

LetAandBbe the2×2matrices:

A=?-2 4

5 3?andB=?-2 4

5 3? .The matrixABis AB=? -2 4 5 3?? -2 4 5 3? =?-2×(-2) +4×5-2×4 +4×35×(-2) +3×55×4 +3×3?=? 24 4
5 29? .Click on the green square to return?

Solutions to Exercises 25

Exercise 3(b)

IfAandBare the2×2matrices:

A=?3 2

7 5?andB=?5-2

-7 3? ,then the matrix productABis AB=? 3 2 7 5?? 5-2 -7 3? =?3×5 +2×(-7)3×(-2) +2×37×5 +5×(-7)7×(-2) +5×3?=? 1 0 0 1? .This is called the2×2identity matrix.

Click on the green square to return?

Solutions to Exercises 26

Exercise 3(c)

IfAandBare the matrices

A=( (-2 4 5 3 4-1) )andB=?-2 4

5 3?then the matrix productABis

AB=( (-2 4 5 3 4-1) )? -2 4 5 3? =(

((-2)×(-2) +4×5(-2)×4 +4×35×(-2) +3×55×4 +3×34×(-2) +(-1)×54×4 +(-1)×3)

)=( (24 4 5 29 -13 13) ) .Click on the green square to return?

Solutions to Exercises 27

Exercise 3(d)

IfAis2×3andBbe is3×2given by the following

A=?5 3 2

4-1-1?andB=(

(-2 4 5 3 4-1) ) ,then the matrix productABis AB=? 5 3 2

4-1-1?(

(-2 4 5 3 4-1)

)=?5×(-2) +3×5 +2×45×4 +3×3 +2×(-1)4×(-2) +(-1)×5 +(-1)×44×4 +(-1)×3 +(-1)×(-1)?=?

13 27 -17 14? .Click on the green square to return?

Solutions to Exercises 28

Exercise 4(a)

IfA=( (1-2 4 5

7-8-6 2

2 3-1-2)

)andB=( ( ((-2 1-3 0-2-5 4-3-7

0 0 6)

) )),the(32)element in the matrixAB,(AB)32,is the inner product of thethird rowofAwith thesecond columnofB, i.e.

(AB)32=2×1 +3×(-2) +(-1)×(-3) +(-2)×0=2-6 + 3 + 0 =-1.Click on the green square to return?

Solutions to Exercises 29

Exercise 4(b)

IfA=( (1-2 4 5

7-8-6 2

2 3-1-2)

)andB=( ( ((-2 1-3 0-2-5 4-3-7

0 0 6)

) )),the(23)element ofAB,(AB)23,is the inner product of thesecond rowofAwith thethird columnofB, i.e.

(AB)23=7×(-3) +(-8)×(-5) +(-6)×(-7) +2×6=-21 + 40 + 42 + 12 = 73.Click on the green square to return?

Solutions to Exercises 30

Exercise 4(c)

IfA=( (1-2 4 5

7-8-6 2

2 3-1-2)

)andB=( ( ((-2 1-3 0-2-5 4-3-7

0 0 6)

) )),the(12)element in the matrixAB,(AB)12,is the inner product of thefirst rowofAwith thesecond columnofB, i.e. (AB)12=1×1 +(-2)×(-2) +4×(-3) +5×0=1 + 4-12 + 0=-7.Click on the green square to return?

Solutions to Exercises 31

Exercise 4(d)

IfA=( (1-2 4 5

7-8-6 2

2 3-1-2)

)andB=( ( ((-2 1-3 0-2-5 4-3-7

0 0 6)

) )),the(21)element in the matrixAB,(AB)21,is the inner product of thesecond rowofAwith thefirst columnofB, i.e.

(AB)21=7×(-2) +(-8)×0 +(-6)×4 +2×0=-14 + 0-24 + 0 =-38.Click on the green square to return?

Solutions to Exercises 32

Exercise 4(e)

IfA=( (1-2 4 5

7-8-6 2

2 3-1-2)

)andB=( ( ((-2 1-3 0-2-5 4-3-7

0 0 6)

) )),the(31)element in the matrixAB,(AB)31,is the inner product of thethird rowofAwith thefirst columnofB, i.e. (AB)31=2×(-2) +3×0 +(-1)×4 +(-2)×0=-4 + 0-4 + 0 =-8.Click on the green square to return?

Solutions to Exercises 33

Exercise 4(f)

IfA=( (1-2 4 5

7-8-6 2

2 3-1-2)

)andB=( ( ((-2 1-3 0-2-5 4-3-7

0 0 6)

) )),the(13)element in the matrixAB,(AB)13,is the inner product of thefirst rowofAwith thethird columnofB, i.e.

(AB)13=1×(-3) +(-2)×(-5) +4×(-7) +5×6=-3 + 10-28 + 30 = 9.Click on the green square to return?

Solutions to Exercises 34

Exercise 5(a)

For the2×3matrixM=?1 2 4

7 8 6?

,theleft identitymatrix (multiplyingMon theleftto obtainIM) is the2×2matrixI:

I=?1 0

0 1? .The productIMis then IM=? 1 0 0 1?? 1 2 4

7 8 6?=?1×1 +0×71×2 +0×81×4 +0×60×1 +1×70×2 +1×80×4 +1×6?=?

1 2 4

7 8 6?

=M .Click on the green square to return?

Solutions to Exercises 35

Exercise 5(b)

For the2×3matrixM=?1 2 4

7 8 6?, theright identitymatrix (mul-

tiplyingMon therightto obtainMI) is the3×3matrixI: I=( (1 0 0 0 1 0

0 0 1)

).

The productMIis thus

MI=? 1 2 4

7 8 6?(

(1 0 0 0 1 0

0 0 1)

)=?

1×1+ 2×0+ 4×01×0+ 2×1+ 4×01×0+ 2×0+ 4×1

7×1 + 8×0+ 6×07×0+ 8×1+ 6×07×0+ 8×0+ 6×1?

=? 1 2 4

7 8 6?

=M .Click on the green square to return?

Solutions to Quizzes 36

Solutions to Quizzes

Solution to Quiz:

Multiplying the row matrixA= (x x1)with the column matrix B=( (x 6 9) )from theleftwe have

AB=(x x1)(

(x 6 9) )=x×x+x×6 +1×9=x

2+ 6x+ 9 = (x+ 3)2.Therefore the inner productAB= 0, ifx=-3.End Quiz

Solutions to Quizzes 37

Solution to Quiz:

The matricesAandBfromExercise 4are

A=( (1-2 4 5

7-8-6 2

2 3-1-2)

)andB=( ( ((-2 1-3 0-2-5 4-3-7

0 0 6)

) )).The(33)element in the matrix ofAB,(AB)33,is the inner product of thethird rowofAwith thethird columnofB, i.e. (AB)33=2×(-3) +3×(-5) +(-1)×(-7) +(-2)×6=-6-15 + 7-12 =-26.End Quiz
Politique de confidentialité -Privacy policy