mm2 linear algebra 2011 i 1x2
Post on 07-Apr-2018
221 Views
Preview:
TRANSCRIPT
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
1/33
Mathematics
Part 1: Review of Matrices & Elements of Linear Algebra
Part 2: Multivariable Calculus
Review of Matrix Algebra
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
2/33
What is a Matrix?
A matrix is a rectangular array of numbers.
A =
1 2 09 1 2
1 3 4
; M = 1 2 5 7
4 1 0 8
; v =
13
26
Order of a matrixA matrix has order n m if it has n rows and m columns.
Vectors
DefinitionA (1 m) matrix is called as a row vector
v = 1 3 2 6 A (m 1) matrix is called as a column vector
v =
13
26
By default, when we talk about a vector we mean a column vector.
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
3/33
Matrices
The elements of a matrix A are often written aij where
i is the row number of the element
j is the column number of the element
Example
A = 1 2 09 1 21 3 4
= a11 a12 a13a21 a22 a23a31 a32 a33
Matrices
A general m n matrix will often be written
A =
a11 a12
a1n
a21 a22 a2n...
.... . .
...am1 am2 amn
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
4/33
Notations
Square or round brackets. Different notations... same meaning.
A =
1 2 09 1 21 3 4
A = 1 2 09 1 21 3 4
Recallthe following notation has a different meaning (determinant):
det(A) =
1 2 09 1 21 3 4
Matrices
An obvious fact: Two matrices are said to be equal if they havethe same order and all their elements are equal.
A =
1 2 09 1 2
1 3 4
; B =
1 2 09 1 2
1 5 4
; C =
1 2 0 19 1 2 3
1 3 4 6
A = B and A = C.
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
5/33
Types of Matrices
An upper triangular matrix has the form
a11 a12 a1n0 a22 a2n
... ... . . . ...0 0 ann
An lower triangular matrix has the form
b11 0 0b21 b22 0
......
. . ....
bn1 bn2 bnn
An diagonal matrix has the form
d11 0
0
0 d22 0...
.... . .
...0 0 dnn
Matrix addition and subtraction
Two matrices may be added or subtracted if they have the sameorder.
2 11 0
1 3
+1 0
2 13 1
=
3 13 12 4
1 3 6 11 1 2 1
1 1 1 11 1 1 1
=
0 2 5 0
2 0 1 0
2 11 0
1 3
+
1 3 6 1
1 1 2 1
not defined
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
6/33
Matrix addition and subtraction
Matrices are commutative and associative under addition:
A + B = B + A; A + (B + C) = (A + B) + C
A zero matrix is any matrix with all elements equal to zero,and isusually written 0:
0 00 00 0
;
0 0 00 0 00 0 0
A + 0 = 0 + A = A
Matrix Multiplication
It is straightforward to multiply matrices by a number k:
k1 2 0
9 1 21 3 4
= k 2k 0
9k k 2kk 3k 4k
Multiplying two matrices together is more complicated.
1 2 00 1 21 3 4
1 0 11 1 32 0 2
=?
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
7/33
Matrix Multiplication
We define the product of a row vector and a column vector asbeing the sum of the products of their components. e.g:
1 2 0
112
= 1 1 + 2 1 + 0 2 = 1
To multiply two matrices we multiply the rows of the first one by
the columns of the second one.
Matrix Multiplication
1 2 00 1 2
1 3 4
1 0 11 1 3
2 0 2
=
1
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
8/33
Matrix Multiplication
1 2 00 1 2
1 3 4
1 0 11 1 3
2 0 2
=
1 2
Matrix Multiplication
1 2 00 1 2
1 3 4
1 0 11 1 3
2 0 2
=
1 2 5
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
9/33
Matrix Multiplication
1 2 00 1 2
1 3 4
1 0 11 1 3
2 0 2
=
1 2 55
and so forth. . .
Matrix Multiplication
1 2 00 1 2
1 3 4
1 0 11 1 3
2 0 2
=
1 2 55 1 7
12 3 18
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
10/33
Rule for matrix multiplication:
The number of columns of the first matrix
must equal the number of rows of the
second.
Matrix Multiplication
When you multiply 2 matrices the order matters
Matrix multiplication is associative
A(BC) = (AB)C
but is non-commutative, i.e., in general
AB = BA
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
11/33
Matrix Multiplication
Because in general AB = BA, we must always specify on whichside we are doing the matrix multiplication:
X =
2 01 1
A =
1 03 1
Multiplying X on the left by A:
AX =
1 03 1
2 01 1
=
2 05 1
Multiplying X on the right by A:
XA =
2 01 1
1 03 1
=
2 04 1
Matrix Multiplication
Matrix multiplication has some other strange properties:
AB = 0 does not necessarily mean that A = 0 or B = 01 10 0
2 0
2 0
=
0 00 0
AD = AC does not necessarily mean that D = C
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
12/33
Matrix Multiplication
The product of two matrices is a matrix whose elements can bewritten in a compact form as:
[AB]ij =Nk=1
aikbkj
where N is the number of columns of A and the number of rows
of B.
Identity Matrix
The identity matrix I is the matrix with the property
AI = IA = A
I =
1 00 1
for 2 2 matrices
I =
1 0 00 1 0
0 0 1
for 3 3 matrices
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
13/33
Inverse of a Matrix
The inverse of a square matrix A is written A1 and has theproperty
A1A = AA1 = I
A matrix only has one inverse
This means that if it exists, the inverse of a matrix is unique.
Inverse of a Matrix
Inverse of a 2 2 matrix.
if A =
a bc d
, A1 =
1
ad bc
d b
c a
Remarks:
ad bc is the determinant of the matrix.
The inverse is defined only if det(A) = ad bc = 0.
If det(A) = 0, A is said to be a singular matrix.
For larger square matrices there is a more general way tocompute inverses. Well see that shortly.
The sum of the diagonal elements of A is called the trace ofA: tr(A) = a + d.
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
14/33
Transpose of a Matrix
The transpose of a matrix is obtained by interchanging the rowsand the columns:
If A =
1 3 6 1
1 1 2 1
, AT =
1 13 16 21 1
If A and B have the same order
(A + B)T
= AT
+ BT
(AT)T = A
(AB)T = BTAT
Matrix Algebra
Using the rules for addition, subtraction, multiplication andinverses, as well as the special matrices I and 0, we can re-arrangematrix equations.
Example
Given
A =
1 02 1
; B =
1 22 1
; C =
0 00 1
Rearange the equation
A + 2BX = C
to find X.
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
15/33
Matrix Algebra
Formally we have
A + 2BX = C
2BX = C A
BX =1
2(C A)
X =1
2B1(C A) (multiply on the left)
B =1 2
2 1
B1
=1
1 4 1 2
2 1
= 1
5 1 2
2 1
C A =
1 02 0
X =
1
10
1 2
2 1
1 02 0
=
1
10
3 04 0
Matrix Algebra
Example
Given
B =
1 11 1
; C =
4 20 1
Rearange the equation
X+ XB = C
to find X.
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
16/33
Matrix Algebra
X+ XB = C
X(I+ B) = C
X = C(I + B)1 (not (I + B)1C)
I + B =
2 11 2
(I + B)1 =1
3 2 1
1 2 X =
1
3
4 20 1
2 1
1 2
=
1
3
6 01 2
Linear Systems
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
17/33
Linear system of equations
A system of equations is a set of mathematical statementscontaining several unknown quantities.
If unknowns can be found so that all the statements aresatisfied then we say that the system has a solution.
There are three possibilities when trying to find the solution:
1 There is too little information to find the unknowns.
2
There is too much information to find the unknowns.3 There is exactly the right amount of information.
Linear system of equations
Example
From the two statements
1
There are twice as many sheep as people in Australia.2 There are 20 million more sheep than people in Australia.
we can construct the system of equationss = 2p
s = p + 20 p = 20, s = 40 (in millions)
Unique solution
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
18/33
Linear system of equations
Example
From the two statements
1 There are 20 million more sheep than people in Australia
2 There is the same number of sheep as people in Australia
we can construct the system of equations
s = p + 20s = p
No solution The two statements are inconsistent
Linear system of equations Graphical interpretation
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
19/33
Linear system of equations
An equation for several unknowns x1, x2 . . . xn is linear if it can beput in the form
a1x1 + a2x2 + + anxn = b
where the coefficients a1 . . . an and b are constants.A set of linear equations is known as a linear system.
Linear system of equations
A linear system of m equations in n unknowns is a set of equationsof the form
a11x1 + a12x2 + + a1nxn = b1
a21x1 + a22x2 +
+ a2nxn = b2...
am1x1 + am2x2 + + amnxn = bm
A solution is a set of numbers (x1, x2, . . . , xn) that satisfiesall m equations.
This set of numbers can be gathered into a vector.
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
20/33
Linear system of equations
The augmented matrix associated with the system is
a11 a12 a1n b1a21 a22 a2n b2
......
. . ....
am1 am2 amn bm
A system with zeros below the main diagonal is said to be in
row-echelon form.A system in row-echelon form can be solved easily byback-substitution.
Linear system of equations
Example
1 2 1 110 3 1 250 0 2 70
x1 + 2x2 + x3 = 11
3x2 + x3 = 252x3 = 70
From the third row we get: 2x3 = 70 x3 = 35
From row 2 we get: 3x2 + x3 = 25 x2 =10
3Finally we get: x1 + 2x2 + x3 = 11
x1 + 203
+ 35 = 11 x1 = 923
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
21/33
Row-echelon form
A matrix is in row echelon form ifAll rows that contain only zeros are grouped at the bottom ofthe matrix.
In any two consecutive non-zero rows, the leftmost non-zeroentry in the lower row occurs farther to the right than theleftmost nonzero entry in the upper row.
We call a row (column) nonzero if it contains at least one nonzero
entry.
Row-echelon form
A matrix in row-echelon form has a staircase pattern like thefollowing matrix:
0 0 0 0 0 0 0 0 0 0 0 0
where the greek letters correspond to non-zero values and the starsmay or may not be zero.
For the augmented matrix in row echelon form, each leftmostnonzero entry corresponds to a basic variable.
For instance, for the matrix above the basic variables are x1,x2 and x5.
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
22/33
Row-echelon form
The row-echelon form can give us some important informationabout a system. If a system is consistent (i.e., if it has a solution)
if all variables are basic variables the solution is unique.
if there is at least one non-basic variable there are infinitelymany solutions.
Row-echelon formThe number of solutions (unique, none, infinitely many) can befound by looking at the augmented matrix in row-echelon form:
a11 a12 a1n b1a21 a22 a2n b2
......
. . ....
0 0
amn bm
unique solution if a11, a22, . . . , amn = 0
a11 a12 a1n b1a21 a22 a2n b2
......
. . ....
0 0 0 bm
no solution if bm = 0
a11 a12 a1n b1a21 a22 a2n b2
.
.....
.. .
.
..0 0 0 0
infinitely many solutions
The number of non-zero rows in row-echelon form is the rank of the
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
23/33
Gauss elimination method for solving a linear system of
equations
Any system of equations is left unchanged by:1 Multiplying a row by a non-zero scalar.
2 Adding or subtracting two rows.
3 Swapping any two rows.
These are known as row operations.
In Gauss Elimination, we use row-operations to change the
system to row-echelon form.We can then solve the system by back-substitution.
Gauss elimination
Use Gauss elimination to solve the system
x1 + x2 + 2x3 = 23x1 x2 + x3 = 6
x1 + 3x2 + 4x3 = 4
The augmented matrix is 1 1 2 23 1 1 6
1 3 4 4
We need to use row operations to put the augmented matrix inrow-echelon form.
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
24/33
Gauss elimination
1 1 2 23 1 1 6
1 3 4 4
Example of a linear system: Balancing a chemical reaction
Consider the following chemical reaction:
C2H6 + O2 CO2 + H2O
Balancing the reaction means finding positive integers n1, n2, n3,and n4 such that
n1C2H6 + n2O2 n3CO2 + n4H2O
has the same number of atoms of each element on each side of theequation.
We can cast the problem as a linear system.
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
25/33
Example of a linear system: Balancing a chemical reaction
n1C2H6 + n2O2 n3CO2 + n4H2O
Inverse of a Matrix
We saw how to find the inverse of a 2 2 matrix.
If we can find the inverse of a n n matrix we could solve ageneral system
AX = b X = A1b
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
26/33
Inverse of a 3 3 Matrix. Method 1: row operations
1 Write the LHS of the system in matrix form.
1 2 21 2 13 2 1
2 Augment the matrix with the identity matrix.
1 2 2 1 0 01 2 1 0 1 0
3 2 1 0 0 1
3 Use row operations to transform the left half into the identity.The right half will then be the inverse.
Inverse of a 3 3 Matrix. Method 1: row operations
Example
Solve
x1 2x2 + 2x3 = 1
x1 2x2 + x3 = 1
3x1 2x2 + x3 = 1
by computing the inverse of the matrix associated with the linearsystem.
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
27/33
Inverse of a 3 3 Matrix. Method 1: row operations
The augmented matrix is
1 2 2 1 0 01 2 1 0 1 03 2 1 0 0 1
R1 R1 2R3R3 R1 R2
5 2 0 1 0 21 2 1 0 1 00 0 1 1 1 0
R2 R2 R3
5 2 0 1 0 21 2 0 1 2 0
0 0 1 1 1 0
R1 R1 + R2R2 5R2 +R1
4 0 0 0 2 20 8 0 4 10 2
0 0 1 1 1 0
R1 R1/4R2 R2/8
1 0 0 0 1/2 1/20 1 0 1/2 5/4 1/4
0 0 1 1 1 0
Inverse of a 3 3 Matrix. Method 1: row operations
Therefore the inverse is
0 1/2 1/21/2
5/4 1/41 1 0
and the solution of the system is
x1x2x3
=
0 1/2 1/21/2 5/4 1/4
1 1 0
11
1
=
01/2
0
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
28/33
Cramers rule for solving a linear system
Given the system
a11 a12a21 a22
x1x2
=
b1b2
the solution can be expressed in terms of determinants:
x1 =
b1 a12b2 a22
a11 a12a21 a22
; x2 =
a11 b1a21 b2
a11 a12a21 a22
Of course this requires that the determinant of the system isnon-zero.
Cramers rule for solving a linear system
Cramers rule works for higher order systems:
a11 a12 a13a21 a22 a23
a31 a32 a33
x1x2
x3
=
b1b2
b3
x1 =
b1 a12 a13b2 a22 a23b3 a32 a33
a11 a12 a13a21 a22 a23a31 a32 a33
; x2 =
a11 b1 a13a21 b2 a23a31 b3 a33
a11 a12 a13a21 a22 a23a31 a32 a33
; x3 =
a11 a12 b1a21 a22 b2a31 a32 b3
a11 a12 a13a21 a22 a23a31 a32 a33
But how do we compute a general determinant?
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
29/33
Determinant
There are two (main) methods for calculating the determinant of an n matrix:
1 Cofactor expansion.
2 Row operations.
Determinant Cofactor expansion
Steps to expand using cofactors with respect to a given row:
1 Multiply each coefficients of this row by (1)i+j where i is itsrow number and j its column number.
2 Multiply each coefficients of this row with the determinant of
the minor matrix i.e., the matrix obtained by deleting thecoefficients row and column.a11 a12 a13a21 a22 a23a31 a32 a33
= a11a22 a23a32 a33
a12a21 a23a31 a33
+ a13a21 a22a31 a32
The cofactors are the signed determinants of the small matrices.You can perform the cofactor expansion with respect to any row orcolumn.
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
30/33
Determinant Cofactor expansion
Calculate the determinant of
1 2 21 2 1
3 2 1
Inverse of a 3 3 Matrix. Method 2: Cofactors
1 Calculate the determinant of the matrix det(A).
2 If det(A) = 0 the inverse is given by
A1 =1
det(A)CT
where C is the matrix of the cofactors of A.
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
31/33
Determinant Row operations
Interchanging of two rows multiplies the determinant by -1.
Adding a multiple of one row to another leaves thedeterminant unchanged.
Multiplying an entire row by a number k multiplies thedeterminant by k.
These rules also hold for column operations.
Determinant Useful tips
Things to look for before trying to calculate a determinant
If any row or column contains only zeros then the determinantis zero.
If any two rows or columns are identical then the determinantis zero.
If any two rows or columns are multiples of each other thenthe determinant is zero.
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
32/33
Determinant Special case
To find the determinant of a matrix in row-echelon form, multiplydown the diagonal
1 2 30 5 20 0 1
= 1 5 1 = 5
General properties of determinant
det(A + B) = det(A)+det(B).
det(AB) = det(A)det(B).
det(A)det(A1)=1.A has an inverse if and only if det(A) = 0.
Steps to evaluate determinants using row reduction:
1 Reduce the determinant to row-echelon form (keeping track ofrow-swaps and multiplication by numbers).
2 Multiply the coefficients along the diagonal.
-
8/4/2019 MM2 Linear Algebra 2011 I 1x2
33/33
Linear Systems Summary
We have seen 3 methods to solve a linear system
1 Gauss elimination.
2 Using the inverse matrix.
3 Cramers rule.
top related