Sei sulla pagina 1di 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

define

1 2 1 4
3 4 2 6

1 3 2 1

column

3 rows and 4 columns

row
Matrix is 3 by 4
A34
a34 entry or element

Transpose
If A= aij then AT=aji

0
A 1
2

1 2 3
4 5 6

A T 0 1 2

1 4
2 5
3 6

Save space

Square Matrix
1 0 4
1 2 7

2 8 3

When the number of rows =


the number of columns

Principal or main diagonal


Symmetric matrix

Diagonal matrix

Identity matrix

5 1 6
1 3 0

6 0 2

5 0 0
0 3 0

0 0 2

1 0 0
0 1 0

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
AB C

cij aik bkj


k 1

Exterior dimensions determine the dimensions


of the results

A m r B r n C m n
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
AB

2 5

Note that

1 1 3

2 1 4
22

23

23

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

1 3
2 5

1 1 3 2 7

Reversal Rule
Reversal rule for inverses of transposes

( AB) B A
T

proof

A B

a b

k 1

ik

b
a
ki jk
n

k 1

kj

BT AT

a b

k 1

jk

ki

Intuitive Proof
1 1 3
2 1 4

1 3
2 5

1 2
3 5

1 1 3 2 7

1 2
1 1

3 4
transpose

Matrix Form of Linear Equations


For

If we define

then

a11 x1 + a12 x2 = b1
a21 x1 + a22 x2 = b2

a11
A
a21

a12

a22

x1
x
x2

b1
b
b2

a11 x1 a12 x2
Ax

a21 x1 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

a11
aug A
a21

a12
a22

b1

b2

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 x2 = 4
3 x1 + 8 x2 = 5
(1) 8 (2) 7 x1=3/5

(1)
(2)
eliminate x2

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

a11 x1 + a12 x2 = b1
a21 x1 + a22 x2 = b2
(3) a22 (4) a12 :
(4) a11 (3) a21 :

(3)
(4)

[a11a22 a12a21]x1 = b1a22 b2a12


[a11a22 a12a21]x2 = b2a11 b1a21

x1

b1a22 b2 a12
[ a11a22 a12 a21 ]

x2

b2 a11 b1a21
[a11a22 a12 a21 ]

If we define a 2 2 determinant as

m q

pq mn

single number

the solution can be written as


Therefore, for
a11 x1 + a12 x2 = b1
a21 x1 + a22 x2 = b2

b1 a12
b2 a22
b1a22 b2 a12
x1

[a11a22 a12 a21 ] a11 a12


a21 a22
a11

b1

a21 b2
b2 a11 b1a21
x2

[a11a22 a12 a21 ] a11 a12


a21 a22

General Solutions
a11 x1 + a12 x2+a1nxn = b1
a21 x1 + a22 x2+a2nxn = b2
.
.
.
an1 x1 + an2 x2+annxn = bn
a11

xj=Dj / D

a11
a
21
a31


an1

a12

a12
a22
a32

an 2

a1n
a2 n
a3n

ann

x1 b1
x b
2 2
x3 b3


xn bn

a1n

a21
D det A

a22 a2 n

an1

an 2 ann

Cramers rule

A x= b

Dj=?

Determinant
The determinant of an n n matrix

D det A

a11

a12

a21

a22 a2 n

an1

n! terms

a1n

an 2 ann

1
a1k a2k a3k

k1 , k 2 , k n

k1 k 2 k3 .... k n

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

ank n

How to calculate h?
For a 5 5 matrix, we have
a11

a12

a13

a14

a15

a21
D det A a31

a22
a32

a23
a33

a24
a34

a25
a35

a41
a51

a42
a52

a43
a53

a44
a54

a45
a55

15324
13524
13254
12354
12345

15324
12354
12345

The exchange of two numbers does


not have to be between two
consecutive numbers, but can be
between any pair of numbers

h=4

h=2

h is not unique, but it is always an


even number

Determinant of a 3 3 matrix
a11a22 a33
a11a23 a32

a11

a12

a21
a31

a22
a32

a12 a23 a31


a12 a21a33

a13 a21a32
a13 a22 a31

a13

a23 a11a22 a33 a12 a23 a31 a13 a21a32


a11a23 a32 a12 a21a33 a13a22 a31
a33

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
Solve

0
1
0
x1
1
0
4

1 1 1 x1
0 2 3 x

2
4 0 1 x3
1
2
0
1
2
0

1
3
1
1

1
6
3
1

1
0

1 0 1
0 1 3
4 0 1
1
x2

1 1 1
2
0 2 3
4 0 1

It is difficult for big matrices

1
0
4
x3
1
0
4

1
2
0
1
2
0

0
1
0 2

1 3
3
1

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

1 2
3 4

3 4
1 2

4 3
2 1

2 1
4 3

1 2
3 4

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


(c) If a determine is multiplied by a constant c, then one of
the columns (row) is multiplied by c.

1 2
3 4

2 2

3 6

6 4

3 9

1 2
1 3

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

a21
a31

a22
a32

a23 a21 b22


a33 a31 b32

a11

a12 b12

a13

a23 a21
a33 a31

a22 b22
a32 b32

a23
a33

a13

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


row (column), the determinant is unchanged
(1)3+ (2)

1 2
1 2 1 0

2
0 2 3 4 3 2
(1)2+ (2)

Examples
(1)

1 1 1
1
1

(2)

2
2

1 1 1

2 0
3
0

1
1

a
b
c ?
bc ac ab

1 1 1

1 0
2
0

1
0

1 1
1

Minors and Complementary Minors


Two minors can be formed by striking out equal number of entire rows and columns

a11
a21
a31

a12
a22
a32

a13
a23
a33

a11
a21
a31

a12
a22
a32

a13
a23
a33

a14
a24
a34

a15
a25
a35

a41
a51

a42
a52

a43
a53

a44
a54

a45
a55

Minors

a22

a11
a31

a13
a33

These two minors are called complementary


minors
Again, we have two complementary
minors
a21 a23 a25
a12 a14
a31 a33 a35
a42 a44
a51 a53 a 55

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

Algebraic complement of M = (1)

Algebraic
complement
of

a21
a31
a51

a23
a33
a53

l j k j
j 1

complement of M

a25
1 3 5 2 3 5 a12
a35 1
a42
a55

a14
a44

Cofactor
A special algebraic complement of a single element

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

1 6 2

A 0
1 4
8 3 7

Cofactor of -1 = (-1)1+1

1 4
3 7

Cofactor of 8 = (-1)

6 2
1 4

1+3

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

1 2 0

1 0 1

2 1
1 0

1131 2

1 0
3 1

113 23

1 1
0

2 1
3 1

11313

1 0

1 1 1 0

1 1

113 2 4

0 5
1 2

2 1
1 0

3 1
1 0

1131 4

1133 4

2 1
1

2
5

2 1

Cofactor Expansion
a11
a21
D det A a31
a41
a51
n

a12
a22
a32
a42
a52

det A a1 j A1 j
j 1

a13
a23
a33
a43
a53

a14
a24
a34
a44
a54

a15
a25
a35
a45
a55

A1 j is the cofactor of a1 j

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 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
1 2 0

5
1

1 0 1

0 0 1
1 2 0
1
1

0
1

1 2

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

Determinant of Upper/Lower
Triangular Matrix
a11 a12
0 a22
0
0

a13
a22
a23 a11
0
a33

a23
a11a22a33
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

A
then B is an inverse matrix of A

A x= b
A

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
A a21
a31

a12
a22
a32

a13
a23
a33

a12

a13

a21 a22
a31 a32

a23
a33

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

a33
a23
a33

a22

a23

a32

a33

E11

a11

E31

a
a31 22
a32

a12

a21 a23
a31 a33

a13

a21 a22
a31 a32

We find that

Eik

det A if
0
if

ik
ik

a11

Cofactor A and Adjugate


A

a11
a
21

a12
a22

a1n
a2 n

an1

an 2 ann

A11
A
cofactor A 21

An1

A12

A1n

A22

An 2 Ann

Aij is the cofactor of aij

adj A [cofactor A]T

A11
A
12

A1n

A21 An1
A22

A2 n Ann

A11
A
12

A adj A

an1

An1

A22 An 2

A1n

A2 n Ann

a11
a
21

A21

a1n
a22 a2 n




an 2 ann
a12

DA
0

0

0

DA
0

0
DA

a11 A11 a12 A12 ...a1n A1n

A adj A DAI
A A 1 I

A 1 1 / DA adj A

0
0
DAI

DA

Example 1
1 2
A

1
0

Find A-1

0 1
cofactorA=

2
1

0 2

adjA=
1 1

det (A)= 2
A11= 0
A12 = 1
A21= 2
A22 = 1

1 0 2
A
2 1 1
1

AA 1

0 1
0.5 0.5

1 2
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

m n

mn

mn

1 n

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 1 I B 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
A

a
a
22
21

a11 a12
a
a22
21

b11 b12
B

b
b
22
21

P a11 0

b11

b12 a12 1 b11

b12

a21

1 b21 b22
( a11a22 a12a21 )

0
0

1 0 b11 b12

1
b
b
21
22

a22

b11

0
b12

b21 b22

b21 b22

AB

PAB

P AB

a11

a12

a21

a22

b11

b12

1 b21 b 22
0

P 1 0
1
AB

a11b11 a12b21

a11b12 a12b22

a21b11 a22b21

a21b12 a22b22

b11

b12

b21

b 22

a11b11 a12b21

a11b12 a12b22

a21b11 a22b21

a21b12 a22b22

b21

b22

a11b11 a12b21

a11b12 a12b22

a21b11 a22b21

a21b12 a22b22

Potrebbero piacerti anche