* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download MAT1092
Survey
Document related concepts
System of polynomial equations wikipedia , lookup
Jordan normal form wikipedia , lookup
Non-negative matrix factorization wikipedia , lookup
Four-vector wikipedia , lookup
Linear algebra wikipedia , lookup
Singular-value decomposition wikipedia , lookup
Matrix (mathematics) wikipedia , lookup
History of algebra wikipedia , lookup
Orthogonal matrix wikipedia , lookup
Determinant wikipedia , lookup
Perron–Frobenius theorem wikipedia , lookup
Eigenvalues and eigenvectors wikipedia , lookup
Matrix calculus wikipedia , lookup
System of linear equations wikipedia , lookup
Transcript
MAT 1092 Mathematical Methods for ICT Dr Matthew Montebello CB 409 [email protected] CSA 3210 Agent Technology CSA 3210 Agent Technology Lecture Schedule 1. 2. 3. 4. 5. 6. 7. Introductions & Matrices Determinants Solution of Linear Equations Eigenvalues and Diagonalisation Ord. Diff. Eqns. of 1st Order Ord. Diff. Eqns. of 2nd Order + constant coeffs. Partial Diff. and Exact Diff. Eqns. MAT 1092 Mathematical Methods for ICT Useful details • Assessment – 100% exam • Exam type examples and exercises will be given during/at-the-end of each lecture/topic • Notes are online at: http://staff.um.edu.mt/mmon1/lectures/mat1092 • Past-papers are available online • Feel free and comfortable to: – Ask questions – Sort out queries right away • Best practice is to: – Work out examples and understand every step – Not to push back unclear issues MAT 1092 Mathematical Methods for ICT Books • A Course in Pure Mathematics, – Gow M., Arnold, 1960 • Elementary Linear Algebra, – Andvilli S. and Hecker D., Harcourt Acad. Press, 1999 • Advanced Mathematics, – Kreysig E., John Wiley & Sons, 8th edition, 1998 • Elementary Differential Equations, – Derrick W. and Grossman S., Addison-Wesley, 4th edition, 1997. MAT 1092 Mathematical Methods for ICT 1. Introduction a. b. c. d. Welcome – Introductions Run through the schedule Useful details & Books Preliminary stuff: – – – – – – What are Matrices? Determinants!!! In relation to matrices? Do you remember Linear Equations? Fancy an Eigenvector? What? Differential equations of the order of ??? What is the difference between partial and exact? MAT 1092 Mathematical Methods for ICT 1.1 What are Matrices? Wikipedia gives a good definition, namely: “a rectangular table of numbers” These rectangular shaped groups of numbers can be: • Added • Subtracted • Multiplied • Divided? So what is an: • Identity matrix • Inverse matrix MAT 1092 Mathematical Methods for ICT 1.2 Matrix Addition and Subtraction Matrix addition/subtraction is performed by adding/subtracting the individual entries with the identical row and column position of the two matrices. This means that the two matrices have to necessarily be of the same size in order to perform these operations. Hence, the sum/difference A+/-B of two n x m matrices results in an n x m matrix having Ai j + Bi j as its i-j entry. E.g. 1 2 -3 -1 6 3 0 8 0 4 0 2 + 8 12 14 = 12 12 16 5 8 0 2 1 0 7 9 0 1 2 -3 4 0 8 5 8 0 MAT 1092 - -1 6 3 8 12 4 = 2 1 0 Mathematical Methods for ICT 2 -4 -6 -4 -12 4 3 7 0 1.3 Matrix Multiplication Matrix multiplication is performed by multiplying each entry from every row of the first matrix with each entry of every column in the second matrix, and adding up the partial sums. This means that the width of the first matrix has to be equal to the height of the second matrix. If A is an n x h matrix and B is an h x m matrix then the product AB, is defined to be an n x m matrix with: (AB)i j = Ai1 B1j + Ai2 B2j + … + Ai h Bh j E.g. 1 6 3 4 1 2 . 8 2 4 5 -3 0 2 1 0 MAT 1092 16 28 16 = -19 24 3 Mathematical Methods for ICT 1.4 Matrix Multiples To work out the multiples of a matrix is simply multiplying each entry within the matrix with the multiple value. So, if the matrix A was to be multiplied by a value n, then the resultant matrix will have every entry multiplied by n. That is the i-j entry in matrix A will become n(i-j). E.g. 6 . 2 1 3 = 12 6 18 1 4 2 6 24 12 The identity matrix of a square matrix is 1 0 0 0 1 0 0 0 1 while the product of a matrix and its’ inverse is equal to the identity matrix. MAT 1092 Mathematical Methods for ICT 1.5 Matrices - Check Point If A = 0 4 5 work out: -1 0 -1 2 1 3 MAT 1092 B = -1 2 0 3 4 -2 0 1 0 a) A+B b) AxB c) 2A d) 3B e) 2A - 3B f) 2A x B g) A x A or A2 h) 5B3 Mathematical Methods for ICT 1.6 Inverse of a Matrix If A is the an (n x n) square andmatrices there is aif Work out inverse of the matrix following matrix B with the property that: A . B = I possible: 1 3 to be the inverse of A -2 and 3/2 is denoted A-1 B is defined -1 a. A = A = 2 4 1 0 AA1 I 1 1 4 -½ A1 A I 0 -1 If A has an inverse, it is called invertible. -1 -2 ½ ½ b. B = 1 2 0 B = Otherwise,3 it is called singular. -3 0 1 0 4 How do you work out the inverse of Matrix A? 1 0 0 1 0 0 i.c. Write down the matrix [A | I ] -1 C = 2 -1 0 C = 2 -1 0 ii. Row-reduce [A | I]. 1 1 1 -3 1 1 iii. If the reduced form is [I | B] Not -1 3 0 1 d. then D = A is invertibleDand= B = A-1 possible 2 -1 0 is else A is singular. singular 1 1 1 Some Inverse Matrix examples ... MAT 1092 Mathematical Methods for ICT 1.6 Inverse of a Matrix If A is an (n x n) square matrix and there is a matrix B with the property that: A . B = I B is defined to be the inverse of A and is denoted A-1 AA1 I If A has an inverse, it is called invertible. Otherwise, it is called singular. How do you work out the inverse of Matrix A? i. Write down the matrix [A | I ] ii. Row-reduce [A | I]. iii. If the reduced form is [I | B] then A is invertible and B = A-1 else A is singular. Some Inverse Matrix examples ... MAT 1092 Mathematical Methods for ICT 1.7 What is a Determinant? Determinants are mathematical objectsmatrices that are very Work out the inverse of the following if useful in the analysis and solution of linear possible: equations. 1 3 = det(A) = 0, the matrix is said to Ifa. theAdeterminant of a matrix is 2 4 be singular, and if the determinant is 1, the matrix is 0 1 said to be1 unimodular. b. B = 1 2 0 of a Matrix det(B)A=is defined to be: The determinant a A= c. C c= a d d. D g= 3 0 4 1 0 0 2 -1 0 b d b1 c 1 det(A) = |A| = ad – bc det(C) = 1 e e f det(A) a det 3 0 1 h h i 2 -1 0 d f b det det(D) i= g d e f c det i g h 1 1 1 Work out determinants of previous matrices ... MAT 1092 Mathematical Methods for ICT 1.8 Linear Equations Also referred to as Straight Line graphs, linear equations are of the form: 40 30 20 y = mx +c 10 Where m is known as the gradient or slope, and c is known as the intercept 0 -10 -20 The standard form is ax + by = c -30 e.g. Solve y = 18 – 4x and y = 9x + 5 1 18+ y = 5 or 4x + y = 18 4 -9x 1 R1/4 -9 MAT 1092 1 ¼ 4½ -9 5 1 ¼ 4½ 0 3¼ 45 ½ 4 0 4 0 1 14 1 5 R2+9R1 4R1-R2 1 ¼ 4½ 0 1 14 x = 1 1 0 1 0 1 14 R2/3¼ R1/4 Mathematical Methods for ICT y = 14 1.9 Eigenvalues & Eigenvectors AThe vector may be thought X, of for as an arrow. set of eigenvectors, A is defined as those •vectors It has awhich, length,when called its magnitude value) multiplied by A, (scalar result in a •simple It points in some direction. scaling λ ofparticular X. So bascially λ is a constant. A linear transformation may be considered to operate This = λ.X (λ.I).X changing both its on ameans vectorthat: to A.X change it, =usually magnitude and its direction. (A – λI) X = 0 An Eigenvector of a given linear transformation is a is multiplied constant called we the Invector orderwhich for this equation by to ahave solutions Eigenvalue during det(A that − λI), transformation. The require the determinant to be zero. direction of the eigenvector is either unchanged by that det transformation = det 1-λeigenvalues) =0 3 1 (for 0 1 3 positive or - λ 4 2-λ reversed4 (for 0 eigenvalues). 1 2 negative Eigenspace corresponding to a given eigenvalue of a transformation is2-12 the =vector space linear (1-λ)(2-λ)-12 = 2-3λ+λ λ2-3λ–10 = 0of all eigenvectors with that eigenvalue (λ – 5) (λ + 2) = 0 1 3 Consider the square matrix A= 1 3 4 2 4 2 λ = 5 and λ = -2 The Eigenvalues of A MAT 1092 Mathematical Methods for ICT 1.10 Differential Equations Differential equations are simply equations involving an unknown factor, like x, and its derivatives. What is an unknown factor and its derivatives? If it is a function of x: y = f(x) = 3x2 + 4x Then its differentiation is y’ = f’(x) = 6x + 4 So a function like: f’(x) + 7x – 3 is a Differential Eq. But what is the exact meaning of Differentiation? The derivative provides the measure of the slope (gradient) of a function - The gradient of a function f(x) = y is found by y/x • Rewritten in terms of the above equation, slope = f(x) /x MAT 1092 Mathematical Methods for ICT 1.11 Differential Rules 3). What •e.g.Constant If f(x) = k, then f’(x) = 0. supposeRule: y = ln(x is dy/dx? 3x2, what e.g. Suppose f(x) = e2x is What f’(x)?is f’(x)? / (x-2). e.g. Suppose f(x) = 3. What is f’(x)? Try out n, then f’(x) = cnxn-1 2 •Try Power Rule. If f(x) = cx out out:notorious a)25x derivatives: / 5x Some a) Suppose Whatisisf’(x)? f’(x)? e.g. Supposef(x) f(x)==ln(x). 3x2, what If y =b)7e6 /what is dy/dx? x Rule: • a) Sum-Difference If f(x) = g(x) ± h(x) 2 b) Suppose f(x) = log(3x + x ). What is f’(x)? Trythen out f’(x) the following: 2 3+2lnx 3 –e g’(x) h’(x) b) If f(x)c)==(16x 5x +±12x) /22x 4 ln(x3) ln xRule: then dy/dx 1/x c)y =Suppose y =If3x.ln(5x +=2x) • a)IfProduct f(x) = g(x).h(x) 3 10x out: Try f’(x)=g’(x).h(x)+g(x).h’(x) Ifthen y = sin x then dy/dx = cos x • b) Quotient If f(x)=g(x)/h(x) a)6xf(x) = Rule: 17 – 4x 2 3 2 then f’(x)=[g’(x).h(x)-g(x).h’(x)] / [h(x)] If y = cos x then dy/dx = -sin x f(x)2 = (4x )(5-x ). What is f’(x)? c) b)e.g. 2xy2 +Suppose 1 3 = 12x – 4x + 5x – 7 2 e.g. Suppose f(x) = 2x / (x-2). What is f’(x)? Try out: 2x If y = tan x then dy/dx = sec • Log If 6x f(x) = ln( g(x) ) c) yRule: = 3x2 – 4 + a) y f’(x) = 6x(2x – 5) / g(x) then = g’(x) x If y = ex then dy/dx = e b) f(x) = (12x3 – 4x2 +Rule: 5x – If 7)(3x • Exponential-Function f(x) –=7) eg(x)t g(x) then f’(x) = g’(x).e c) f(x) = (17 – 4x)(5) MAT 1092 Mathematical Methods for ICT 1.12 Partial & Exact Diff. Equations All these differentiations of y = f(x) produced: y’ = dy/dx This is called Differential Equation of 1st. Order What happens if you workout the derivative of a 1st.order differential equation? You produce a 2nd. Order differential equation. A first-order differential equation is called exact, or an exact differential, if it is the result of a simple diff. If the unknown function depends on more than 1 variable, then it is called a partial differential MAT 1092 Mathematical Methods for ICT 1.13 Closure - Lecture 1 In this lecture: • Course details • Schedule • Books – WWW • Basic issues: – – – – – – – Matrices +, -, *, /, inverse Determinants & row reduction Linear Equations Eigenvalues & eigenvectors Differential equations – rules 1st order, 2nd order Partial and Exact differential equations All this will be expanded in the following sessions. MAT 1092 Mathematical Methods for ICT 2. Matrices a. b. c. d. e. f. g. h. i. Introduction Multiplication Gaussian Row Reduction technique Cramer’s Rule Inverse – invertible / singular Diagonizable Transpose Matrix Rank Closure MAT 1092 Mathematical Methods for ICT 2.1 Matrices Introduction Before proceeding we need to ensure that the following operations are understood: a. Addition b. Subtraction c. Multiples d. Multiplication e. Inverse – Row Reduction f. Determinant MAT 1092 Mathematical Methods for ICT 2.2 Some Exercises (past-papers) a. Feb 07 i. No.1 – first part ii. No.3 (a) iii. No.3 (b) (i) b. Jan 05 i. No.1 (a) ii. No.2 – first part iii. No.3 – first part c. Jan 06 i. No.1 – first part ii. No.2 – first part iii. No.3 (b) – first part MAT 1092 Mathematical Methods for ICT 2.3 Gaussian Row Reduction A sequence of elementary row operations is then applied to this matrix so as to transform it to row echelon form. The elementary operations are: • Row Scaling: Multiply a row by a scalar ≠ 0; • Row Exchange: Exchanges two rows; • Row Replacement: Add multiple of row to another; Such operations are referred to as multiplication with Elementary Matrices, E, that have the same effect. 1 0 0 0 0 1 1 0 0 0 m 0 0 1 0 0 1 0 0 0 1 1 0 0 m 0 1 MAT 1092 Mathematical Methods for ICT 2.4 Cramer’s Rule • Look at the following system of equations: z ==33 2x 2 2x+ +1y 1 y ++ 11z D= 11xx–-1 -1==0 0 Ans Col= –1y y – z1z 1x 1 x ++ 2y 22y ++ 11z z ==00 To find x To find y To find z 3 1 1 2 3 1 2 1 3 0 -1 -1 1 0 -1 1 -1 0 0 2 1 1 0 1 1 2 0 Dx Dy Dz Cramer's Rule says that: x = Dx ÷ D y = Dy ÷ D z = Dz ÷ D. x = 3/3 = 1 y = –6/3 = –2 z = 9/3 = 3 E.g. See Feb 07 no.3(b)(ii) & Jan 05 no.2(b) Previous Example MAT 1092 Mathematical Methods for ICT 2.5 Inverse of a Matrix Recall that the inverse of A and is denoted A-1 where A.A-1 = I (identity matrix or 1) We have seen in Slide 1.6 how to determine the inverse of a matrix. The reason we work out the inverse of a matrix is mainly to solve a system of linear equations. You can write a system in matrix form as AX = B. Now, pre-multiply both sides by the inverse of A. A-1.A.X = A-1.B X = A-1.B e.g.1 2x + y + z = 3 x–y–z=0 x + 2y + z = 0 MAT 1092 e.g.2 3x + 2y - 5z = 12 x - 3y + 2z = -13 5x - y + 4z = 10 Mathematical Methods for ICT 2.6 Is a Matrix Diagonalizable? A square matrix A is called diagonalizable if it is similar to a diagonal matrix. i.e. if there exists an invertible matrix P such that: P−1AP is a diagonal matrix, D where the eigenvalues of A are the entries of D and P is an invertible matrix consisting of the eigenvectors corresponding to the eigenvalues in P itself. The main Diagonal Line of a square matrix is: a 0 0 0 b 0 0 0 c MAT 1092 Mathematical Methods for ICT 2.7 Transpose of a Matrix The transpose of a matrix is the matrix formed by “flipping” about the diagonal line from the upper left corner. It is usually denoted as At If A = a b c Then At = d e a d b e c f MAT 1092 f Mathematical Methods for ICT 2.8 Rank of a Matrix The rank of a Matrix is equal to the number of linearly independent rows or columns of the matrix. Check for dependencies between the rows and columns by: • Visually inspecting them • Working out the determinant ≠ 0 The maximum number of rows or column is the value given to the rank. e.g.1. Feb 07 no.2(a)i-iii. e.g.2. Jan 06 no.3(a) MAT 1092 Mathematical Methods for ICT 2.9 Closure – Lecture 2 a. b. c. d. e. f. g. h. i. Introduction Multiplication Gaussian Row Reduction technique Inverse – invertible / singular Diagonizable Transpose Rank Closure Tutorial – extra self-inflicted work MAT 1092 Mathematical Methods for ICT 2.10 Extra Exercises Typical Exam Question: • If A is the matrix formed from the lefthand side of the equations: • While B is the matrix formed 2x – y + 3z = 13 2y – 4x – z = -5 from their answers. Determine: 3z – 2y = 6 a. A.B b. At c. A-1 d. Bt e. Bt.A-1 f. |A| g. The values of x, y, and z. i. Using A-1 ii. Employing Cramer’s Rule MAT 1092 Mathematical Methods for ICT 2.11 Solution to Previous Question 2x 3z3z = 1313 22x -–y1y -1+ + 3= -4x++2y 1z= =-5-5 -5 A= B= -4 22y––z-1 -4x 2y++3z3z 00x––2y -2 3 ==66 0x 1/5 find -3/20 z-1/4 2 find -4 0y (c)A-1= To To find49x (b)At= To (a)A.B= -½ 2 -2 3 13 -1-68 1 2 -1 13 2 3/5 -13/10 13 2/5 1/5 0 -5 2 28 -1 -4 3 -1 -5 3 -1 -4 2 -5 -2 6 -3/4 13 -5 3 6 (e) B0t.A-1=6 2 -9/4 3 (d)6Bt= -2 (f)0|A|=20 Dx Dy Dz Cramer's Rule says that: x = Dx ÷ D y = Dy ÷ D z = Dz ÷ D. x = 37/20 y = 66/20 = 33/10 z = 84/20 = 21/5 MAT 1092 Mathematical Methods for ICT 3. Determinants 1. Introduction 2. Working out the determinant 3. Used to determine i. Invertible matrices ii. Linear equations iii. Eigenvalues 4. Determinant effect on row reduction 5. Worked examples 6. Closure MAT 1092 Mathematical Methods for ICT 3.1 Determinants Introduction The determinant is defined as the value associated with every square matrix that has particular significant properties to that same matrix, like: – Switching two rows or columns changes the sign. – Scalars can be factored out from rows and columns. – Multiples of rows and columns can be added together without changing the determinant's value. – Scalar multiplication of a row by a constant multiplies the determinant by . – A determinant with a row or column of zeros has value 0. – Any determinant with two rows or columns equal has value 0. MAT 1092 Mathematical Methods for ICT 3.2 Determinant Value How do you work out the determinant? The determinant of a Matrix A is defined to be: A= A= a b c d a b c d e f g h i det(A) = |A| = ad – bc e f d f d e det(A) a det b det c det h i g i g h det(A) = a(ei – fh) – b(di – fg) + c(dh – ge) MAT 1092 Mathematical Methods for ICT 3.3 Determinant Uses • If the determinant of a matrix is equal to zero THEN the inverse does not exist; • The determinant of a matrix is extensively employed in Cramer’s rule to work out the solutions of linear equations; • It is also employed to workout the eigenvalues of a matrix. In fact the product of the eigenvalues is equal to the determinant of the matrix. MAT 1092 Mathematical Methods for ICT 3.4 Determinant Effect Consider the matrix A = 6 12 15 B= 3 -2 0 4 C= 0 -5 2 4 5 3 -2 0 R2 R3 4 0 R3 + R1 3R1 -5 2 4 5 2 4 5 4 0 -5 D= 3 -2 0 3 -2 0 6 4 0 Notice the determinants of all the matrices: |A| = 120 |B| = 360 |C| = -120 |D| = 120 and appreciate that: • Row scaling multiplies determinant by scalar • Row exchange negates the determinant • Row replacement keeps the same determinant MAT 1092 Mathematical Methods for ICT 3.5 Determinant Examples Work out the determinants of the following matrices Some more example to work from Past Papers: if possible: • Feb 07 1 3 a. A = det(A) = • no. 3(a) 2 4 • no. 3(b) (i) & (ii) •b.JanB05 = • no.3 1 0 1 1 2 0 3 0 4 • Jan 06 1 0 0 nd rd c. • no.2 C =(2 & 3 part) 2 -1 0 1 1 1 3 0 1 2 -1 0 1 1 • no.3 (2nd part) d. D = det(B) = det(C) = det(D) = 1 MAT 1092 Mathematical Methods for ICT 3.5 Closure – Lecture 3 1. Importance of determinant of a matrix; 2. How to find out the determinant; 3. Can be used to: i. Work out inverse of a matrix; ii. Solve linear equations; iii. Work out eigenvalues & eigenvectors. 4. Interesting effects on determinant when Elementary Matrices are multiplied; 5. Tutorial – much expected extra work. MAT 1092 Mathematical Methods for ICT 3.6 Extra Exercises 10 Question: 0 01 Typical Exam Let the 0 matrix 1 -2 0A = 0.5 01 and E1A= 0 2 0 0 8 -4 -8 3 4 1 2 10 1 10 E2A= 0 2 3 2 0 0 5 1 0 1 3 4 0 0 4 E3A= 1 3 4 10 2 0 2 0 0 Determine: a. E1, E2, E3 (what kind of elementary matrices?) b. Det(A) c. Det(E3A) d. If E2A = A + B find B e. If F = 3A and det(F) = k.det(A) find k MAT 1092 Mathematical Methods for ICT 4. Solutions of Linear Equations 1. Introduction 2. Solving linear equations i. Using Gaussian row reduction ii. Using inverse of matrix iii. Using Cramer’s rule 3. Possible solutions i. Unique ii. Infinite iii. None 4. Worked examples 5. Closure MAT 1092 Mathematical Methods for ICT 4.1 Introduction to Solving Equations After employing some method to form equations with the unknown variables, possible answers have to be figured out. The determinant and inverse of the matrix are only used to assist in the solution of the linear equations. Possible scenarios: – Full-valued matrix – Variables within matrix MAT 1092 Mathematical Methods for ICT 4.2 Solutions using Gaussian System Reducing the rows to Echleon form will give an insight into the values of the unknown variables. e.g. Jan 05 no.3 (last part) 3 1 0 0 -2 If A = 52 31 40 solve Ax = 11 R3-5R1 R2-3R3 1 0 0 3 2 3 4 -2 5 1 0 11 1 0 0 3 2 3 4 -2 0 1 0 -4 R2-2R1 1 0 0 3 0 3 4 -8 0 1 0 -4 1 0 0 3 0 0 4 4 0 1 0 -4 R2/4 1 0 0 3 0 0 1 1 0 1 0 -4 x=3 y = -4 z=1 MAT 1092 Mathematical Methods for ICT 4.3 Solutions using the Inverse Matrix Employing the inverse of the matrix is an effective way to solve the linear equations but slightly more lengthy. e.g. Jan 05 no.3 (last part) 1 0 0 3 -2 If A = 52 31 40 solve Ax = 11 1 0 0 1. Work out inverse of A ... i.e. A-1 3¼-5 ¼0 -¾ 1 2. Apply the1reasoning 0 0multiply 1 0 0 0 0 1 0 0of Ax = 1y & 2 3 4 0 1 0 2 3 4 -10 1 0 both sides5by1 A0 0 0 1 0 1 0 -5 0 1 -1y A-1Ax = A 1 0 0 1 0 0 1 0 0 1 0 0 0 0 4 13 1 -3 0 -13 4 -2 1 0 x=A 0 1 0 -5 0 1 0 1y 0 -5 0 1 1 0 0 3 -2 x = 13¼-50 ¼0 -¾ . 11 0 11 0 3 0 0 1 13/4 ¼ -3/4 x=3 0 1 -4 0 1 0 -5 y = -4 1 z=1 R2-2R1 R3-5R1 R2-3R3 MAT 1092 Mathematical Methods for ICT R2/4 4.4 Solutions using Cramer’s rule By far the simplest and straight forward system to work out the solutions of linear equations is to employ Cramer’s rule based on the Determinant of a number of matrices. 1. Separate the two matrices: the linear equation’s values and answer column; 2. Form additional matrices by inserting the answer column matrix instead of the unknown variable; 3. Work out the determinants of the new matrices as well as the original matrix; 4. Divide determinants of each variable matrix with that of the original matrix. What if Original Matrix has a determinant = 0 MAT 1092 Mathematical Methods for ICT 4.5 Possible Solutions - Unique Anyway you decide to solve the linear equations ... the ideal situation is when a unique solution is available. This means that: i. Gaussian system – The identity matrix is obtained on the linear equation’s side; ii. Inverse matrix system – The inverse matrix exists and is available to multiply on both sides; iii. Cramer’s rule – The determinant of the main matrix is not equal to zero. MAT 1092 Mathematical Methods for ICT 4.6 Possible Solutions - Infinite The possibility of having an infinite number of solutions happens when: i. Gaussian system – The identity matrix cannot be achieved on the main linear equations matrix; ii. Inverse matrix system – The inverse matrix is not possible to find; iii. Cramer’s rule – The determinant of the main matrix is equal to zero. MAT 1092 Mathematical Methods for ICT 4.7 Possible Solutions - None The situation when no solutions are available for the linear equations occurs when: i. Gaussian system – Inconsistencies are evident in the extended matrix, like 0 = 1; ii. Inverse matrix system – Even if identity matrix is obtained ... And inconsistencies are evident even in this case; iii. Cramer’s rule – The determinant of the main matrix is equal to zero. MAT 1092 Mathematical Methods for ICT 4.8 Worked Examples Such problems are very popular examination problems as they bring out reasoning skills in students. Try out from past-papers: • January 2005 no.1(a) • January 2006 no.1 (first part) • February 2007 no.2(b) MAT 1092 Mathematical Methods for ICT 4.9 Closure - Lecture 4 1. Linear equations can be solved by Matrices 2. Solving linear equations by employing: i. Gaussian Row Reduction ii. Inverse of a Matrix iii. Cramer’s Rule 3. Possible solutions i. Unique ii. Infinite iii. None 4. Worked examples from Past-Papers 5. The undeniable tutorial MAT 1092 Mathematical Methods for ICT 4.10 Extra Exercises Typical Exam Question a 0 b If A = 0a aa 42 and y = a 0 b 2 - R1 afind a 4 the 4 R2values 0 a 2 b of a and b for which the system has: i. A unique solution; 0 bInfinitely 2 If b ≠many 2 then z =solutions; 1 and if a ≠ 0 then x = (2 – b)/a and y = (b – 2)/a ii. a 4-b 2 unique solution 0 b-2 b-2 iii. No solutions. a 0 b 2 0 a 4-b 2 0 a 2 b a 0 0 2 4 b R3 – R2 If b = 2 and a = 0 then 0 0 2 2 0 0 2 2 0 0 0 0 Finally if a = 0 and b ≠ 2 then meaning we have the same lines. multiple solutions 0 0 b 2 0 0 4-b 2 = 0 0 b-2 b-2 0 0 b 2 0 0 4 4 0 0 1 1 = 0 0 0 1 0 0 4 4 0 0 1 1 no solution MAT 1092 Mathematical Methods for ICT 5. Eigenvalues & Diagonalisation 1. 2. 3. 4. 5. 6. Introduction Finding the Eigenvalue Working out the Eigenvectors Determining if a matrix is Diagonalizable Worked Examples Closure MAT 1092 Mathematical Methods for ICT 5.1 Eigen introduction The Eigenvalue of a matrix is A vector may be thought of as an arrow. • It has a length, called its magnitude (scalar value) • It points in some particular direction. A linear transformation may be considered to operate on a vector to change it, usually changing both its magnitude and its direction. An Eigenvector of a given linear transformation is a vector which is multiplied by a constant called the Eigenvalue during that transformation. The direction of the eigenvector is either unchanged by that transformation (for positive eigenvalues) or reversed (for negative eigenvalues). Eigenspace corresponding to a given eigenvalue of a linear transformation is the vector space of all eigenvectors with that eigenvalue MAT 1092 Mathematical Methods for ICT 5.2 What are the Eigenvalues? Given have a matrix Find thewe eigenvalues of: A, and this is transformed when multiplied by 0vectors X ... A.X 2 2 3 1 1 5 1 0 i.When this happens,ii.we2 get0 a-2simple scaling iii. 1 3 1 1 λ 5 0 -2 2 4 1 3= λ.X 0 0 6 1 A.X 2, 2,=5(λ.I).X = 0, 2, 2 = 4, 4, 6 =A.X = 3, 3, 6 = 4,=6,0 6 A.X – (λ.I).X 4 1 1 6 1 0 (A – λI) iv. X0 = 06 0 v. 1 4 1 Solutions for 0this0 4are found 1by 1 working out the 4 determinant of (A-λ.I) and equal to 0 e.g. A = 1 3 so (A-λ.I) = 1 3 -λ. 1 0 = 1- 3 4 2 4 2 0 1 4 det(A-λI) = (1- )(2- ) – (4)(3) = 0 (1-λ)(2-λ)-12 = 2-3λ+λ2-12 = λ2-3λ–10 = 0 (λ – 5) (λ + 2) = 0 λ = 5 and λ = -2 are the Eigenvalues of A MAT 1092 Mathematical Methods for ICT 2- 5.3 Find the Eigenvectors To determine the Eigenvectors of a Matrix, A, having found out its Eigenvalues is simple. For every Eigenvalue a respective Eigenvector will be determined, so recalling from previous 3 slide that if A = 14 32 then (A-λ.I) = 1- 4 2- If det(A-λI) = 0 gives Eigenvalues λ = 5 and λ = -2 If the Eigenvector associated with λ = 5 is Then (A-λ.I) . = 0 1- 3 4 2- . = 0 where λ = 5 x1 x2 x1 x2 x1 x2 -4 4 3 -3 . x1 x2 =0 -4x1 + 3x2 = 0 or 4x1 - 3x2 = 0 or 4x1 = 3x2 If x1 = a then x2 = 4a/3 Hence Eigenvector = or a MAT 1092 x1 a 1 x2 4a/3 4/3 Mathematical Methods for ICT 5.4 How to determine if a Matrix is diagonalizable? A matrix A is diagonalizable if there is an invertible matrix S such that S-1AS is a diagonal matrix. It seems like every matrix should be diagonalizable ... All you need to do is: i. ii. • • Find the eigenvalues & eigenvectors – construct S by making the columns of S the eigenvectors of A Then ensure that S-1AS is possible But what if S is not invertible? 1 0 ... 0 What if its not possible to construct S? ... 0 Also note that if D = S-1AS = 0 So, note that a matrix is diagonalizable iff:... 0 0 -1 = A • It has aThen set ofSDS linearly independent eigenvectors • AIf2 it= has distinct eigenvalues So, S-1DS . S-1DS = S-1D2S 2 n Also note that: n = S-1Dn S Hence, A • Every symmetric matrix is diagonalizable • A matrix is symmetric if it is equal to its transpose MAT 1092 Mathematical Methods for ICT 5.6 Past-Papers Questions Eigenvalues & Eigenvectors, due to their importance, feature in every exam paper, namely: • Jan 05 – no.2 (second part) • Jan 06 – no.1 (last part) – no.3(b) Check out the matrices: A= 2 1 1 2 • Feb 07 – no.1 – no.2(a)(iv) MAT 1092 B= 7/4 3/4 0 3/4 5/4 0 0 1 Mathematical Methods for ICT 0 5.7 Closure – Lecture 5 1. 2. 3. 4. 5. 6. Introduced Eigenvalues & Eigenvectors How to find Eigenvalues Work out the Eigenvectors Matrix Diagonalization explained Worked Examples – past-papers Typical exam question MAT 1092 Mathematical Methods for ICT a) Find Eigenvalues where 1.5 0 1 0 0 -0.5 0.5 -0.5 0 0 -0.5 0 0 0 0 5.8 Tutorial Stuff – Typical 1.5 0- 0 1 1 x1 When = 0.5Exam then 1Question =0 Meaning Det-0.5 of -0.50 and 0.5 -0.5 - -0.5 x2 = 0 Find the that Eigenvalues Eigenvectors -0.5 -0.5 0 0 -0.5 x1 + x3 = 0 meaning that if x1 = a 1.5 0 1 =0 of -x3 then x3 = -a and x2 = b a a 0 0 )) = 0 1 (1.5 )(0.5 )(-) – 0 + 1(0 – (-0.5)(0.5 Associated Eigenvector is or + =a +b x2 b 0 0 1 b (1.5 - )(0.5 )(-) – 0 + 1(0 – (-0.5)(0.5 )) = 0 -0.5 0.5 x-0.5 -a -1 -a 0 0 3 (0.5 - )[(1.5 - )(-) + 1( – (-0.5))] = 0 x1 2= 1 When = 1-then 0 + 0.5) = 0 -0.5 0.5+02 + 00.5) 0 = (0.5 (0.5 )(-1.5 - )( -1.5 -0.5 (0.5 - )( - 1)( - 0.5)-0.5 = 0 -0.5 x2 x3 -0.5 0 -1 itdiagonalizable? = 0.5 OR = 1 OR = 0.5 → eigenvalues Is 0.5x1 + x3 = 0 and x1 + x2 + x3 = 0 meaning that if x1 = a then x3 = -0.5a and x2 = -0.5a b) Find Eigenvectors for these Eigenvalues Associated Eigenvector x1 is a or a 1 Meaning that for each Eigenvalue we x2 -0.5aapply: -0.5 1.5 - x1 x3 0 -0.5a 1 . -0.5S-1 and 0.5D. - -0.5 c) Now we can find S, 1 0 1 -0.5 MAT 1092 0 x1 x2 0 - 1 -½x3 -1 0 -½ -0.5 =0 -1 0 -2 1 1 1 2 0 2 Mathematical Methods for ICT ½ 0 0 0 ½ 0 0 0 1 6. Ordinary Diff. Eqns. Of 1st. Order 1. 2. 3. 4. Introduction Differentiation & Integration Points of reference – general rules First order differential equations a. Separable b. Exact c. Integrating Factor 5. Exam Questions 6. Closure 7. Practice examples. MAT 1092 Mathematical Methods for ICT 6.1 Introduction Two type of differential equations will be covered: 1. First-order – Simple ones – Slightly more complicated one 2. Second-order (Lecture 7) Still ... the basic concepts have to be known and understood right away. MAT 1092 Mathematical Methods for ICT 6.2 Differentiation & Integration They are the inverse of each other...with a slight twist. Differentiation of a function gives the measure of a slope thereby finding its derivatives. Integration reverses this process and gives the function once you know the derivatives. E.g. y = f(x) = 3x2 + 4x + 2 Then its differentiation is dy/dx = y’ = f ’(x) = 6x + 4 If we had to integrate 6x + 4 we should get y back. y’ dx = dy/dx dx = 1dy = y (6x + 4) dx = 6x2/2 + 4x/1 + c (constant) 3x2 + 4x + c This is simple and easy ... Slightly more complicated derivatives and their corresponding integrals follow. MAT 1092 Mathematical Methods for ICT 6.3 Differential Rules 3). What •e.g.Constant If f(x) = k, then f’(x) = 0. supposeRule: y = ln(x is dy/dx? 3x2, what e.g. Suppose f(x) = e2x is What f’(x)?is f’(x)? / (x-2). e.g. Suppose f(x) = 3. What is f’(x)? Try out n, then f’(x) = cnxn-1 2 •Try Power Rule. If f(x) = cx out out:notorious a)25x derivatives: / 5x Some a) Suppose Whatisisf’(x)? f’(x)? e.g. Supposef(x) f(x)==ln(x). 3x2, what If y =b)7e6 /what is dy/dx? x Rule: • a) Sum-Difference If f(x) = g(x) ± h(x) 2 b) Suppose f(x) = log(3x + x ). What is f’(x)? Trythen out f’(x) the following: 2 3+2lnx 3 –e g’(x) h’(x) b) If f(x)c)==(16x 5x +±12x) /22x 4 ln(x3) ln xRule: then = dy/dx = 1/x c)y =Suppose y =If 3x.ln(5x +y’2x) • a)IfProduct f(x) = g(x).h(x) 3 10x out: Try f’(x)=g’(x).h(x)+g(x).h’(x) Ifthen y = sin x then y’ = dy/dx = cos x • b) Quotient If f(x)=g(x)/h(x) a)6xf(x) = Rule: 17 – 4x 2 3 2 then f’(x)=[g’(x).h(x)-g(x).h’(x)] / [h(x)] If y = cos x then y’ = dy/dx = -sin x e.g. Suppose f(x) = (4x )(5-x ). What is f’(x)? 2 c) b)2xy += 112x3 – 4x2 + 5x2 – 7 e.g. Suppose f(x) = 2x / (x-2). What is f’(x)? Try out: 2x If y = tan x then y’ = dy/dx = sec • Log If 6x f(x) = ln( g(x) ) c) yRule: = 3x2 – 4 + a) y f’(x) = 6x(2x – 5) / g(x) then = g’(x) x If y = ex then y’ = dy/dx = e b) f(x) = (12x3 – 4x2 +Rule: 5x – If 7)(3x • Exponential-Function f(x) –=7) eg(x) g(x) then f’(x) = g’(x).e c) f(x) = (17 – 4x)(5) MAT 1092 Mathematical Methods for ICT 6.4 Separable FODEs Simplest of all where the differential equation can independently be separated. function of x function of y A(x) dx + B(y) dy = 0 A(x).dx + B(y).dy = c e.g. Solve the following FODEs i. x.dx – y2.dy = 0 ii. y’ = y2x3 iii. dy/dx = (x2 + 2) / y MAT 1092 What if y = 2 when x = 0 Mathematical Methods for ICT 6.5 Exact FODEs If a FODE is not separable then it needs to be sorted in some other way. Consider 2xy.dx + (1 + x2).dy = 0 In this case we have two functions both of which are of x and y ... A(x,y) & B(x,y) All we need to do is to find a function to group them together g(x,y) such that: dg(x,y) = A(x,y).dx + B(x,y).dy i. Check if function is exact dA/dy = dB/dx If function is not exact ... what happens? ii. Choose to work out dA/dy or dB/dx ii. Either use y=xt or multiply by Integrating Factor iii. Find gasbybefore integration and equate to other derivative iii.Solve e.g. Determine if exact and solve the following FODE i. 2xy.dx + (1 + x2).dy = 0 ii. (x + sin y).dx + (x.cos y – 2y).dy = 0 iii. y’= (2y4 + x4) / xy3 MAT 1092 Mathematical Methods for ICT 6.6 Integrating Factor When the equation is not exact or separable then we multiply it throughout with a factor to simplify it Integrating Factor. Consider the equation A(x,y).dx + B(x,y).dy = 0 The Integrating factor, I = e J(x).dx or I = e J(y).dy iff: J(x) = (dA/dy - dB/dx) / B or J(y) = (dB/dx - dA/dy) / A Multiplying all the terms by I will produce an exact differential equation. I.A(x,y).dx + I.B(x,y).dy = 0 e.g. Consider y’ + (3xy + y2)/(x2 + xy) = 0 (3xy + y2).dx + (x2 + xy).dy = 0 dB/ = 2x + y dA/dy = 3x + 2y and dx (dA/dy-dB/dx)/B=1/x & (dB/dx-dA/dy)/A=-(x+y)/(3xy+y2) Cont ... MAT 1092 Mathematical Methods for ICT 6.7 Typical Questions • Jan 05 Section B Sample questions: no.1 1. –Solve: –a) no.3(b) y’ = y2x3 = (x2 + 2)/y • b) Jandy/dx 06 Section B y’ = (a) 5y & (b) –c) no.4 y’ = (x + 1)/(y4 + 1) –d) no.6(b) 2 + 9).dt e) dy = 2t(y • Feb 07 Section B f) g) h) i) j) y’ = (y + x)/x y’ = 2xy/(x2 - y2) y’ = (x2 - y2)/xy y’=y2/[xy+(xy2)1/3] y’ = y/ x2 – no.1(a) 2. Find the Integrating factor for: – no.2(a) a) y’ + 4y/x = x4 – no.3(c) b) y’ – 2xy = x c) z’ - 2z/x = 2x4/3 3. Solve the FODEs in 2. MAT 1092 Mathematical Methods for ICT 6.8 Closure – Lecture 6 1. 2. 3. 4. 5. Introduced Differentiation & Integration Rules and important derivatives/integrals Solved separable differentials Identified exact differential forms Explained and worked out the Integrating factor 6. Typical exam questions MAT 1092 Mathematical Methods for ICT 6.9 Practice Stuff Typical Exam Question a) Solve the differential equation y’ = x2 + y2 xy b) Show that the differential form is not exact y’ + 6xy = 0 c) Find the integrating factor for the equation in b) and work out the integral MAT 1092 Mathematical Methods for ICT 7. Ordinary Diff. Eqns. Of 2nd. Order with Constant Coefficients 1. Introduction – characteristic equation 2. Solution to SODEs – 3 cases – First case – Second case – Third case 3. Typical Questions 4. Closure – Lecture 7 5. Practice examples MAT 1092 Mathematical Methods for ICT 7.1 Introduction to SODEs A Second Order Differential Equation (SODE) is an equation that has the application of Differentiation twice within it. e.g. If y = 5x4 + 2x3 - 7x2 + 4x – 12 D = dy/dx = y’ = 20x3 + 6x2 - 14x + 4 (FODE) 2 2=d (y’) d dy dy D /dx = /dx( /dx)= /dx2= y”= 60x2+12x–14 (SODE) So a SODE will be of the form: y’’+3y’ - 4y = 0 Thereby we replace the derivative of y by powers of the differential operator, D. Characteristic Equation: D2 + 3D - 4 = 0 This equation can then be factorised ... D2 + 3D - 4 = (D + 4) (D - 1) = 0 D = -4 OR D =1 meaning y’ = -4 OR y’ = 1 MAT 1092 Mathematical Methods for ICT 7.2 Solution to SODE The solutions of differential equations involving Second Order Differential Equations are not straight forward and depends entirely on the roots of the factorised Characteristic Equation. Case 1: If the roots are real; Case 2: If the roots are complex; Case 3: If the roots are real and equal to each other. MAT 1092 Mathematical Methods for ICT 7.3 Solving SODEs – First Case If the roots of the Characteristic Equation are real and distinct, then the solutions are eD1x and eD2x where D1 and D2 are the roots. e.g. y’’+3y’ - 4y = 0 D2 + 3D - 4 = 0 (D + 4) (D – 1) = 0 D = -4 or D = 1 Roots are real and distinct Solutions for y = c1e-4x + c2e1x y = c1e-4x + c2ex MAT 1092 Mathematical Methods for ICT 7.4 Solving SODEs – Second Case If the roots of the Characteristic Equation are complex, then the solutions are e(a+ib)x and e(a-ib)x where (a+ib) and (a-ib) are the roots. e.g. y’’+ 4y = 0 D2 + 4 = 0 (D + 2i) (D – 2i) = 0 D = -2i or D = 2i Roots are complex with a = 0 and b = 2 Solutions for y = c1e-2ix + c2e2ix OR also y = c1e0xcos2x+ c2e0xsin2x y = c1cos2x+ c2sin2x MAT 1092 Mathematical Methods for ICT 7.5 Solving SODEs – Third Case If the roots of the Characteristic Equation are real and equal, then the solutions are eD1x and xeD1x where D1 is the root. e.g. y’’- 8y’ + 16y = 0 D2 – 8D + 16 = 0 (D - 4) (D – 4) = 0 D = 4 or D = 4 Roots are real and equal Solutions for y = c1e4x + c2xe4x MAT 1092 Mathematical Methods for ICT 7.6 Typical SODE Questions Solve 1. y” – y’ – 2y = 0 2. y” – 7y’ = 0 3. y” – 5y = 0 4. y” – 6y’ + 25y = 0 5. d2y/dx2 + 4dy/dx + 5y = 0 MAT 1092 Mathematical Methods for ICT 7.7 Closure – Lecture 7 1. SODE are equations involving not only derivatives but also derivatives of derivatives. 2. Solution to SODEs – 3 cases – Real & Distinct roots – Complex roots – Equal roots MAT 1092 Mathematical Methods for ICT 7.8 Practical SODE Examples Let D denote the operator of differentiation, compute the following SODE: 1. y” – y = 0 2. d2x/dt2 – 10dx/dt + 25x = 0 3. y” + y’ + 1/4 y = 0 MAT 1092 Mathematical Methods for ICT 8. Partial Differential Equations and Exact Differential Equations 1. 2. 3. 4. 5. 6. 7. 8. Introduction – undetermined coefficients Case 1 – nth degree polynomial Case 2 – ex Case 3 – sin and cos Definition of Partial DE Definition of Exact DE Closure Final problems to solve MAT 1092 Mathematical Methods for ICT 8.1 Introduction The solutions to the SODE given in the previous section all equated to zero. What if the SODE equated to something different from zero, like: Case 1: SODE = f(x) Case 2: SODE = kenx Case 3: SODE = k1sin nx + k2cos nx where k and n are all constants MAT 1092 Mathematical Methods for ICT 8.2 Special SODEs – First Case If the SODE = f(x) then a solution is of the form Anxn + An-1xn-1 + An-2xn-2 + ... + A1x + A0 where A is a constant If y”-y’-2y = 0 e.g. y”- y’ - 2y = 4x2 Solution: y = A2x2 + A1x + A0 y = c e-x + c e2x 1 2 y’ = 2A2x + A1 and y” = 2A2 Substituting into original equation: 2A2 – (2A2x + A1) – 2(A2x2 +A1x +A0) = 4x2 (-2A2)x2+(-2A2-2A1)x+(2A2–A1–2A0)=4x2+(0)x+0 Equating coefficients of powers of x: -2A2 = 4 and -2A2-2A1 = 0 and 2A2–A1–2A0 = 0 A2 = -2 and A1 = 2 and A0 = -3 y = c1e-x + c2e2x - 2x2 + 2x - 3 MAT 1092 Mathematical Methods for ICT 8.3 Special SODEs – Second Case If the SODE = kenx then a solution is of the form Aenx where A and n are constants e.g. y”- y’ - 2y = e3x If y”-y’-2y = 0 Solution: y = Ae3x y’ = 3Ae3x and y” = 9Ae3x y = c1e-x + c2e2x Substituting into original equation: 9Ae3x - 3Ae3x - 2Ae3x = e3x 4Ae3x = e3x 4A = 1 or A = ¼ y = c1e-x + c2e2x + ¼ e3x MAT 1092 Mathematical Methods for ICT 8.4 Special SODEs – Third Case If the SODE = k1sin nx + k2cos nx then a solution is of the form A sin nx + B cos nx where A and n are constants e.g. y”- y’ - 2y = sin 2x If y”-y’-2y = 0 Solution: y = Asin2x + Bcos2x y = c1e-x + c2e2x y’ = 2Acos2x – 2Bsin2x y” = -4Asin2x – 4Bcos2x Substituting into original equation: (-4Asin2x-4Bcos2x)-(2Acos2x-2Bsin2x)-2(Asin2x+Bcos2x)=sin2x (-6A+2B)sin2x + (-6B-2A)cos2x = (1)sin2x + (0)cos2x Equating coefficients of like terms: -6A + 2B = 1 and -2A – 6B = 0 A = -3/20 and B = 1/20 y = c1e-x + c2e2x – 3/20sin2x + 1/20cos2x MAT 1092 Mathematical Methods for ICT 8.5 Final DE definitions A differential equation is an ordinary differential equation if the unknown function depends on ONLY 1 independent variable. If the unknown function depends on 2 or MORE independent variables, the differential equation is a partial differential equation. Finally, those differential equations which out of their nature are solved without any manipulation are called exact differential equations. MAT 1092 Mathematical Methods for ICT 8.6 Closure – Lecture 8 1. SODE that do not equate to zero have been investigated and solution has been given in the case it equates to: – A function of the unknown variable – An exponential of the unknown variable – A combination of Sin & Cos of the unknown variable 2. Final definitions of DE were given, namely: – Ordinary – Partial – Exact MAT 1092 Mathematical Methods for ICT 8.7 Practical Solve: 1. y” – 6y’ + 25y = 2sin(t/2) – cos(t/2) 2. d2y/dx2 – 4dy/dx + 4y = 4e2x 3. y” – 2y’ + y = x3 + 2x 4. d2y/dx2 + 16y = sin 4x MAT 1092 Mathematical Methods for ICT 9. Closure 1. 2. 3. 4. 5. 6. Introduction Matrices Determinants Solution of linear equations Eigenvalues and diagonalisation Ordinary Differential equations of the first order 7. Ordinary differential equations of the second order with constant coefficients 8. Partial differential and exact differential equations. 9. Closure MAT 1092 Mathematical Methods for ICT Past Papers 1. 2. 3. 4. 5. 6. Introduction Matrices Determinants Solution of linear equations Eigenvalues and diagonalisation Ordinary Differential equations of the first order 7. Ordinary differential equations of the second order with constant coefficients 8. Partial differential and exact differential equations. 9. Closure MAT 1092 Mathematical Methods for ICT