Lecture 9' Matrix Multiplication - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Lecture 9' Matrix Multiplication

Description:

The first rule is that the order of multiplication matters. ... 4 Definitions you should now memorise: conformable, commutative, matrix multiplication, inverse ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 14
Provided by: j720
Category:

less

Transcript and Presenter's Notes

Title: Lecture 9' Matrix Multiplication


1
Lecture 9. Matrix Multiplication
  • Learning objectives. By the end of this lecture
    you should
  • Understand when matrices can be multiplied
  • Understand and have practised matrix
    multiplication
  • 1. Introduction Multiplication for matrices has
    some special rules.
  • The first rule is that the order of
    multiplication matters. In general AxB (or AB) is
    not the same as BA.
  • This is very different to multiplying numbers
    where the order doesnt matter e.g. 3x4 4x3
    12.
  • Aside
  • Addition, multiplication, matrix multiplication
    etc. are examples of operators
  • An operator is said to be commutative if x
    operator y y operator x for any x and y
  • Addition is commutative xy yx
    multiplication is commutative subtraction is not
    commutative (2-1 ? 1-2).
  • Matrix multiplication is also not commutative.

2
Multiplying two matrices.
  • The second rule is that you can only multiply two
    matrices if they are conformable.
  • Two matrices are conformable if the number of
    columns for the first matrix is the same as the
    number of rows for the second matrix.
  • If the matrices are not conformable they cannot
    be multiplied.
  • Example 1 does AB exist?
  • Answer A is a 2x4 matrix. B is a 3x3. So A has 4
    columns and B has 3 rows. Therefore AB does not
    exist. A and B are not conformable.

3
Multiplying two matrices.
  • Example 2 does AB exist?
  • Answer A is a 2x5 matrix. B is a 5x2. So A has 5
    columns and B has 5 rows. A and B are
    conformable. Therefore AB exists.
  • Finding AB.
  • Suppose A and B are conformable. So C AB
    exists. To calculate it
  • To get the first element on the first row of C
    take the first row of A and multiply each element
    in turn against its corresponding element in the
    first column of B. Add the result. Well call
    this multiplying the first row of A against the
    first column of B.
  • Example c11 4x4 -1x-1 3x3 3x3 0x1 35
  • To get the remaining elements in the first row
    repeat this procedure with the first row of A
    multiplying each column of B in turn.

4
Multiplying two matrices.
5
Multiplying two matrices.
6
Multiplying two matrices - formally.
  • Suppose A is an mxn matrix and and B is an nxr
    matrix with typical elements aik and bkj
    respectively
  • Then AB C where element cij is
  • Note that the result is an mxr matrix

7
Another example.
  • Example 2 calculate AB
  • First we note that A is 1x4 and B is 4x2, so AB
    exists and is a 1x2 matrix.
  • The first element c11 (1)(1)(0)(2)(2)(1)(0)(0
    ) 3
  • The second element c12 (1)(0)(0)(0)(2)(3)(0)(
    1) 6
  • So C (3 6)

8
Quiz.
  • Can you multiply the following matrices? If so,
    what is the dimension of the result?
  • BA
  • BC
  • AAT
  • ATA
  • CC

9
More multiplication.
  • We saw from the quiz that the order of
    multiplication matters. ATA had different
    dimensions to AAT, while BA did not even exist.
  • Remember that the first row of AB is found by
    multiplying the first row of A by the columns of
    B in turn.
  • The second row comes from multiplying the second
    row of A by the columns of B in turn
  • And so on.
  • Finding CC (sometimes written C2).
  • You find AAT

10
Multiplying square matrices by the identity matrix
  • Recall
  • A square matrix has the same number of rows and
    columns its nxn
  • The identity matrix is a square matrix with 1s in
    the leading diagonal and 0s everywhere else. E.g.
  • Finding IA then find AI when.

11
A general result for square matrices
  • If A is a square matrix then IA AI A.
  • You can prove AI A.
  • NB. This only applies to square matrices

12
Inverses for square matrices
  • Idea
  • In normal multiplication every number except zero
    has an inverse.
  • The inverse of 3 is 1/3 the inverse of 27 is
    1/27, the inverse of -1.1 -1/1.1
  • A number times its inverse equals 1 x(1/x) 1
  • And the inverse times the number equals 1 (1/x)x
    1
  • The inverse of the inverse is the original
    number.
  • We define an inverse of a square matrix in a
    similar manner.
  • If A is an nxn matrix then the inverse of A,
    written A-1 is an nxn matrix such that
  • AA-1 I
  • A-1A I
  • Notes
  • This means that A is the inverse of A-1
  • I is its own inverse.
  • A-1 may not exist.

13
Inverse matrix example
  • Suppose and
  • Then
  • What is BA?

14
Quiz II.
  • Find BC
  • Is D the inverse of C

15
Summary.
  • 4 Definitions you should now memorise
  • conformable, commutative, matrix multiplication,
    inverse
  • 3 skills you should be able to do
  • Check whether two matrices are conformable
  • Multiply two conformable matrices
  • Show whether A and B are inverses.
  • Next determinants and finding the inverse
Write a Comment
User Comments (0)
About PowerShow.com