You are on page 1of 39

Matrix and Determinant

Matrix Notation
x 2 y z 4w 0
3x 4 y 2 z 6w 0 Only coefficients matter

x 3y 2z w 0

1 2 1 4 row

define
3 4 2 6 Matrix is 3 by 4

1 3 2 1 A34

column a34 entry or element


3 rows and 4 columns
Transpose
If A= aij then AT=aji

0
A 1 A T 0 1 2 Save space
2

1 4
T
1 2 3 2 5
4 5 6
3 6
Square Matrix
When the number of rows =
1 0 4
the number of columns
1 2 7

2 8 3
Principal or main diagonal

Symmetric matrix Diagonal matrix Identity matrix

5 1 6 5 0 0 1 0 0
1 3 0 0 3 0 0 1 0

6 0 2 0 0 2 0 0 1
A = AT
Matrix Operating Rules
Addition or subtraction
1 2 3 1 6 3 0 8 0
4 0 2 8 12 14 12 12 16

Both addition and subtraction are commutative and


associative

A+B=B+A (A + B ) + C = A + (B + C)

Multiply by a constant
1 2 3 2 4 6
2
4 0 2 8 0 4
Matrix Multiplication
r

AB C cij aik bkj


k 1

Exterior dimensions determine the dimensions


of the results

Amr Brn Cmn

Interior dimensions have to be equal


Matrix Multiplication
If we think of row i of A as r-vector and column j of B as
another vector. Then, the i,j element of AB is the dot product
of these two vectors
(1,3)(1,2)=7

1 3 1 1 3
AB
2 5 22 2 1 4 23 23

Note that ABBA


Ex. If A is 32 and B is 34, is it possible to get AB?
A More Practical Way

1 1 3
2 1 4

11 3 2 7
1 3
2 5

Reversal Rule
Reversal rule for inverses of transposes

( AB ) B A
T T T

T
n
A B aik bkj a jk bki
proof T
n

k 1 k 1
n
bki a jk B T A T
k 1
Intuitive Proof

1 1 3 1 2
2 1 4 3 5

11 3 2 7
1 3 1 2
2 5 1 1


3 4

transpose
Matrix Form of Linear Equations
a11 x1 + a12 x2 = b1
For a21 x1 + a22 x2 = b2

a11 a12 x1 b1
If we define A x b
a21 a22 x2 b2
a11x1 a12 x2
then Ax
a21x1 a22 x2
Therefore, the original equations can be expressed as Ax = b (matrix form)
By writing linear equations in a matrix form, you save 1 sec per matrix
If you save 10 sec / day, you save almost 60 h in your life!
Augmented Matrix
Alternatively, we can also use a augmented matrix
A B
a11 a12 b1
aug A
21 22 2
a a b

Augment A with B

Congratulations! You just save another 1 sec for each augmented


matrix you write down
How to Solve a Small Number of
Equations?
2 x1 + 7 x 2 = 4 (1)
3 x1 + 8 x 2 = 5 (2)

(1) 8 (2) 7 x1=3/5 eliminate x2


Insert into (1) or (2), we get x2=2/5

a11 x1 + a12 x2 = b1 (3)


a21 x1 + a22 x2 = b2 (4)
b1a22 b2 a12
x1
[a11a22 a12a21 ]
(3) a22 (4) a12 : [a11a22 a12a21]x1 = b1a22 b2a12 b2 a11 b1a21
(4) a11 (3) a21 : [a11a22 a12a21]x2 = b2a11 b1a21 x2
[a11a22 a12a21 ]
If we define a 2 2 determinant as

p n
pq mn single number
m q

the solution can be written as


b1 a12
Therefore, for
b1a22 b2 a12 b2 a22
x1
a11 x1 + a12 x2 = b1 [a11a22 a12a21 ] a11 a12
a21 x1 + a22 x2 = b2 a21 a22
Determinant of coefficient matrix
a11 b1
b2 a11 b1a21 a21 b2
x2
[a11a22 a12a21 ] a11 a12
a21 a22
General Solutions
A x= b
a11 x1 + a12 x2+a1nxn = b1 a11 a12 a1n x1 b1
a21 x1 + a22 x2+a2nxn = b2 a a2 n x2 b2
21 a22
. a31 a32 a3n x3 b3
.
.
an1 an 2 ann xn bn
an1 x1 + an2 x2+annxn = bn

D is Determinant of coefficient matrix a11 a12 a1n


a21 a22 a2 n Dj=?
xj=Dj / D D det A
Determinant of coefficient
matrix whose j column has
an1 an 2 ann been replaced by b
Cramers rule
Determinant
The determinant of an n n matrix
n! terms
a11 a12 a1n
a21 a22 a2 n
D det A D 1
a1k a2k a3k
h
1 2 2
ankn
k1 , k 2 , k n

k1 k2 k3 .... k n
an1 an 2 ann
k3
h is define as the number of transpositions required to
transform the sequence of numbers, k1, k2, kn into the
order of 1, 2, .n
How to calculate h?
For a 5 5 matrix, we have
Product of 5! terms
a11 a12 a13 a14 a15
a21 a22 a23 a24 a25 Choose a term
from each row in a
D det A a31 a32 a33 a34 a35 different column

a41 a42 a43 a44 a45


a51 a52 a53 a54 a55

15324 15324 The exchange of two numbers does


13524 12354 not have to be between two
13254 12345 consecutive numbers, but can be
12354 between any pair of numbers
12345
h is not unique, but it is always an
h=4 h=2
even number. h only determines sign
Determinant of a 3 3 matrix
a11a22a33 a12a23a31 a13a21a32
a11a23a32 a12a21a33 a13a22a31

a11 a12 a13 H=2 H=2



H=0
a21 a22 a23 11 22 33 12 23 31 13a21a32
a a a a a a a
a31 a32 a33 a11a23a32 a12a21a33 a13a22a31

A matrix of order n has n! permutations


e.g.
A 5 5 matrix has 120 terms
A 10 10 matrix has 3628800 terms

A more practical way is to use LU decomposition


Example
1 1 1 x1 0
Solve 0 2 3 x 1
2
4 0 1 x3 0

0 1 1 1 0 1 1 1 0
1 2 3 0 1 3 0 2 1
0 0 1 1 4 0 1 4 0 0 2
x1 x2
1 x3
1 1 1 6 1 1 1 2 1 1 1 3
0 2 3 0 2 3 0 2 3
4 0 1 4 0 1 4 0 1

It is difficult for big matrices


Properties of Determinants
(a) If two rows or two columns are interchanged, the sign will
change
1 2 3 4 4 3 2 1 1 2

3 4 1 2 2 1 4 3 3 4

(b) If two columns (rows) are identical, the determinant is zero

(c) If a determinant is multiplied by a constant c, then one


of the columns (row) is multiplied by c.

1 2 2 2 3 6 1 2
2 ?
3 4 6 4 3 9 1 3
Ans: 9
Properties of Determinants (Contd)
(d) Two determinants of the same size may be added if all
rows (columns), except one, are identical

a11 a12 a13 a11 b12 a13 a11 a12 b12 a13
a21 a22 a23 a21 b22 a23 a21 a22 b22 a23
a31 a32 a33 a31 b32 a33 a31 a32 b32 a33

(e) If we multiply one row (column) and add it to another


row (column), the determinant is unchanged

1 2 1 2 1 0
(1)3+ (2) 2
0 2 3 4 3 2
(1)2+ (2)
Examples
(1)
1 1 1 1 1 1 1 1 1
1 2 2 0 1 1 0 1 1 1
1 2 3 0 1 2 0 0 1
Determinant of upper triangle matrix is
product of diagonal

(2) 1 1 1
a b c ? Ans: 0

bc ac ab
Minors and Complementary Minors
Two minors can be formed by striking out equal number of entire rows and columns

a11 a12 a13 Minors a22 a11 a13


a31 a33
a21 a22 a23
These two minors are called complementary
a31 a32 a33 minors

a11 a12 a13 a14 a15 Again, we have two complementary


a21 a22 a23 a24 a25 minors
a21 a23 a25
a31 a32 a33 a34 a35 a12 a14
a31 a33 a35
a41 a42 a43 a44 a45 a42 a44
a51 a53 a 55
a51 a52 a53 a54 a55
Algebraic Complement
If A is a determinant of order n, and M is an m-order
minor of A in which the rows of A numbered k1,
k2.km and the columns numbered l1, l2,.lm are
represented in M (or in complement of M), then
m

l j k j
Algebraic complement of M = (1) j 1
complement of M

a21 a23 a25


Algebraic 1 3 5 2 3 5 a12 a14
complement a31 a33 a35 1
of
a42 a44
a51 a53 a55
Cofactor
A special algebraic complement of a single element

Cofactor of aij= (-1)i + j (minor of aij in A)

1 4
1 6 2 Cofactor of -1 = (-1)1+1
3 7
A 0 1 4
6 2
8 3 7 Cofactor of 8 = (-1)1+3
1 4
Laplaces Expansion of a Determinant
Choose any m columns (or rows) from the nth order determinant
From these columns (or rows), form all possible mth order determinants
by striking out (n m) rows (or columns).
Take the sum of the products of all these mth order
determinants with their algebraic complements.

2 0 1 5
1 2 0 1 2 1 1 2 2 1 2 1 2 1 2 1
1131 2 11313 1131 4
3 1 1 2 1 0 1 1 3 1 1 1 1 0 1 2
1 1 0 1
1 0 0 5 1 0 0 5 3 1 0 5
113 23 113 2 4 1133 4
3 1 1 1 1 0 1 2 1 0 2 1
Cofactor Expansion
a11 a12 a13 a14 a15
a21 a22 a23 a24 a25
D det A a31 a32 a33 a34 a35
a41 a42 a43 a44 a45
a51 a52 a53 a54 a55

n
det A a1 j A1 j A1 j is the cofactor of a1 j
j 1
Cofactor Expansion
1 2 3
5 6 4 6 4 5
4 5 6 (1)(1)11 (2)(1)1 2 (3)(1)13
8 9 7 9 7 8
7 8 9
3 (2)(6) (3)(3) 0

2 0 1 5
2 0 1 1 2 1 1 2 0
1 2 0 1
2 1 1 2 3 1 2 5 3 1 1 -2
3 1 1 2
1 0 1 1 1 1 1 1 0
1 1 0 1

which column or row is the best?


Gauss Elimination

2 0 1 5 0 0 1 0
1 2 1
1 2 0 1 1 2 0 1
1 1 3 -2
3 1 1 2 1 1 1 3
1 1 1
1 1 0 1 1 1 0 1
Determinant of Upper/Lower
Triangular Matrix

a11 a12 a13


a22 a23
0 a22 a23 a11 a11a22a33
0 a33
0 0 a33

For an upper triangular matrix, its determinant is the product of


diagnaol elements
Inverse Matrix
If B is a matrix such that

BA AB I
1
then B is an inverse matrix of A B A

A x= b
A 1
is useful A-1 A x= A-1 b
I x= A-1 b

How to obtain A-1 ?


Alien Cofactor
n
Eik aij Akj cofactor expansion
j 1

e.g. a11 a12 a13


a22 a23 a21 a23 a21 a22
a11 a12 a13 E11 a11
a32 a33
a12
a31 a33
a13
a31 a32
a21 a22 a23

A a21 a22 a23


a31 a32 a33
a31 a32 a33
a31 a32 a33 a22 a23
a32
a21 a23
a33
a21 a22
a21 a22 a23
E31 a31
a32 a33 a31 a33 a31 a32
a31 a32 a33

We find that

det A if ik
Eik 0 if ik
Cofactor A and Adjugate

a11 a12 a1n A11 A12 A1n


a a22 a2 n A A22
A cofactor A 21
21



an1 an 2 ann Ann
An1 An 2

Aij is the cofactor of aij

A11 A21 An1


A A22
adj A [cofactor A]T 12


A1n A2 n Ann
A11 A21 An1
A A22 An 2
12


A1n A2 n Ann

a11 a12 a1n DA 0 0 0


a a22 a2 n 0 DA 0 0
Aadj A 21 DAI
0 0 DA 0

an1 an 2 ann 0 0 0 DA

a11 A11 a12 A12 ...a1n A1n

Aadj A DAI
A A 1 I

A 1 1 / DA adj A
Example 1
det (A)= 2
1 2 A11= 0
A Find A-1
1 0
A12 = 1
A21= 2
A22 = 1

0 1 11 0 2
cofactorA= A
2 1 2 1 1
0 1
0.5 0.5

0 2 AA 1
adjA= 1 2 ? ?
1 1 ?
1 0
?
More on Matrices and Determinants
1. Multiplication of a matrix

A A A2
A A A A n

n times

The law of exponents also holds for non-singular matrices

A A A
m n m n
A n

A 1 n

A
m n
A mn A n A m A nm
Reversal Rule
Reversal rule for inverses of products of matrices

( AB) 1 B 1 A 1

proof A B A B I
1

A B A B B I B
1 1 1

A B A B
1 1

A B A A 1 B 1A 1
1
Products of Two Determinants
AB A B
a11 a12 0 0
a
a11 a12 b11 b12 a 0 0
A B P 21 22
21
a a 22 21 22
b b 1 0 b11 b12

0 1 b21 b 22

a22 0 0 a21 0 0
P a11 0 b11 b12 a12 1 b11 b12
1 b21 b22 0 b21 b22
b11 b12
(a11a22 a12a21 ) AB PAB
b21 b22
P AB

a11 a12 0 0 0 0 a11b11 a12b21 a11b12 a12b22


a21 a22 0 0 0 0 a21b11 a22b21 a21b12 a22b22
P
P
1 0 b11 b12 1 0 b11 b12
0 1 b21 b 22 0 1 b21 b 22

0 a11b11 a12b21 a11b12 a12b22


a11b11 a12b21 a11b12 a12b22
P 1 0 a21b11 a22b21 a21b12 a22b22
a21b11 a22b21 a21b12 a22b22
1 b21 b22

AB

You might also like