• No results found

Matrix equations

In document No Bullshit Guide to Linear Algebra (Page 164-168)

We can express the problem of solving a system of linear equations as a matrix equation and obtain the solution using the matrix inverse. Consider the following system of linear equations:

x1+ 2x2= 5 3x2+ 9x2= 21.

We can rewrite this system of equations using the matrix-vector prod- uct: 1 2 3 9 x1 x2  = 5 21  , or, more compactly, as

A~x = ~b,

where A is a 2×2 matrix, ~x is the vector of unknowns (a 2×1 matrix), and ~b is a vector of constants (a 2 × 1 matrix).

We can solve for ~x in this matrix equation by multiplying both sides of the equation by the inverse A−1:

A−1A~x =1~x = ~x = A−1~b.

Thus, to solve a system of linear equations, we can find the inverse of the matrix of coefficients, then compute the product:

~x =x1 x2  = A−1~b = 3 − 2 3 −1 1 3  5 21  =1 2  .

The computational cost of finding A−1 is roughly equivalent to the computational cost of bringing an augmented matrix [ A | ~b ] to re- duced row echelon form—it’s not like we’re given the solution for free by simply rewriting the system of equations in matrix form. Never- theless, expressing the system of equations as A~x = ~b and its solution as ~x = A−1~b is a useful level of abstraction that saves us from needing to juggle dozens of individual coefficients. The same symbolic expres- sion ~x = A−1~b applies whether A is a 2 × 2 matrix or a 1000 × 1000 matrix.

Introduction

It’s time we had an important discussion about matrix equations and how they differ from regular equations with numbers. If a, b, and c are three numbers, and I tell you to solve for a in the equation

4.2 MATRIX EQUATIONS 151

you’d know the answer is a = c/b = c1 b =

1

bc, and that would be the end of it.

Now suppose A, B, and C are matrices and you want to solve for Ain the matrix equation

AB = C.

The answer A = C/B is not allowed. So far, we defined matrix multiplication and matrix inversion, but not matrix division. Instead of dividing by B, we must multiply by B−1, which, in effect, plays the same role as a “divide by B” operation. The product of B and B−1 gives the identity matrix,

BB−1=1, B−1B =1.

When applying the inverse matrix B−1 to the equation, we must specify whether we are multiplying from the left or from the right, because matrix multiplication is not commutative. Can you determine the correct answer for A in the above equations? Is it A = CB−1 or A = B−1C?

To solve matrix equations, we employ the same technique we used to solve equations in Chapter 1: undoing the operations that stand in the way of the unknown. Recall that we must always do the same thing to both sides of an equationfor it to remain true.

With matrix equations, it’s the same story all over again, but there are two new things you need to keep in mind:

• The order in which matrices are multiplied matters because ma- trix multiplication is not a commutative operation AB 6= BA. The expressions ABC and BAC are different despite the fact that they are the product of the same three matrices.

• When performing operations on matrix equations, you can act either from the left or from the right on the equation.

The best way to familiarize yourself with the peculiarities of matrix equations is to look at example calculations. Don’t worry, there won’t be anything too mathematically demanding in this section; we’ll just look at some pictures.

Matrix times vector

Suppose we want to solve the equation A~x = ~b, in which an n × n matrix A multiplies the vector ~x to produce a vector ~b. Recall, we can think of vectors as “tall and skinny” n × 1 matrices.

.

Assuming A is invertible, we can multiply by the inverse A−1 on the left of both sides of the equation:

.

By definition, A−1 times its inverse A is equal to the identity ma- trix 1, which is a diagonal matrix with ones on the diagonal and zeros everywhere else:

.

Any vector times the identity matrix remains unchanged, so

, which is the final answer.

Note that the question “Solve for ~x in A~x = ~b ” sometimes arises in situations where the matrix A is not invertible. If the system of equations is under-specified (A is wider than it is tall), there will be a whole subspace of acceptable solutions ~x. Recall the cases with infinite solutions (lines and planes) we saw in the previous section.

Matrix times matrix

Let’s look at some other matrix equations. Suppose we want to solve for A in the equation AB = C:

.

To isolate A, we multiply by B−1 from the right on both sides:

4.2 MATRIX EQUATIONS 153

When B−1hits B they cancel (BB−1 =1) and we obtain the answer:

.

Matrix times matrix variation

What if we want to solve for B in the same equation AB = C?

.

Again, we must do the same to both sides of the equation. To cancel A, we need to multiply by A−1 from the left:

. After A−1 cancels with A, we obtain the final result:

.

This completes our lightning tour of matrix equations. There is really nothing new to learn here; just make sure you’re aware that the order in which matrices are multiplied matters, and remember the general principle of “doing the same thing to both sides of the equation.” Act- ing according to this principle is essential in all of math, particularly when manipulating matrices.

In the next section, we’ll “zoom in” on matrix equations by ex- amining the arithmetic operations performed on coefficients during matrix multiplication.

Exercises

E4.4 Solve for X in the following matrix equations: (1) XA = B; (2) ABCXD = E; (3) AC = XDC. Assume the matrices A, B, C, D, and E are invertible.

In document No Bullshit Guide to Linear Algebra (Page 164-168)