Matrix Multiplication
Last updated
Last updated
The product of two matrices is defined only when the number of columns of the first matrix is the same as the number of rows of the second; in other words, it is only possible to multiply m x n and n x p size matrices. The reason for this becomes clear upon defining the product:
Another way to see is this:
and
Another way to look at multiplication through columns
4th way to multiply
Also, the multiplication of matrices need not be commutative. Therefore AB =/= BA generally.
When AB = BA then AB are said to commute. This is the case of the identity matrix.
Say you have this matrix you want to solve:
Find the matrix you need to multiply it by to solve it. Or to get U (upper triangle which allows you to easily solve the system.
Step 1 : You want a 0 in position (2, 1) and (3,1) - but in this example there is already a 0 in (3,1).
Step 2: You want a 0 in position (3,2). So in this example you subtract 2 x row 2 from row 3 to get the 0.
So now, z=5, and you can easily solve the rest.
You can change the order in which you do multiplications with matrix multiplication.
Let's finish the topic of elimination.
Ex: 2 x 2 elimnation. Let A be a matrix as below where I can do elimination, but no pivots. I want to get from A to U to solve A. But then I want to know how is A related to U where there is a matrix L where A = LU. How do you get there?
First, to solve A and get U (that is then easy to solve), I multiply by my elementary matrix at the position 2, 1 (E(2,1)) because that is how I get a 0 in position 2,1. Therefore we get:
Then to get A = L U: you need to multiply E, (2,1) by the inverse which becomes L (-4 becomes 4).
Where L is the Lower triangle, and U is the Upper triangle.
Now let's try to do this is a 3x3 matrix. What are the steps to producing elimination?
Now, suppose we want all the E's on the right hand side of the equation. We get:
So L is the product of inverses. Why do we do this? Because when you multiply the non inverses, you don't get a good matrix. The multipliers go directly into L (see the number 10 in the matrix below). However, when you multiply the inverses, you get a clean L with no 0 in position 3,1. See:
Say you have a matrix nxn where n=100. How many operations will we have to do with elimination? Turns out that the operations for A and b (Ax = b) there will be: