22
BAI CM20144 Applications I: Mathematics for Applications Mark Wood [email protected] http:// www.cs.bath.ac.uk/~cspmaw

BAI CM20144 Applications I: Mathematics for Applications Mark Wood [email protected] cspmaw

Embed Size (px)

Citation preview

Page 1: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

CM20144

Applications I:

Mathematics for Applications

Mark Wood

[email protected]

http://www.cs.bath.ac.uk/~cspmaw

Page 2: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

• Determinants

Evaluation Methods

Properties

Examples

• Test 5

Today’s Tutorial

Page 3: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAIEvaluating Determinants 1

Page 4: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

• ‘Diagonals’ Method

Only works for 2 x 2 and 3 x 3

Multiply forward diagonal elements and add

Multiply backward diagonal elements and subtract

Evaluating Determinants 1

Page 5: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

• ‘Diagonals’ Method

Only works for 2 x 2 and 3 x 3

Multiply forward diagonal elements and add

Multiply backward diagonal elements and subtract

• Cofactor Method

Pick the row or column with the most zeros

Calculate the cofactor for each element and sum

Cofactor = sign x minor

Signs alternate

Minor = determinant of remaining matrix…

Evaluating Determinants 1

Page 6: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

• ‘Diagonals’ Method

Only works for 2 x 2 and 3 x 3

Multiply forward diagonal elements and add

Multiply backward diagonal elements and subtract

• Cofactor Method

Pick the row or column with the most zeros

Calculate the cofactor for each element and sum

Cofactor = sign x minor

Signs alternate

Minor = determinant of remaining matrix…

Recursive

Evaluating Determinants 1

Page 7: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

3 1 4

-7 -2 1

9 1 -1

Example: Diagonals

Page 8: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

3 1 4

-7 -2 1

9 1 -1

Example: Cofactors

Page 9: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAIProperties of Determinants

Page 10: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

• Singular Matrices

Determinant = 0 (otherwise nonsingular)

Row or column of zeros singular

Two rows proportional singular

Properties of Determinants

Page 11: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

• Singular Matrices

Determinant = 0 (otherwise nonsingular)

Row or column of zeros singular

Two rows proprtional singular

Invertible nonsingular

Properties of Determinants

Page 12: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

• Singular Matrices

Determinant = 0 (otherwise nonsingular)

Row or column of zeros singular

Two rows proprtional singular

Invertible nonsingular

• Other properties

Scalar multiple: |cA| = cn|A| (n = matrix dim)

Product: |AB| = |A||B|

Transpose: |At| = |A|

Inverse: |A-1| = 1/|A| (if A-1 exists)

Properties of Determinants

Page 13: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

A and B are 3 x 3 matrices

|A| = -3, |B| = 2

Calculate:

|AB|

|AAt|

|AtB|

|3A2B|

|2AB-1|

|(A2B-1)t|

Example: Properties of Determinants

Page 14: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAIEvaluating Determinants 2

Page 15: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

• Row Operations and Determinants

1) Multiply by c c|A|

2) Swap two rows -|A|

3) Add multiple of one row to another |A|

Evaluating Determinants 2

Page 16: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

• Row Operations and Determinants

1) Multiply by c c|A|

2) Swap two rows -|A|

3) Add multiple of one row to another |A|

Get zero columns / rows and use cofactors

Evaluating Determinants 2

Page 17: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

• Row Operations and Determinants

1) Multiply by c c|A|

2) Swap two rows -|A|

3) Add multiple of one row to another |A|

Get zero columns / rows and use cofactors

• Numerical Method

Use row ops to get matrix into upper triangular form

Only need 2) and 3)

Keep track of op 2)

Determinant is product of diagonal elements

Zero on diagonal & zeros below singular

Evaluating Determinants 2

Page 18: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

1 0 –2 1

2 1 0 2

-1 1 –2 1

3 1 –1 0

Example: Numerical Evaluation

Page 19: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

1 -1 0 2

-1 1 0 0

2 -2 0 1

3 1 5 -1

Example: Numerical Evaluation

Page 20: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAIOther Stuff?

Page 21: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

• A-1 = adj(A) / |A|

Adjoint is transpose of matrix of cofactors

Other Stuff?

Page 22: BAI CM20144 Applications I: Mathematics for Applications Mark Wood cspmaw@cs.bath.ac.uk cspmaw

BAI

• A-1 = adj(A) / |A|

Adjoint is transpose of matrix of cofactors

• System of Equations AX = B

Unique solution A nonsingular

Otherwise, could be many or no solutions

Cramer’s Rule: xi = |Ai| / |A|

Other Stuff?