C34=(3rd row of A)∗(4th column of B)=a31b14+a32b24+a33b34+...=k=1∑na3kbk4
We can generalize this to the whole matrix:
Cij=k=1∑nAikBkj
If A is m×n and B is n×p, then the resulting matrix C will be m×p. If this is confusing at first, think about a simple example. A row of A will be multiplied by p columns of B, and this will be repeated for all m rows of A.
1.1.1. Column at A Time
Now, let's look at it as a product of matrix A and column j of B.
(A)∣B1∣∣B2∣⋯∣Bp∣=∣C1∣∣C2∣⋯∣Cp∣
Each row of A is multiplied by each column of B to produce the corresponding entry in C. We've already seen this in 2.2:
matrix×vector=vector
The columns of C are linear combinations of the columns of A. (See Super Important! in the last post.)
It may not be very straightforward to see why this works, but you can see it works by hand. I think it's enough here to know that we can do this.
1.3. Inverses (Square Matrix)
1.3.1. Existence of Inverse
Not all matrices have inverses. If A−1 exists (= invertible, non-singular), ..
AA−1=A−1A=I
Why a matrix wouldn't have an inverse (singular) ?
(1236)
Determinant of this matrix is zero.
Suppose there is an inverse matrix A−1, then when we multiply A by A−1, the result should be combination of the columns of A. But they lie on the same line, so we can never get the identity matrix I.
If we can find a vector x such that Ax=0, then A is singular. In this case, x=(3,−1).
(1236)(3−1)=(00)
Why this is an issue for an inverse?
Ax=0A−1Ax=x=0
But x was not zero!
Important!
If a combination of the columns of A can give you the zero vector, then A is singular and does not have an inverse. In other words, if there is a non-zero vector x such that Ax=0, then A is singular.
1.3.2. Gauss-Jordan
(1237)(abcd)=(1001)
Finding the inverse is like solving the system.
A×column j of A−1=column j of I
Gauss-Jordan can solve two equations at once.
(1237)(ab)=(10)(1237)(cd)=(01)
Jordan once said, we can..
(1237∣∣1001)→(1031∣∣1−201)
Now that we have the upper triangular, Gauss would have said to quit, but Jordan said keep going!
→(1001∣∣7−2−31)
We have found the inverse matrix.
A−1=(7−2−31)
Again, what was confusing for me in the beginning is that it is not clear why we can do this. Well, you can check A×A−1=I, but why does it work?
As we are doing elimination steps, we are multiplying A by some matrice E's.