. SYSTMS OF LINR QUTIONS.. Linear quations linear equation is an equation of the form a x + a x +... + a n x n = d where the a i s and d, are constants. The a i s are called coefficients, and the x i s are variables. If there are just three variables we generally use the symbols x, y, z as the variables and write the equation as ax + by + cz = d. If there are only two variables we write it as ax + by = c. linear equation ax + by = c represents an equation in the plane (so long as either a or b is non=zero). linear equation ax + by + cz = d represents a plane in -dimensional space (again, provided at least one of the coefficients is non-zero). system of linear equations is a set of two or more linear equations. Solving such a system means finding all of the combinations of the variables for which all of the equations hold. If we have a system of two equations in two variables we generally get a unique solution. This is because the two equations represent two straight lines in the plane, and generally two such lines intersect in a single point. Of course, it is possible for the lines to be parallel, in which case there are no solutions. It is very easy to solve two linear equations in two variables. We simply multiply the equations by suitable constants and then add or subtract to eliminate one variable. We then substitute this into either of the equations to find the value of the other variable. x 7y = xample : Solve the system. x + y = 8 x y = Solution: Multiply the first equation by and the second equation by to get x + y = Now subtract the first equation from the second. This gives y =. Hence y =. Substituting into the original first equation we get x =. Hence x = and so x =. Thus x =, y = is the unique solution. If we had instead substituted into the original second equation we would have got x + 8 = 8, x = and so x =. Geometrically, the two lines intersect in the point (, ). Solving three equations in three variables can be viewed geometrically as finding points of intersections of planes. The typical case is where there is just one point of intersection, but there are cases where there are infinitely many solutions, such as when the planes intersect in a line, and there are cases where there are no solutions..
and. One can use the same ad hoc method of eliminating variables to solve such a system. The problem is, that frequently students eliminate one variable and, while attempting to eliminate a second variable, the first variable creeps back in. What is needed is a lot of discipline and an systematic procedure. s well, in solving such a system we could find ourselves writing down lots of x s and y s and z s. This is unnecessary as all the arithmetic involves just the coefficients and the constants on the right hand sides of the equations. So we strip off the variable names and work with just the table of coefficients and the table of constants. Often we arrange data in a table of rows and columns. Such a table can be considered as a single mathematical object, called a matrix (plural matrices ). n m n matrix is a rectangular array of numbers arranged in m rows and n columns. The numbers can come from any field, such as the field of real numbers or the field of complex numbers. The entries in the table are called the components of the matrix. If there s just one column we call the matrix a column vector. So if we have the system of linear equations: ax + by + cz = d ex + fy + gz = h px + qy + rz = s a b c we could write this a matrix and a column vector: e f g p q r Note that we use large parentheses rather than draw up a grid of squares. ctually we put the matrix of coefficients and the column vector of constants into a single matrix called the augmented matrix. The coefficient matrix is augmented by the constant vector. In this case we write the above system of equations in variables as: a b c d e f g h p q r s Note that we separate the coefficient part from the constants by a vertical line. This is not necessary but it makes it easier to read. Think of the vertical line as a column of equal signs. In fact the augmented matrix is a sort of dehydrated version of the system of equations just add variables. With a little practice you should be able to read an augmented matrix as a system of equations provided you know the variable names. Of course it s important that the equations are arranged so that the variables come in the same order, so that each column in the coefficient part refers to the same variable. nd if a variable is missing from an equation it should be given a coefficient of zero. x y + z = x y + z = xample : The system x z = should be first rewritten as x + y z =. z = y + x + y z = It can then be written as the augmented matrix. (With a bit of practice you can write down the augmented matrix straight away.) d h s
,,. When solving such a system there are certain operations we are permitted to use. These produce a different, but equivalent, set of equations equivalent in the sense that they have the same solutions. We can rearrange the equations, we can multiply an equation by a non-zero constant and we can add or subtract one equation from another. The aim is to put the augmented matrix into what is known as echelon form... chelon Form matrix is said to be in echelon form if: () any zero rows are at the bottom; () the first non-zero entry in the other rows is ; () these s are staggered so that later rows have their in later columns. The importance of having an augmented matrix in echelon form is that it is very easy to solve the system by a method known as back substitution. This method is illustrated below. xample : The following are some augmented matrices in echelon form: 7 8, 7 The advantage of having an echelon form is that it s easy to solve the equations by back substitution. In the first case, if the variables are x, y, z the last equation is z = 7. Substituting in the second last equation, y + z =, we get y = 9. Finally substituting into the first equation x + y + z = we get x =. If the variables in the second system are x, x, x, x the last equation is =. This is redundant. The second last equation is x = 8. The second equation is x + x = 7 which gives x =. The first equation is x + x + x + x =, which simplifies to x + x = 9. Now x can be chosen arbitrarily. If we let x = k then x = 9 k. So the complete solution is: x = 9 k, x = k, x =, x = 8. In this case we have infinitely many solutions. Of course there is no logical reason for using k instead of x. It s just that it looks nicer. For the third augmented matrix the second equation is =. This is clearly impossible. This system has no solution. We say that the system of equations is inconsistent. The last system is rather trivial. There are two variable, say x and y, and essentially no equations. So we can choose any values for them. Once a system of equations is in echelon form it s very easy to see if the system is consistent or inconsistent, and if it is consistent it s easy to see if there is a unique solution or infinitely many. lso, the solution, or solutions can be found readily using back substitution. When a system of equations is solved by a computer program the coefficients and constants are stored in an array. There needs to be some systematic algorithm, or procedure. The three types of operation carried out by such a program are: Dividing a row of the augmented matrix by a non-zero constant; Subtracting a certain multiple of one row from another; Swapping two rows. If the matrix represents a system of equations these are permitted operations that do not change the solution. The algorithm that is used is known as the Gaussian lgorithm.
R R R R in R R R R R.. The Gaussian lgorithm Suppose = (a ij ) is an m n matrix, such as an augmented matrix. () Let r = and c =. () If a rc go to step (). () If a rc = but a ic for some i with r < i m swap row r with row i and go to (). () If a ic = for all i with r i m let c = c +. If c n go to step (). () ND () Divide row r by a rc. () For t = r+ to m, subtract a tc times row r from row t. (7) Increment both r and c by and go to step (). Note that step () makes a rc = and step () puts zeros underneath. xample : Put the matrix echelon form. 8 / / Solution : 8 8 / / / / / / R, R R / / / / / / ( /) / / / / 8/ / (/)R / / / / (8/) If this matrix is the augmented matrix of a system of equations then z =. From the second equation y =. From the first equation x =. Solution : When performing the algorithm by a computer the messy arithmetic is no problem. However when performing the calculation by hand it often pays to vary the algorithm in order to simplify the arithmetic. ny sequence of elementary row operations will do provided we end up with the echelon form. This is what we ve done here. 8 R 8 8 R, R R 8 R, R ( ),R ( ) 8 R 8
R R R R R R R R R 8 ( 8) Notice that we ve obtained a different, and simpler, echelon form. Different sequences of elementary row operations will generally yield different echelon forms. But if the matrix is the augmented matrix of a system of linear equations the solutions will be the same. Here we would have z = from the third equation, y = = from the nd and x = 8 = from the st equation. When systems of linear equations are solved on a computer the strict Gaussian algorithm, or a variation of it, is used. fter all the components will generally not be integers so there s no problem in dividing to get the s in the echelon form. But in examples that are designed to be done by hand the components are usually integers and there s some merit in varying the algorithm as we have done. x + y z = xample : Find the solution(s) to the system: x y + 7z = 7. x y + z = 7 Solution: 7 7 7 R 7 7 We did this because we could see that we would get a. 7 R 7 7 R, R R 7 9 7 Now we seem to be in trouble. How do we get a, without dividing row by, which would be very messy? If we subtract times row from row we get a smaller integer on the diagonal. 7 R 8 Now normally we might now subtract times row from row, getting on the diagonal. Or better still we could subtract times row from row, getting on the diagonal. But in this case we notice that we can divide row by, getting a on the diagonal and no fractions. 7 7 R 7 R 8 7 ( 8). So z =, y = + = and x = + =. Hence this system has the unique solution x =, y =, z =. 7
R R R R R R R R x + y z = xample 7: Find the solution(s) to the system: x y + 7z = 7. x 8y + 9z = Solution: 7 7 7 R 8 9 8 9 7 R 8 9 7 R, R R 9 99 7 R The system has contracted from equations in variables to just two. We ll therefore get infinitely many solutions. We may choose z arbitrarily. Let z = k. Then y = + k, so y = + k and hence x = + 7. + k k = + k. lternatively, we could let z = k. It doesn t matter because k can represent an arbitrary number just as well as k. Now we have y = + (k) so y = + k. We have reduced the number of fractions, but of course we can t always get rid of them completely. Finally x = + 7. + k (k) = + k. This gives the same solutions as above, although the values of k are different. The solution that corresponds to k = in the first solution corresponds to k = in the second. x + y z = xample 8: Find the solution(s) to the system: x y + 7z = 7. x 8y + 9z = Solution: This is almost the same system above. It differs only in the constant term of the last equation. 7 7 7 R 8 9 8 9 7 R 8 9 7 R, R R 9 7 R The last equation is inconsistent because it asserts that =. No choice of x, y and z will make this possible. Hence this system has no solutions. 8
we = Sometimes we have a system with infinitely many solutions but we only want the integer solutions. In this case we solve the system as usual, getting rational solutions. Then we use our knowledge of solving linear congruences. 7k For example if we obtained y = 7 would need 7k to be a multiple of 7 to get an integer value of y, So we would solve the congruence 7k (mod 7). Where the coefficient is small, as in this case, we simply rewrite the constant by adding multiples of the modulus until we can cancel. Remember that it s permissible to divide a linear congruence by any integer that is coprime with the modulus. In this case we d write 7k 7 (mod 7), so k (mod 7). This means + 7.7h that k = + 7h for some integer h and hence y = 7 7h +. x + y z = xample 9: Find an integer solution to the system: x y + 7z = 7. x 8y + 9z = Solution: We solve it as in example 8, getting the general solution: x = + k, y = + k, z = k. Now for an integer solution we need to have k (mod ). The general method for solving such congruences is to use the uclidean algorithm, but here there s a much easier way, since (mod ). So the congruence becomes k (mod ), and since is coprime with we may divide both sides by, getting k (mod ). So we get an integer solution for y by taking k =. This gives x =, y =, z =. xample : Solve the system: x + x + x + x = x + x + x + x = 9 x + x + x + x = 8. x + x + x + x = 9 x + x + x + x = 9 Solution: 8 8 R R, R R, R R, R +R 9 8 9 9 8 R R This gets a. 9 9
9 8 R R 8 7 R R 7 R R R, R 7R The solution to the system of equations is x =, x = k, x = k = k, that is, x = k x = k x = k x = for all values of k... Systems of Homogeneous Linear quations homogeneous system of linear equations is a system where all the constant terms are zero. These are solved in exactly the same way as any other system. The main difference is that because the constant terms will remain as zeros throughout the calculation we can omit them altogether and just deal with the matrix of coefficients. Of course a homogeneous system always has the trivial solution x = x =... =. They are of interest when there are non-trivial solutions. xample : Solve the homogeneous system x + x + x + x = x + x + x + x = x + x + x + x = x + x + x + x = x + x + x + x =. Solution: 9 8
7 7. The solution to the system of equations is x =, x = k, x = k, x = ( k) k = k. So the solution is v = k k k = k for arbitrary k. homogeneous system has the form v = for some matrix. Clearly with a homogeneous system the sum of any two solutions is a solution and any scalar multiple of a solution is a solution. We say that the set of solutions of a homogeneous system is a vector space. In the above example it is -dimensional, and can be represented by a line in -dimensional space. The solution sets of some homogeneous systems have higher dimension. For example a certain homogeneous system might have the form h + k for arbitrary h, k. We say that this is a -dimensional vector space. However the concepts of vector space and dimension are discussed in another set of notes... The Gauss-Jordan lgorithm lthough solving a system of equations in echelon form is easy by back substitution nothing would beat an echelon form that looks like (I b). For example if we were able to reduce the augmented matrix to the echelon form: we could read off the solution as x =, y =, z =. If we obtained the echelon form by the Gaussian algorithm we could continue to use elementary operations until the matrix of coefficients was the identity matrix. R R, R R R R Of course this only works if there s a unique solution.
x + y z = xample 8: Solve the system: x y + 7z = 7. x y + z = 7 Solution: We begin by putting the augmented matrix, 7 7, in echelon form. 7 Since the augmented matrix has integer components and we are doing this by hand we won t follow 7 the Gaussian algorithm exactly. s above we get by suitable elementary row operations. The fact that the matrix of coefficients is square, and we have no zero rows, guarantees that it s possible to obtain the identity matrix by further elementary row operations. So, instead of using back-substitution as before, we continue until we get the identity matrix as the matrix of coefficients. 7 7 R R, R +R R + 7R Now we can read off the solution in the last column. The Gauss-Jordan algorithm is the best one to use on a computer because it s easier to implement than back-substitution. But doing things by hand it s better just to use the Gaussian algorithm, or a variation of it, and then back-substitution because it involves less writing. The amount of computation is the same in both cases. XRCISS FOR CHPTR x + y + z = xercise : Solve the system of equations: x y + z =. x + 7y + z = x + y + z = xercise : Solve the system: x + y + 8z =. 7x y + z = 7 x + y + 7z = xercise : Solve the homogeneous system: x y + z =. 8x + y + 7z = x + y + 7z = 7 xercise : Solve the system: x y + z =. 8x + y + 7z =
R R R R R x + y + 7z = xercise : Find the solutions to the system: x y + z =. 8x + y + 7z = x + y + 7z = xercise : Find the integer solutions to the system: x y + z =. 8x + y + 7z = x y + 7z = 7 xercise 7: Find the integer solutions to the system: 8x + y z =. 7x + 7y 7z = x y + 7z = xercise 8: Find two integer solutions to the system: x + y + z =. x y + 7z = SOLUTIONS FOR CHPTR xercise : 7 7 R 7 8 8 R, R R 9 8 R 9 + 8R 9 ( ) So z =, y = + 9 =, x = + 9 =. xercise : 7 8 7 7 8 7 7 R R R R, R 7R R R
k So z =, y = + 88. = + =, x = + + =. 8 R R 88 88 88 8 R + R R + R, R R 78 R ( ) 7 = 7 xercise : 7 8 7 8 7 = 7 = 7. So z = k, y = k whence y = k, x = 7 7 + 8 7 7 + k = k = k, so x = k. 7 / The solutions are all the multiples of /, or equivalently, all the multiples of 7. xercise : 7 7 8 7 7 7 7 7 8 7 7 7 8
.,.,.. so. 7 The system is inconsistent. There are no solutions. 7 7 7 7 8 xercise : 8 7 7 8 7 7 8 7 7 Let z = k. k Then y = k, so y = k + 7 7k + 8k + 7k + 7k x = 7 + 7 + k = = x = xercise : We found the complete solution to this system in the previous exercise. It is + 7k k x = y = z = k. For integer solutions we need 7k (mod ). Reducing modulo we get k 8(mod ). Since and are multiples of and 8 is not, there are no solutions to this congruence and hence no integer solutions to the system of linear equations. xercise 7: 7 7 7 7 8 7 89 7 7 7 7 7 7 7 7 7 9 9 7 89 / 89/ The complete solution is z = k, 89 k 89 y = + k = k 89 x = k + 8k + 8 = Now for integer solutions we need 8k + 8 to be a multiple of, that is 8k 8 (mod ) 8(mod ).
. = = =. = = = = Since 8 is coprime with we may divide this congruence by 8 to obtain k (mod ). This gives the integer solutions as 8(h + ) + 8 x = 8h +, for some h (h + ) 89 y = = h + 7 and z = h +. 7 7 xercise 8: 7 7 8 7 9 7 7 8 7 7 8 Let z = k. 8 + k Then 7y = 8 + k so y = 7 8 + k x = 7 + k 7 999 98 + 8k k = 7 7 7k = 7 For an integer solution we would need 7k 7(mod 7) and k 8(mod 7). Reducing these modulo 7 these become k 7(mod 7) and k (mod 7). The first equation simplifies to k (mod 7). Remember that we are allowed to divide both sides by since is coprime with 7. Then k 7(mod 7), so the two equations are equivalent. Hence z = k = 7h for some integer h. 7 7(7h ) 7 + 7 7.7h 8 7.7h Then x = 7 7h. 7 7 8 + (7h ) 8 +.7h 8 +.7h y = 7 + h. 7 7 Take h =. Then x =, y =, z = is an integer solution. Take h =. Then x =, y =, z = is another integer solution.