Matakuliah Tahun : S0262-Analisis Numerik : 2010 Linear Equation System Pertemuan 4 Material Outline • Linear equation system – Gauss Elimination – Gauss-Jordan Elimination • Linear Equations The following equation is the general form of linear equation: a1 x1 a2 x2 an xn b where: a1, a2,…, an, and b are constants and x1, x2,…, xn are variables which also called as the unknowns. • Linear Systems A linear system is a finite set of linear equations in the variables x1, x2,…, xn . A sequence s1, s2,… sn is a solution to linear system if x1= s1 , x2= s2 … xn =sn is a solution to every equation in the system. 28-Jun-16 DR. Paston Sidauruk 4 • System of Linear Equations (Linear system) Note: Every linear system has either no infinitely many solutions Examples: 4 x1 x2 3 x3 1 solution, exactly one solution, or A linear system with infinite many solutions, i.e, x1=1, x2=2, and x3=-1 3 x1 x2 9 x3 4 x1 x2 3 A linear system with exactly one x1 x2 1 x1 x2 4 x1 x2 3 solution that is: x1=2, and x2=1 A linear system with no solution 5 • A general form of a linear system m equations in n unknowns a11 x1 a12 x2 a1n xn b1 a21 x1 a22 x2 a2 n x n b2 am1 x1 am 2 x2 amn xn bm • A linear system in Augmented Matrices a11 a 21 am1 a12 a 22 am 2 a1n a2 n amn b1 b2 bm 6 • Example 3 equations in 3 unknowns x1 x2 2 x3 9 2 x1 4 x2 3 x 3 1 3 x1 6 x2 5 x3 0 Augmented matrix 1 2 3 1 2 4 6 3 5 9 1 0 The basic method of solving an LS is to replace the given system with a new system which is easier to solve. The following steps are commonly used 1. Multiply an equation by a non-zero constant 2. Interchange two equations 3. Add a multiple of one equation to another Note: the rows in Augmented Matrix correspond to the equations in the system, the above steps can be applied to AM in which equation replaced by row 7 How to use row operations to find a solution of Linear System: x1 x2 2 x3 9 2 9 1 1 2 4 3 1 2 x1 4 x2 3 x 3 1 3 x1 6 x2 5 x3 0 3 6 5 0 1. Subtract 2 times 1st row to 2nd row and 3 times 1st row to the third row x1 x2 2 x3 9 2 9 1 1 0 2 7 2 x2 7 x 3 17 17 3x2 11x3 27 0 3 11 27 2. Multiply 2nd row by ½ etc., finally we obtain the following 1 x1 x2 2 x3 3 1 0 0 0 1 0 0 0 1 1 2 3 8 • Gauss Elimination(GE) • GE is a systematic procedure to solve LS by reducing the augmented matrix of given LS to a simple augmented matrix that allow the solution of LS sought by inspection. Procedure: Reduced the Augmented matrixrow-echelon form. Row-echelon form: 1. The 1st non-zero number in the row is a 1 called a leading 1 2. All rows that consist entirely zero are put at the bottom of the matrix 3. The leading 1 in the lower row occurs farther to the right of the leading 1 in the higher row. A matrix in reduced row-echelon form is a matrix in row-echelon form that each column that contains a leading 1 has zero every where else. 9 • Matrices in row-echelon form Examples: 1 4 3 7 0 1 6 2 ; 0 0 1 5 1 1 0 0 1 0 0 0 0 • Matrices in reduced row-echelon form Examples: 1 0 0 4 0 1 0 7 ; 0 0 1 1 1 0 0 0 1 0 0 0 1 10 • Steps in Gauss Elimination 1. Interchange the top row with another row, if necessary, such that the top of the most left column is non-zero entry Suppose that the top of left most column entry is a non-zero entry then multiply the first row to introduce a leading 1 Add suitable multiples of the top row to the rows below such that all entries in the column below leading 1 are zero Apply the steps 1, 2, and 3 to the remaining sub matrix to produce a matrix in row-echelon form 2. 3. 4. Note: Gauss Elimination will produce matrix in row-echelon form Gauss Jordan elimination will produce matrix in reduced row-echelon form 11 • 1. 2. Steps in Gauss-Jordan Elimination Steps 1, 2, 3, and 4 the same as steps 1, 2, 3, and 4 in Gauss Elimination, respectively. Beginning with the last nonzero row, add suitable multiples of each row to the rows above to introduce all zeros above the leading 1 Note: Gauss Elimination will produce matrix in row-echelon form Gauss Jordan elimination will produce matrix in reduced row-echelon form 12 Note: 1. Gauss Elimination will produce matrix in row-echelon form 2. Gauss Jordan elimination will produce matrix in reduced rowechelon form. 3. The next step is after finding the row-echelon or reduced rowechelon form matrix begin with the last row used the back substitution to find the solution of the given LS. • Example: Find the solution of the following linear system using Gauss and Gauss-Jordan eliminations: x y 2z 9 2 x 4 y 3z 1 3x 6 y 5 z 0 x1 3 x2 2 x3 2 x5 0 2 x1 6 x2 5 x3 2 x4 4 x5 3 x6 1 5 x3 10 x4 15 x6 5 2 x1 6 x2 8 x4 4 x5 18 x6 6 13