Return to Video

https:/.../matrixmultiplication2f61mb-aspect.mp4

  • 0:05 - 0:08
    In this second of the videos on
    matrix multiplication, we're
  • 0:08 - 0:11
    going to delve a little bit more
    deeply into matrix
  • 0:11 - 0:14
    multiplication and look at some
    of the properties and the
  • 0:14 - 0:17
    conditions under which different
    sorts of multiplication can be
  • 0:17 - 0:20
    carried out. Let's start by
    looking at looking at a specific
  • 0:20 - 0:24
    example in this example. Here
    I've written down to matrices
  • 0:24 - 0:29
    M&N. And let's look at the sizes
    of these matrices. The first
  • 0:29 - 0:33
    matrix M. Is a three row
    three column matrix, so
  • 0:33 - 0:35
    it's three by three.
  • 0:38 - 0:42
    And the second matrix N is 3
    rows, two columns.
  • 0:43 - 0:44
    So it's a 3 by 2.
  • 0:47 - 0:49
    And we notice that these
    numbers are the same.
  • 0:51 - 0:54
    The number of columns in the
    first is the same as the number
  • 0:54 - 0:57
    of rows in the second, so we can
    perform this matrix
  • 0:57 - 1:00
    multiplication and the size of
    the answer will be a three by
  • 1:00 - 1:04
    two matrix. So right at the
    start we know the size of the
  • 1:04 - 1:07
    answer. It's going to have three
    rows and two columns just like
  • 1:07 - 1:10
    this one had. So the shape
    of the answer is.
  • 1:11 - 1:13
    Like we have here and we're
    looking for these 6 numbers.
  • 1:14 - 1:15
    In the product.
  • 1:17 - 1:18
    Let's try and work it out.
  • 1:19 - 1:23
    To find the number that's in the
    first row, first column. We work
  • 1:23 - 1:28
    with the first row of the first
    matrix and the first column of
  • 1:28 - 1:29
    the Second Matrix.
  • 1:30 - 1:34
    What we want is 3
    * 1 which is 3.
  • 1:35 - 1:41
    2 * -- 2 which is minus 4 and 1
    * 3, which is 3. So we've got 3
  • 1:41 - 1:42
    ones or three.
  • 1:44 - 1:50
    2 * -- 2 is minus 4 and 1
    * 3 is 3. We multiply the
  • 1:50 - 1:53
    paired elements together and
    add the result.
  • 1:57 - 2:01
    When we come to the first row,
    second column, we work with the
  • 2:01 - 2:03
    first row here and the second
  • 2:03 - 2:09
    column here. And again, pairing
    off 3 * -- 2 is minus 6.
  • 2:10 - 2:12
    2 * 3.
  • 2:13 - 2:14
    Is 6.
  • 2:15 - 2:18
    1 * -- 4 is minus 4.
  • 2:19 - 2:22
    So in each case, we're
    multiplying the paired elements
  • 2:22 - 2:23
    together and adding the results.
  • 2:25 - 2:29
    When we want the element that's
    going in here, which is in the
  • 2:29 - 2:33
    2nd row first column of the
    answer, we work with the 2nd
  • 2:33 - 2:37
    row, first column of the given
    matrices 4 * 1 is 4.
  • 2:38 - 2:42
    Minus 3 * -- 2 is +6.
  • 2:44 - 2:46
    2 * 3 is 6.
  • 2:48 - 2:52
    And continuing in the same way,
    the answer that goes in the 2nd
  • 2:52 - 2:55
    row, second column comes from
    taking the 2nd row, second
  • 2:55 - 2:59
    column. 4 * -- 2 is minus 8.
  • 3:00 - 3:03
    Minus 3 * + 3 is minus 9.
  • 3:05 - 3:07
    2 * -- 4 is minus 8.
  • 3:10 - 3:14
    And finally on the last row
    to find the element in the
  • 3:14 - 3:18
    first row. Sorry the 3rd row
    first column will work with
  • 3:18 - 3:21
    the 3rd row, First Column, 5
    ones of five.
  • 3:23 - 3:25
    4 * -- 2 is minus 8.
  • 3:26 - 3:28
    3 * 3 is 9.
  • 3:30 - 3:34
    And similarly to find the last
    element, it will be 5 * -- 2,
  • 3:34 - 3:35
    which is minus 10.
  • 3:35 - 3:41
    4 * 3 is 12 and 3 * --
    4 is minus 12.
  • 3:42 - 3:46
    And if we just tidy up what
    we've got, we'll have 336
  • 3:46 - 3:48
    subtract 4, which is 2.
  • 3:50 - 3:53
    Minus 6 + 6 zero subtract 4 is
  • 3:53 - 3:57
    minus 4. Four and
    six is 10 and 616.
  • 3:59 - 4:03
    Minus 8 -- 9 --
    8 is minus 25.
  • 4:05 - 4:08
    5 subtract 8 + 9.
  • 4:08 - 4:10
    6th
  • 4:11 - 4:13
    and minus 10 + 12 -- 12 is minus
  • 4:13 - 4:17
    10. And this is the result
    of multiplying these two
  • 4:17 - 4:18
    matrices together.
  • 4:21 - 4:23
    What about if we try and
    multiply the two
  • 4:23 - 4:25
    matrices together the
    opposite way round?
  • 4:25 - 4:28
    Suppose we try and
    workout N * M.
  • 4:46 - 4:51
    Now, in this case the size of
    the first matrix here is 3 rows
  • 4:51 - 4:56
    and two columns, so that's a
    three by two and the size of the
  • 4:56 - 4:59
    second matrix is 3 by 3, three
    rows, three columns.
  • 5:00 - 5:03
    And what we observe now is
    that these two numbers here
  • 5:03 - 5:07
    are not the same, they are not
    equal. That means that we
  • 5:07 - 5:09
    cannot do the matrix
    multiplication in the order
  • 5:09 - 5:12
    that I've written it down
    here. That matrix product
  • 5:12 - 5:15
    doesn't exist. So this is the
    first point. I'd like to make
  • 5:15 - 5:18
    that even when you can find a
    matrix product by multiplying
  • 5:18 - 5:21
    two matrices together, it
    matters very much. The order
  • 5:21 - 5:24
    in which you write them down.
    It may be possible to workout
  • 5:24 - 5:28
    a product one way, but not
    another way. Let's look at
  • 5:28 - 5:29
    some more examples.
  • 5:30 - 5:33
    Suppose we've got two matrices
    C&D as I've written them down
  • 5:33 - 5:37
    here, I'm going to try to work
    out the product C * D.
  • 5:38 - 5:41
    And I'll also try and workout
    the product D times. See if
  • 5:41 - 5:42
    either of these exist.
  • 5:44 - 5:48
    But in the first case, we've got
    a two row three column matrix.
  • 5:49 - 5:52
    And in the second example
    here, within the Second matrix
  • 5:52 - 5:56
    here we've got three rows into
    two columns, so we can in fact
  • 5:56 - 5:59
    work this product out because
    these numbers are the same and
  • 5:59 - 6:03
    the result will be a two by
    two matrix. So the shape of
  • 6:03 - 6:06
    the answer will be 2 rows and
    two columns.
  • 6:08 - 6:13
    If we try and do this the other
    way round, D * C, The first
  • 6:13 - 6:17
    matrix Now has got three rows
    and two columns. It's a three by
  • 6:17 - 6:20
    two matrix and the second one's
    got two rows and three columns.
  • 6:20 - 6:22
    It's a two by three matrix.
  • 6:23 - 6:26
    So you can. You can see that we
    can still work it out because
  • 6:26 - 6:29
    these two numbers are still the
    same 2 into the same, but this
  • 6:29 - 6:33
    time the result is going to be a
    three by three matrix, so it's
  • 6:33 - 6:36
    going to be a bigger matrix with
    three rows and three columns.
  • 6:39 - 6:43
    We can use the process that we
    evaluate that we worked on
  • 6:43 - 6:47
    before to evaluate the elements
    in the these matrices. So for
  • 6:47 - 6:53
    example, the element that goes
    in here is 1 * 3 + 2 * 5 added
  • 6:53 - 6:56
    to 3 * -- 1, which is 10.
  • 6:58 - 7:02
    And you can check for yourself
    that the remaining elements are
  • 7:02 - 7:04
    131 and minus 11.
  • 7:05 - 7:08
    So it's possible to workout
    C * D and the answer is a
  • 7:08 - 7:09
    two by two matrix.
  • 7:10 - 7:15
    When we do it the other way
    round, let's take an element
  • 7:15 - 7:19
    here. Let's take the elements in
    the first row, first column and
  • 7:19 - 7:23
    we obtain the answer by working
    with the first row, first
  • 7:23 - 7:28
    column. Here, that's three
    times, one is 3 added to minus 7
  • 7:28 - 7:32
    * 4. That's three added to minus
    28, which is minus 25.
  • 7:35 - 7:40
    And you can proceed in the same
    way to fill out this resulting
  • 7:40 - 7:45
    matrix and the numbers. You'll
    get a -- 25 -- 29 -- 33.
  • 7:47 - 7:53
    9. 1521
    789
  • 7:54 - 7:59
    The important point that I want
    to make here is that when you
  • 7:59 - 8:00
    multiply C * D together.
  • 8:01 - 8:06
    It may be possible to also find
    D * C, But the answers that you
  • 8:06 - 8:09
    get may have completely
    different sizes. It's certainly
  • 8:09 - 8:14
    not true that CD is the same as
    DC, so one of the observations
  • 8:14 - 8:19
    we take away straight away is
    that in general CD is not equal
  • 8:19 - 8:23
    to DC. Even in situations where
    both of these products do exist,
  • 8:23 - 8:26
    we say that matrix
    multiplication is not
  • 8:26 - 8:29
    commutative. In general, it
    really doesn't matter the order
  • 8:29 - 8:31
    in which you carry out the
  • 8:31 - 8:35
    multiplication. Now that we know
    how to multiply 2 matrices
  • 8:35 - 8:38
    together, I'm going to show you
    an important property of
  • 8:38 - 8:44
    identity matrices. Suppose we
    have a two by two identity
  • 8:44 - 8:45
    matrix, that's 1001.
  • 8:47 - 8:52
    And suppose we have a second
    matrix, two 3 -- 4 and seven.
  • 8:52 - 8:56
    And suppose I want to multiply
    these two together.
  • 8:59 - 9:02
    The identity matrix is
    certainly a two by two matrix,
  • 9:02 - 9:06
    and this matrix is also a two
    by two matrix. So because
  • 9:06 - 9:09
    these numbers are the same, we
    can actually workout the
  • 9:09 - 9:13
    product and the answer is also
    a two by two matrix. So the
  • 9:13 - 9:16
    answer has this sort of shape
    with four elements in there.
  • 9:18 - 9:23
    To get the first element in the
    answer, we want to pair 10 with
  • 9:23 - 9:27
    2 -- 4, multiply the paired
    elements together and add so we
  • 9:27 - 9:30
    get 1 * 2 is 2 added to 0 * --
  • 9:30 - 9:33
    4. Which is just 1 * 2 is 2.
  • 9:36 - 9:41
    To get this element here, we
    want 1 * 3 which is 3 added to 0
  • 9:41 - 9:43
    * 7, which is just three.
  • 9:45 - 9:50
    To get the element in here, we
    want to pair 01 with two and
  • 9:50 - 9:55
    minus four, so it's 0 * 2, which
    is nothing 1 * -- 4 is minus 4,
  • 9:55 - 9:57
    so we just get minus 4.
  • 9:58 - 9:59
    And finally, the last element is
  • 9:59 - 10:04
    0 times. Three, which is nothing
    1 * 7 is 7, so that's our
  • 10:04 - 10:08
    answer. And if you look at the
    answer you'll see the answer is
  • 10:08 - 10:11
    identical to the matrix we
    started with here. In other
  • 10:11 - 10:14
    words, multiplying a matrix by
    an identity matrix when this
  • 10:14 - 10:17
    multiplication is possible
    leaves an answer which is
  • 10:17 - 10:20
    identical to the matrix you
    started with, and that's a very
  • 10:20 - 10:21
    important property of identity
  • 10:21 - 10:26
    matrices. The same result occurs
    if we do the multiplication the
  • 10:26 - 10:31
    other way round. If we take two
    3 -- 4 seven and we multiply it
  • 10:31 - 10:34
    by the identity matrix, one
    nought nought one will find.
  • 10:34 - 10:38
    It's also possible, and if you
    go through the operation 2 * 1
  • 10:38 - 10:42
    is 2 three times. Nothing is
    nothing. The result there is 2.
  • 10:43 - 10:46
    Two times nothing
    is nothing 313.
  • 10:47 - 10:52
    Minus 4 * 1 added to 7 times
    nought is minus 4.
  • 10:52 - 10:56
    And minus four times North,
    which is nothing added to 717
  • 10:56 - 11:01
    and you'll see again this answer
    here is the same as this matrix
  • 11:01 - 11:04
    here. So that's very important
    property to remember when you
  • 11:04 - 11:08
    multiply a matrix by an identity
    matrix, it leaves the original
  • 11:08 - 11:11
    matrix unaltered, identical to
    what it was before.
  • 11:11 - 11:14
    The same works even if we
    haven't got square
  • 11:14 - 11:16
    matrices. Suppose we have
    this identity matrix.
  • 11:20 - 11:23
    And we multiply, for example by
    the Matrix 78.
  • 11:25 - 11:29
    Well, this has got one row and
    two columns. It's a one by two
  • 11:29 - 11:32
    matrix. This is got two rows,
    two columns, so we can perform
  • 11:32 - 11:35
    the matrix multiplication and
    the result is going to be a
  • 11:35 - 11:38
    one by two matrix that's the
    same shape as the one we
  • 11:38 - 11:39
    started with.
  • 11:40 - 11:44
    And if we carry out the
    operations, it's 7 * 1, which
  • 11:44 - 11:47
    is 7 added to 8 times
    nothing, which is nothing. So
  • 11:47 - 11:48
    the result is just 7th.
  • 11:49 - 11:54
    7 times and nothing is nothing
    and 8 * 1 is 8, so it's just
  • 11:54 - 11:58
    eight. And again, this answer 7
    eight is the same as the matrix
  • 11:58 - 12:02
    we started with over here. So
    that's just to reinforce the
  • 12:02 - 12:05
    message that multiplying by an
    identity matrix leaves the
  • 12:05 - 12:06
    original matrix unaltered.
Title:
https:/.../matrixmultiplication2f61mb-aspect.mp4
Video Language:
English
Duration:
12:10

English subtitles

Revisions