< Return to Video

Solving the matrix vector equation

  • 0:01 - 0:02
    Voiceover:In the last video we saw
  • 0:02 - 0:04
    that we could take a
    system of two equations
  • 0:04 - 0:06
    with two unknowns and represent it
  • 0:06 - 0:09
    as a matrix equation where the matrix A's
  • 0:09 - 0:12
    are the coefficients here
    on the left-hand side.
  • 0:12 - 0:14
    The column vector X has our two
  • 0:14 - 0:17
    unknown variables, S and T.
  • 0:17 - 0:18
    Then the column vector B is essentially
  • 0:18 - 0:21
    representing the
    right-hand side over here.
  • 0:21 - 0:22
    What was interesting about it,
  • 0:22 - 0:23
    then that would be the equation A,
  • 0:23 - 0:25
    the matrix A times the column vector X
  • 0:25 - 0:28
    being equal to the column vector B.
  • 0:28 - 0:30
    What was interesting about that is we saw
  • 0:30 - 0:31
    well, look, if A is invertible,
  • 0:31 - 0:34
    we can multiply both the
    left and the right-hand sides
  • 0:34 - 0:36
    of the equation,
  • 0:36 - 0:37
    and we have to multiply
    them on the left-hand sides
  • 0:37 - 0:39
    of their respective sides by A inverse
  • 0:39 - 0:41
    because remember matrix,
  • 0:41 - 0:43
    when matrix multiplication order matters,
  • 0:43 - 0:45
    we're multiplying the left-hand side
  • 0:45 - 0:47
    of both sides of the equation.
  • 0:47 - 0:49
    If we do that then we
    can get to essentially
  • 0:49 - 0:53
    solving for the unknown column vector.
  • 0:53 - 0:54
    If we know what column vector X is,
  • 0:54 - 0:56
    then we know what S and T are.
  • 0:56 - 0:57
    Then we've essentially solved
  • 0:57 - 0:59
    this system of equations.
  • 0:59 - 1:01
    Now let's actually do that.
  • 1:01 - 1:04
    Let's actually figure
    out what A inverse is
  • 1:04 - 1:06
    and multiply that times
    the column vector B
  • 1:06 - 1:08
    to figure out what the column vector X is,
  • 1:08 - 1:10
    and what S and T are.
  • 1:10 - 1:16
    A inverse, A inverse is equal to
  • 1:16 - 1:18
    one over the determinant of A,
  • 1:18 - 1:22
    the determinant of A for a two-by-two here
  • 1:22 - 1:27
    is going to be two times
    four minus negative
  • 1:27 - 1:28
    two times negative five.
  • 1:28 - 1:33
    It's going to be eight minus positive 10,
  • 1:33 - 1:34
    eight minus positive 10,
  • 1:34 - 1:36
    which would be negative two.
  • 1:36 - 1:39
    This would become negative
    two right over here.
  • 1:39 - 1:42
    Once again, two times four is eight minus
  • 1:42 - 1:45
    negative two times negative five
  • 1:45 - 1:49
    so minus positive 10 which
    gets us negative two.
  • 1:49 - 1:50
    You multiply one over the determinant
  • 1:50 - 1:55
    times what is sometimes
    called the adjoint of A
  • 1:55 - 1:58
    which is essentially swapping the top left
  • 1:58 - 2:01
    and bottom right or at least
    for a two-by-two matrix.
  • 2:01 - 2:04
    This would be a four.
  • 2:04 - 2:06
    This would be a two.
  • 2:06 - 2:07
    Notice I just swapped these,
  • 2:07 - 2:08
    and making these two negative,
  • 2:08 - 2:10
    the negative of what they already are.
  • 2:10 - 2:12
    This is from a negative two this is
  • 2:12 - 2:14
    going to become a positive two,
  • 2:14 - 2:15
    and this right over
    here is going to become
  • 2:15 - 2:16
    a positive five.
  • 2:16 - 2:19
    If all of this looks
    completely unfamiliar to you,
  • 2:19 - 2:22
    you might want to review the tutorial
  • 2:22 - 2:23
    on inverting matrices
  • 2:23 - 2:25
    because that's all I'm doing here.
  • 2:25 - 2:29
    So A inverse is going to be equal to,
  • 2:29 - 2:32
    A inverse is going to be equal to,
  • 2:32 - 2:36
    let's see, this is negative 1/2 times four
  • 2:36 - 2:37
    is negative two.
  • 2:37 - 2:43
    Negative 1/2, negative 1/2 times five
  • 2:43 - 2:48
    is negative 2.5, negative 2.5.
  • 2:48 - 2:53
    And negative 1/2 times
    two is negative one.
  • 2:53 - 2:55
    Negative 1/2 times two is negative one.
  • 2:55 - 2:57
    So that's A inverse right over here.
  • 2:57 - 2:59
    Now let's multiply A inverse times
  • 2:59 - 3:02
    our column vector, seven, negative six.
  • 3:02 - 3:04
    Let's do that.
  • 3:04 - 3:05
    This is A inverse. I'll rewrite it.
  • 3:05 - 3:09
    Negative two, negative 2.5, negative one,
  • 3:09 - 3:15
    negative one times seven and negative six.
  • 3:15 - 3:18
    Times, I'll just write
    them all in white here now.
  • 3:18 - 3:20
    Seven, negative six.
  • 3:20 - 3:24
    We've had a lot of practice
    multiplying matrices.
  • 3:24 - 3:26
    So what is this going to be equal to?
  • 3:26 - 3:28
    The first entry is
    going to be negative two
  • 3:28 - 3:34
    times seven which is negative 14 plus
  • 3:34 - 3:39
    negative 2.5 times negative six.
  • 3:39 - 3:41
    Let's see. That's going to be positive.
  • 3:41 - 3:44
    That's going to be 12 plus another 3.
  • 3:44 - 3:46
    That's going to be plus 15.
  • 3:46 - 3:48
    Plus 15.
  • 3:48 - 3:50
    Negative 2.5 times negative six
  • 3:50 - 3:52
    is positive 15.
  • 3:52 - 3:54
    Then we're going to have negative one
  • 3:54 - 3:58
    times seven which is negative seven plus
  • 3:58 - 4:00
    negative one times negative six.
  • 4:00 - 4:03
    Well, that is positive six.
  • 4:03 - 4:07
    So the product A inverse B
  • 4:07 - 4:09
    which is the same things
    as a column vector X
  • 4:09 - 4:10
    is equal to,
  • 4:10 - 4:12
    we deserve a little
    bit of a drum roll now,
  • 4:12 - 4:16
    the column vector one, negative one.
  • 4:16 - 4:19
    We have just shown that this is equal to
  • 4:19 - 4:22
    one, negative one or that X is equal to
  • 4:22 - 4:24
    one, negative one,
  • 4:24 - 4:28
    or we could even say
    that the column vector,
  • 4:28 - 4:33
    the column vector ST,
  • 4:33 - 4:37
    column vector with the
    entries S and T is equal to,
  • 4:37 - 4:43
    is equal to one, negative one,
  • 4:43 - 4:47
    is equal to one, negative one
  • 4:47 - 4:48
    which is another way of saying
  • 4:48 - 4:49
    that S is equal to one
  • 4:49 - 4:51
    and T is equal to negative one.
  • 4:51 - 4:52
    I know what you're saying.
  • 4:52 - 4:54
    I said this in the last video
  • 4:54 - 4:55
    and I'll say it again in this video.
  • 4:55 - 4:56
    You're like, "Well, you
    know, it was so much easier
  • 4:56 - 4:58
    "to just solve this system directly
  • 4:58 - 5:01
    "just with using elimination
    or using substitution."
  • 5:01 - 5:06
    I agree with you, but
    this is a useful technique
  • 5:06 - 5:08
    because when you are doing problems
  • 5:08 - 5:10
    in computation there may be situations
  • 5:10 - 5:12
    where you have the left-hand side
  • 5:12 - 5:15
    of this system stays the same,
  • 5:15 - 5:16
    but there's many, many,
    many different values
  • 5:16 - 5:18
    for the right-hand side of the system.
  • 5:18 - 5:20
    So it might be easier to just compute
  • 5:20 - 5:24
    the inverse once and
    just keep multiplying,
  • 5:24 - 5:26
    keep multiplying this inverse times
  • 5:26 - 5:30
    the different what we have
    on the right-hand side.
  • 5:30 - 5:32
    You probably are familiar with some types,
  • 5:32 - 5:34
    you have graphics processors,
  • 5:34 - 5:36
    and graphics cards on computers
  • 5:36 - 5:38
    and they talk about
    special graphic processors.
  • 5:38 - 5:39
    What these are really all about
  • 5:39 - 5:42
    are the hardware that is special-purposed
  • 5:42 - 5:45
    for really fast matrix multiplication
  • 5:45 - 5:48
    because when you're
    doing graphics processing
  • 5:48 - 5:49
    when you're thinking about modeling things
  • 5:49 - 5:50
    in three dimensions,
  • 5:50 - 5:51
    and you're doing all
    these transformations,
  • 5:51 - 5:53
    you're really just doing a lot of
  • 5:53 - 5:55
    matrix multiplications
    really, really, really fast
  • 5:55 - 5:58
    in real time so that to
    the user playing the game
  • 5:58 - 5:59
    or whatever they're doing,
  • 5:59 - 6:01
    it feels like they're in some type
  • 6:01 - 6:04
    of a 3D, real-time reality.
  • 6:04 - 6:06
    Anyway, I just want to point that out.
  • 6:06 - 6:10
    This wouldn't be, if I
    saw this just randomly
  • 6:10 - 6:13
    my instincts would be to
    solve this with elimination,
  • 6:13 - 6:17
    but this ability to think of this
  • 6:17 - 6:22
    as a matrix equation is a
    very, very useful concept,
  • 6:22 - 6:23
    one actually not just in computation,
  • 6:23 - 6:27
    but also as you go into
    higher level sciences
  • 6:27 - 6:29
    especially physics, you will see a lot of
  • 6:29 - 6:32
    matrix vector equations like this
  • 6:32 - 6:33
    that kind of speak in generalities.
  • 6:33 - 6:35
    It's really important to think about
  • 6:35 - 6:37
    what these actually represent
  • 6:37 - 6:39
    and how they can actually be solved.
Title:
Solving the matrix vector equation
Description:

more » « less
Video Language:
English
Team:
Khan Academy
Duration:
06:40

English subtitles

Revisions