Download presentation
Presentation is loading. Please wait.
Published byMargaret Richard Modified over 8 years ago
1
4: Sets of linear equations 4.1 Introduction In this course we will usually be dealing with n equations in n unknowns If we have just two unknowns x and y, then each equation is of the form y = mx + c i.e. Each equation represents a straight line Question: What possibilities can occur if we have two equations?
2
4.1.1 Possibility A: Unique solution If the two lines have different slopes, they cross at exactly one point. y = -x + 5 y = x – 7 E.g. y = x-7 and y = -x+5 x - 7 = -x + 5 2x = 12 x = 6 and y = -1 Find the unique solution by algebra:
3
4.1.1 Possibility A: Unique solution If the two lines have different slopes, they cross at exactly one point. y = -x + 5 y = x – 7 E.g. y = x-7 and y = -x+5 The matrix-vector system for these equations is: 1 11 x y = -7 5 -x + y = -7 x + y = 5 The determinant of the matrix is: 1 1 1 = (-1)(1) – (1)(1) = -2
4
4.1.1 Possibility B: Infinite Solutions Lines have same slope: then they may coincide. E.g. y = x-7 and 2y = 2x - 14 y = x – 7 Lines parallel, so any point on the line satisfies both equations Solution is: x = α and y = α -7 for any real number α. i.e. Infinite solutions
5
4.1.1 Possibility B: Infinite Solutions Determinant of matrix: -2 1 2 = (-1)(2) – (1)(-2) = 0 y = x – 7 Lines have same slope: then they may coincide. E.g. y = x-7 and 2y = 2x - 14 1 2-2 x y = -7 -14 -x + y = -7 -2x + 2y = -14 Matrix-vector system:
6
4.1.1 Possibility C: No Solutions Lines have same slope: but do not meet E.g. y = x-7 and y = x - 5 y = x – 7 No intersection, so no solutions. If there was a solution: x -5 = x – 7 5 = 7 Certainly not true!! y = x – 5
7
4.1.1 Possibility C: No Solutions Lines have same slope: but do not meet E.g. y = x-7 and y = x - 5 y = x – 7 y = x – 5 Determinant of matrix: 1 1 = (-1)(1) – (1)(-1) = 0 1 1 x y = -7 -5 -x + y = -7 -x + y = -5 Matrix-vector system:
8
4.2 General Sets of Equations For a general set of linear equations we have the same three possibilities: A.One unique solution; B.An infinite number of solutions; C.No solutions.
9
4.2.1 In 3 Dimensions In three dimensions an equation like 2x+4y-z =6 defines a plane. Three such equations give three planes The possibilities are: Unique Solution Infinite Solutions No solutions
10
4.3 Conditions for a unique solution We will write out set of linear equations in matrix-vector form: a 11 a 22 a nn a 12 a 21 a n1 a 1n a 2n a n2 x1x1 x2x2 xnxn b1b1 b2b2 bnbn = A x=bA x=b We know A and b, but want to find x
11
4.3 Conditions for a unique solution Whether A x = b has: a unique solution, infinite solutions, or no solutions depends on the determinant |A|. If |A|≠ 0, there is a unique solution to A x = b If |A| = 0, there may be no solutions, or there may be infinitely many solutions. What case are we interested in? It depends...
12
4.3.1 Homogeneous equations If b = 0, which means: b 1 = b 2 = b 3 = b 4 =... = b n = 0 Then the system A x = 0 is called homogeneous. There is a trivial solution to the problem: x = 0 This is not very interesting, so we look for an infinite set of solutions to A x = 0. Hence, we want |A| = 0.
13
4.3.2 Inhomogeneous equations If b ≠ 0 then the system A x = b is called inhomogeneous. In this case we want a unique solution i.e. want |A| = 0.
14
4.3.3 Example A system of simultaneous equations: x + y + z = 6[1] 2x + y – z = 1[2] x – y + 2z = 5[3] Inhomogeneous, so want to look for a unique solution. Write as a matrix-vector system: 1 2 1 1 1 1 2 x y z 6 1 5 =
15
4.3.3 Example 1 2 1 1 1 1 2 x y z 6 1 5 = Has a unique solution if determinant is non-zero: 1 2 1 1 1 1 2 = 1x - 1x + 1 x 1 2 2 1 2 21 1 = 1x1 - 1x5 + 1x(-3) = -7 Since determinant is non-zero there is a unique solution.
16
4.3.3 Example – how to solve the equations? x + y + z = 6[1] 2x + y – z = 1[2] x – y + 2z = 5[3] Add or subtract equations to eliminate variables [2] – 2 x [1]- y - 3z = -11[4] [3] – [1]-2y + z = -1[5] Now eliminate y to find z: [5] – 2 x [4] 7z = 21[6] z = 3 Substituting into [4] gives: -y -9 = -11 y = 2 Substituting into [1] gives: x + 2 + 3 = 6 x = 1 UNIQUE SOLUTION
17
4.3.3 Example – analyse the last approach: x + y + z = 6[1] 2x + y – z = 1[2] x – y + 2z = 5[3] Started with 3 equations, so at each stage 3 equations are enough to find the solution. After eliminating x: we got equations [1], [4] and [5]: x + y + z = 6[1] -y – 3z = -11[4] -2y + z = -1[5] After eliminating y: we got equations [1], [4] and [6]: x + y + z = 6[1] -y – 3z = -11[4] 7z = 21[6]
18
4.3.3 Example – Matrix approach: 1 2 1 1 1 1 2 x y z 6 1 5 = Remember: wrote equations as Made equation [4] by [2] – 2 x [1]. In matrix language: “Replace ROW 2 with ( ROW 2 – 2 x ROW 1)” 1 2 1 1 1 1 2 x y z 6 1 5 = r 2 r 2 - 2r 1 ROW 2
19
4.3.3 Example – Matrix approach: 1 2 1 1 1 1 2 x y z 6 1 5 = Remember: wrote equations as Made equation [4] by [2] – 2 x [1]. In matrix language: “Replace ROW 2 with ( ROW 2 – 2 x ROW 1)” 1 0 1 1 1 1 2 x y z 6 1 5 = r 2 r 2 - 2r 1 ROW 2
20
4.3.3 Example – Matrix approach: 1 2 1 1 1 1 2 x y z 6 1 5 = Remember: wrote equations as Made equation [4] by [2] – 2 x [1]. In matrix language: “Replace ROW 2 with ( ROW 2 – 2 x ROW 1)” 1 0 1 1 1 2 x y z 6 1 5 = r 2 r 2 - 2r 1 ROW 2
21
4.3.3 Example – Matrix approach: 1 2 1 1 1 1 2 x y z 6 1 5 = Remember: wrote equations as Made equation [4] by [2] – 2 x [1]. In matrix language: “Replace ROW 2 with ( ROW 2 – 2 x ROW 1)” 1 0 1 1 1 -3 2 x y z 6 1 5 = r 2 r 2 - 2r 1 ROW 2
22
4.3.3 Example – Matrix approach: 1 2 1 1 1 1 2 x y z 6 1 5 = Remember: wrote equations as Made equation [4] by [2] – 2 x [1]. In matrix language: “Replace ROW 2 with ( ROW 2 – 2 x ROW 1)” 1 0 1 1 1 -3 2 x y z 6 -11 5 = r 2 r 2 - 2r 1 ROW 2
23
4.3.3 Example – Matrix approach: 1 2 1 1 1 1 2 x y z 6 1 5 = Remember: wrote equations as Made equation [5] by [3] – [1]. In matrix language: “Replace ROW 3 with ( ROW 3 – ROW 1)” 1 0 1 1 1 -3 2 x y z 6 -11 5 = r 3 r 3 - r 1 ROW 3
24
4.3.3 Example – Matrix approach: 1 2 1 1 1 1 2 x y z 6 1 5 = Remember: wrote equations as Made equation [5] by [3] – [1]. In matrix language: “Replace ROW 3 with ( ROW 3 – ROW 1)” 1 0 0 1 1 -3 2 x y z 6 -11 5 = r 3 r 3 - r 1 ROW 3
25
4.3.3 Example – Matrix approach: 1 2 1 1 1 1 2 x y z 6 1 5 = Remember: wrote equations as Made equation [5] by [3] – [1]. In matrix language: “Replace ROW 3 with ( ROW 3 – ROW 1)” 1 0 0 1 1 -3 -2 2 x y z 6 -11 5 = r 3 r 3 - r 1 ROW 3
26
4.3.3 Example – Matrix approach: 1 2 1 1 1 1 2 x y z 6 1 5 = Remember: wrote equations as Made equation [5] by [3] – [1]. In matrix language: “Replace ROW 3 with ( ROW 3 – ROW 1)” 1 0 0 1 1 -3 -2 1 x y z 6 -11 5 = r 3 r 3 - r 1 ROW 3
27
4.3.3 Example – Matrix approach: 1 2 1 1 1 1 2 x y z 6 1 5 = Remember: wrote equations as Made equation [5] by [3] – [1]. In matrix language: “Replace ROW 3 with ( ROW 3 – ROW 1)” 1 0 0 1 1 -3 -2 1 x y z 6 -11 = r 3 r 3 - r 1 ROW 3
28
4.3.3 Example – Matrix approach: After two row operations we got to Second and third rows represent equations [4] and [5] 1 0 0 1 1 -3 -2 1 x y z 6 -11 = We made equation [6] by: [5] – 2 x [4]. In matrix language: “Replace ROW 3 with ( ROW 3 – 2 x ROW 2)” This is because ROW 3 represents [5] and ROW 2 represents [4].
29
1 0 0 1 1 -3 -2 1 x y z 6 -11 = r 3 r 3 - 2r 2 ROW 3 After two row operations we got to Second and third rows represent equations [4] and [5] 1 0 0 1 1 -3 -2 1 x y z 6 -11 = We made equation [6] by: [5] – 2 x [4]. In matrix language: 4.3.3 Example – Matrix approach:
30
1 0 0 1 1 -3 0 1 x y z 6 -11 = r 3 r 3 - 2r 2 ROW 3 After two row operations we got to Second and third rows represent equations [4] and [5] 1 0 0 1 1 -3 -2 1 x y z 6 -11 = We made equation [6] by: [5] – 2 x [4]. In matrix language: 4.3.3 Example – Matrix approach:
31
1 0 0 1 1 -3 0 7 x y z 6 -11 = r 3 r 3 - 2r 2 ROW 3 After two row operations we got to Second and third rows represent equations [4] and [5] 1 0 0 1 1 -3 -2 1 x y z 6 -11 = We made equation [6] by: [5] – 2 x [4]. In matrix language: 4.3.3 Example – Matrix approach:
32
1 0 0 1 1 -3 0 7 x y z 6 -11 21 = r 3 r 3 - 2r 2 ROW 3 After two row operations we got to Second and third rows represent equations [4] and [5] 1 0 0 1 1 -3 -2 1 x y z 6 -11 = We made equation [6] by: [5] – 2 x [4]. In matrix language: 4.3.3 Example – Matrix approach:
33
1 2 1 1 1 1 2 x y z 6 1 5 = So, we went from 4.3.3 Example – Matrix approach: To 1 0 1 1 1 -3 2 x y z 6 -11 5 = r 2 r 2 - 2r 1
34
1 2 1 1 1 1 2 x y z 6 1 5 = So, we went from 4.3.3 Example – Matrix approach: To r 2 r 2 - 2r 1 r 3 r 3 - r 1 1 0 0 1 1 -3 -2 1 x y z 6 -11 =
35
1 2 1 1 1 1 2 x y z 6 1 5 = So, we went from 4.3.3 Example – Matrix approach: To r 2 r 2 - 2r 1 r 3 r 3 - r 1 r 3 r 3 - 2r 2 1 0 0 1 1 -3 0 7 x y z 6 -11 21 = Now can solve from the bottom up as before.
36
4.4. Gaussian Elimination 1 2 1 1 1 1 2 x y z 6 1 5 = 1 0 0 1 1 -3 0 7 x y z 6 -11 21 = We just transformed: At each step we eliminated one variable from one equation i.e. created a zero in the matrix Repeated to get an upper triangular matrix Can make this a formal, automated process. It is called Gaussian Elimination
37
4.4. Standard Gaussian Elimination Permitted Row Operations: Swap two rows; Add a multiple of a row to another row; Subtract a multiple of a row from another row. r 2 r 2 - 2r 1 r 1 r 2 r 3 r 3 + 4r 1
38
Adding a constant to an equation: Dividing equations Reducing the number of equations: The following operations are not allowed: 4.4. Standard Gaussian Elimination r 1 r 1 +2 r 2 r 2 /r 1 r 2 r 2 – r 1 r 1 r 1 – r 2
39
After a number of row operations we get to a ‘final’ matrix. E.g. 4.4.1 Generalised Row Echelon Form 1 0 0 1 1 -3 0 7 However, other ‘final’ matrices may look like: 2 0 0 1 3 01 0 0 1 0 0 2 1 14 0 0 1 0 0 0 3 02 0 0 00 0 0 0 1 2 This is called the generalised row echelon form of the matrix
40
However, other ‘final’ matrices may look like: 2 0 0 1 3 01 0 0 1 0 0 2 1 14 0 0 1 0 0 0 3 02 0 0 00 0 0 0 1 2 The definition of the ‘final’ matrix is that it is in generalised row echelon form which is: 1.The first (furthest left) non-zero element of each row is to the right of the first non-zero element in the row above it. 2.Any all-zero rows are at the bottom. 4.4.1 Generalised Row Echelon Form
41
4.4.2 Augmented Matrix notation We perform row operations on the matrix and the row on the other side: 1 2 1 1 1 1 2 x y z 6 1 5 = Combine both of these into one matrix called the augmented matrix: 1 2 1 1 1 1 2 6 1 5
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.