Matrix Algebra
We review here some of the basic definitions and elementary algebraic
operations on matrices.
There are many applications as well as much interesting theory
revolving around these concepts, which we encourage you to explore
after reviewing this tutorial.
A matrix is simply a retangular array of numbers. For example,
A = |
/ | | | | | | \ |
|
\ | | | | | | / |
|
|
is an m×n matrix (m rows, n columns), where the entry in
the ith row and jth column is aij. We often write A = [aij].
Some Terminology
For an n ×n square matrix A, the elements
a11,a22,
,ann form the main diagonal of the
matrix. A square matrix is called lower triangular if all the entries above the main diagonal are zero,
upper triangular if all the entries below the main diagonal are zero.
The sum
n ∑ k = 1 |
akk of the elements on the main
diagonal of A is called the trace of A. |
The matrix AT = [aji] formed by interchanging the rows and
columns of A is called the transpose of A. If AT = A,
the matrix A is symmetric.
We can consider a matrix of complex numbers. If C = [cij] is a matrix of complex numbers
the matrix C* obtained by taking CT and then taking the complex conjugate of each entry
is called the adjoint matrix (or the conjugate transpose) of C.
Example
Let B = |
|
/ | | \ |
|
\ | | / |
. The trace of B is 6 + -6 = 0. |
The transpose of B is BT = |
/ | | \ |
|
\ | | / |
. |
Addition and Subtraction of Matrices
To add or subtract two matrices of the same size, simply
add or subtract corresponding entries. That is, if B = [bij] and
C = [cij],
B + C = [bij + cij] and B-C = [bij - cij] |
|
Example
For B = |
/ | | \ |
|
\ | | / |
and C = |
/ | | \ |
|
\ | | / |
, |
B + C = |
/ | | \ |
|
|
\ | | / |
= |
/ | | \ |
|
|
\ | | / |
|
|
B-C = |
/ | | \ |
|
|
\ | | / |
= |
/ | | \ |
|
|
\ | | / |
|
|
The m×n zero matrix, 0, for which every entry is 0, has
the property that for any m×n matrix A,
Scalar Multiplication
To multiply a matrix A by a number c (a ``scalar''), multiply each
entry of A by c. That is,
Example
-
Using the matrix B = |
/ | | \ |
|
\ | | / |
from the previous example, |
3B = 3 |
/ | | \ |
|
|
\ | | / |
= |
/ | | \ |
|
|
\ | | / |
. |
|
Matrix Multiplication
Let X be an m×n matrix and Y be an n×p matrix.
Then the product XY (or X×Y) is the m×p matrix whose
(i,j)th entry is given by
Notes
- The product XY is only defined if the number of columns of X
is the same as the number of rows of Y.
- (X×Y)T = YT×XT.
- (X×Y)×Z = X×(Y×Z).
- XY and YX may not both be defined. If they both
do exist, they are not necessarily equal and might not even be
of the same size.
Example
For the matrices B = |
/ | | \ |
|
\ | | / |
and C = |
/ | | \ |
|
\ | | / |
, |
BC = |
/ | | \ |
|
\ | | / |
/ | | \ |
|
\ | | / |
= |
/ | | \ |
|
\ | | / |
= |
/ | | \ |
|
\ | | / |
|
|
while
CB = |
/ | | \ |
|
\ | | / |
/ | | \ |
|
\ | | / |
= |
/ | | \ |
|
\ | | / |
= |
/ | | \ |
|
\ | | / |
|
|
The n×n matrix having all main diagonal entries equal to 1 and
all other entries equal to 0 is called the identity matrix
I. For example, the 3×3 identity matrix is
The n ×n identity matrix has the
property that if A is any n ×n matrix,
Inverse of a Matrix
Start with an n ×n matrix X. Suppose the n ×n
matrix Y has the property that
Then Y is called the inverse of X and is denoted X-1.
Notes
- Only square matrices X can have inverses. If X is not square,
then for any Y the product XY will not be the same size matrix as the
product YX (if we're lucky enough even to have both products exist!).
- Not every square matrix has an inverse. If an inverse exists,
it is unique.
- If a matrix has an inverse, the matrix is said to be
invertible.
The inverse of a 2 ×2 matrix is simple to calculate:
If A = |
/ | | \ |
|
|
|
\ | | / |
, then A-1 = |
1 ad-bc
|
|
/ | | \ |
|
|
|
\ | | / |
. |
|
Example
The inverse of C = |
/ | | \ |
|
\ | | / |
is |
C-1 = |
1 (1)(0)-(2)(-1)
|
|
/ | | \ |
|
|
|
\ | | / |
= |
1 2
|
|
/ | | \ |
|
|
|
\ | | / |
= |
/ | | \ |
|
|
|
\ | | / |
|
|
Note that CC-1 = |
/ | | \ |
|
\ | | / |
/ | | \ |
|
\ | | / |
= |
/ | | \ |
|
\ | | / |
and C-1C = |
/ | | \ |
|
\ | | / |
/ | | \ |
|
\ | | / |
= |
/ | | \ |
|
\ | | / |
Matrix B = |
/ | | \ |
|
\ | | / |
does not have an inverse. |
Determinant of a Matrix
How did we know that B = |
/ | | \ |
|
\ | | / |
does not have an inverse? |
The determinant of A, detA, is a number with the property
that A is invertible if and only if detA ≠ 0.
For a 2 ×2 matrix A = |
/ | | \ |
|
\ | | / |
, detA = ad -bc. |
Example
For B = |
/ | | \ |
|
\ | | / |
, detB = (6)(-6)- (9)(-4) = -36+36 = 0, so B is not
invertible. That is, B does not have an inverse. |
For a 3 ×3 (or larger) matrix A, things are a little more
complicated:
- Denote by Mij(A) the determinant of the matrix formed by deleting row i and column j from A.
- Define cij(A) = (-1)i+jMij(A) to be the (i,j) cofactor of A.
- Then we can compute detA by the Laplace Expansion
along any row or column of A:
- Along row i:
|
det
| A = ai1ci1(A) + ai2ci2(A) +
+ aincin(A) |
|
- Along column j:
|
det
| A = a1jc1j(A) + a2jC2j(A)+
+ anjcnj(A) |
|
Example
Let A = |
/ | | | | \ |
|
\ | | | | / |
. |
Along the first row,
| |
(1) [ (0)(6) - (-1)(1) ] - (-1)[ (1)(6)-(-1)(2) ] + 3 [ (1)(1)-(0)(2) ] |
|
| | |
| | |
Computing detA along the second column instead,
| |
-(-1) [ (1)(6) - (-1)(2) ] - ( 0)[ (1)(6)-(3)(2) ] - 1 [ (1)(-1)-(3)(1) ] |
|
| | |
| | |
It can be proven that det(AT) = det(A) and that det(A×B) = det(A)·det(B).
Vedi qui per il calcoli con R.
Some computation techniques are discussed in Solving Systems of Equations.
Key Concepts [index]
Let A = [aij] and B = [bij] .
|
Inverse A-1 of A:
A-1 satisties AA-1 = A-1A = I.
then A-1 = |
1 ad-bc
|
/ | | \ |
|
\ | | / |
Determinant detA:
detA = ad-bc.
In general,
along row i:
detA = ai1ci1(A) + ai2ci2(A) +
+ aincin(A)
along column j:
detA = a1jc1j(A) + a2jC2j(A)+
+ anjcnj(A)
|
|