MAT 1302B Mathematical Methods II Alistair Savage Mathematics and Statistics University of Ottawa Winter 2015 Lecture 6 Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 1 / 31
Announcements First Midterm: DGDs: Second class of next week. Covers Lectures 1 6 (up to and including today s lecture). Know your DGD number. You will be asked to write it on your exam. You must use pen, not pencil. No calculators. Bring your student ID. Next week TAs will go through some old/practice exams (available on course webpage). Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 2 / 31
Three languages: Solution sets Theorem (How to translate) If A is an m n matrix with columns a 1,..., a n and b R m, then 1 the matrix equation A x = b, 2 the vector equation x 1 a 1 + + x n a n = b, and 3 the LS with augmented matrix [ A b ] (1) all have the same solution set. In the above, x 1 x n x =. All of the above solution sets are found by row reducing the augmented matrix in (1). Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 3 / 31
Three languages: Existence of solutions Theorem (How to translate) Suppose A is an m n matrix with columns a 1,..., a n, and b R m. then the following statements are equivalent: 1 The matrix equation A x = b has a solution. 2 The vector equation x 1 a 1 + + x n a n = b has a solution. 3 b is a linear combination of a1,..., a n. 4 b is in Span{ a1,..., a n }. [ 5 The LS with augmented matrix A b ] has a solution. So there are 5 ways [ of asking] the same question! All are answered by row reducing the matrix A b to see if the rightmost column is a pivot column. Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 4 / 31
Equivalent questions: example Suppose a 1 = (4, 7, 1), a 2 = ( 3, 8, 5), a 3 = (2, 0, 1), b = (0, 1, 6). Question 1: Is b a linear combination of a 1, a 2, a 3? Question 2: Is b in Span{ a 1, a 2, a 3 }? Question 3: Does the following vector equation have a solution? x 1 a 1 + x 2 a 2 + x 3 a 3 = b [ 4 3 ] 2 Question 4: Does the matrix equation A x = b with A = 7 8 0 1 5 1 have a solution? Question 5: Does the following linear system have a solution? 4x 1 3x 2 + 2x 3 = 0 7x 1 + 8x 2 = 1 x 1 + 5x 2 + x 3 = 6 Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 5 / 31
Equivalent questions: example [ We solve all of these questions by row reducing the matrix A [ A b ] = 4 3 2 0 7 8 0 1 1 5 1 6 row reduce b ] : 1 0 0 109/139 0 1 0 78/139 0 0 1 335/139 Since the system is consistent, the answer to all the questions is YES. Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 6 / 31
Example Suppose 3 0 3 a 1 = 1, a 2 = 1, a 3 = 0, 2 1 1 6 b = 1. 3 If possible, express b as a linear combination of a 1, a 2, and a 3. Solution: We row reduce: 3 0 3 6 1 1 0 1 2 1 1 3 The general solution is row reduce 1 0 1 2 0 1 1 1 0 0 0 0 x 1 + x 3 = 2 x 1 = 2 x 3 x 2 x 3 = 1 x 2 = 1 + x 3 x 3 free Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 7 / 31
Example (cont.) General solution: x 1 = 2 x 3 x 2 = 1 + x 3 x 3 free Since we are asked to express b as a linear combination of a 1, a 2, a 3, any solution will do. So we can pick any value for x 3 we like. Let s take x 3 = 0. Then x 1 = 2, x 2 = 1. Then we have 3 0 6 2 a 1 a 2 + 0 a 3 = 2 1 1 + 0 = 1 = b 2 1 3 Other choices for x 3 give other answers. Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 8 / 31
Example 2 0 1 a 1 = 2, a 2 = 1, a 3 = 1, 4 1 0 b 1 b = b 2 b 3 For which values of b 1, b 2, b 3 is b Span{ a 1, a 2, a 3 }? Solution: We row reduce: 2 0 1 b 1 2 1 1 b 2 4 1 0 b 3 R 2 +R 3 R 1 +R 2 2R 1 +R 3 2 0 1 b 1 0 1 2 b 1 + b 2 0 1 2 2b 1 + b 3 2 0 1 b 1 0 1 2 b 1 + b 2 0 0 0 b 1 b 2 + b 3 The system is consistent if and only if b 1 b 2 + b 3 = 0. Therefore, b Span{ a 1, a 2, a 3 } if and only if b 1 b 2 + b 3 = 0. Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 9 / 31
Today: Overview Three languages: Linear systems Vector equations Matrix equations Up to now, our final descriptions of solution sets have been in the language of linear systems (at least for solution sets with free variables) We want to complete this picture by describing solution sets in terms of vectors. Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 10 / 31
Homogeneous linear systems Definition A LS is homogeneous if it can be written in the form A x = 0 where A is an m n matrix and 0 R m. A homogenous system always has the solution x = 0 R n, called the trivial solution. A nontrivial solution is a solution x 0. Theorem The homogeneous equation A x = 0 has a nontrivial solution iff it has at least one free variable. Reason: Every LS has 0, 1 or infinitely many solutions! Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 11 / 31
Example The linear system 3x 1 + 2x 2 + 4x 4 = 0 x 1 + 10x 3 8x 4 = 0 x 2 x 3 + x 4 = 0 is homogenous. This system is consistent (it has at least the trivial solution x 1 = x 2 = x 3 = x 4 = 0). To find out if it has nontrivial solutions, we d have to row reduce and see if there are free variables. Example 3x 1 + 2x 2 + 4x 4 = 0 x 1 + 10x 3 8x 4 = 4 x 2 x 3 + x 4 = 2 is not a homogenous system. To know if this system is consistent or inconsistent, we would have to row reduce. Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 12 / 31
Example Consider the linear system: 2x 1 + 6x 2 x 3 = 0 4x 1 + 3x 2 + 2x 3 = 0 6x 1 5x 2 + 3x 3 = 0 We write down the augmented matrix and row reduce: 1 2 6 1 0 1 0 4 3 2 0 row reduce 2 0 0 1 0 0 6 5 3 0 0 0 0 0 So the general solution is x 1 + 1 2 x 3 = 0 x 2 = 0 0 = 0 x 1 = 1 2 x 3 x 2 = 0 x 3 free Since there are free variables, the system has nontrivial solutions. Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 13 / 31
Example (cont.) So the general solution to A x = 0, where A is the coefficient matrix of the above LS has the form x 1 1 2 x 3 1 2 1 2 x = x 2 = 0 = x 3 0 = x 3 v, where v = 0. x 3 x 3 1 1 This is the vector parametric form of the solution. x 3 Span{ v} v x 2 x 1 The solution set is Span{ v}, the line through 0 and v. It consists of all scalar multiples of v. The trivial solution corresponds to the zero multiple (x 3 = 0). Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 14 / 31
Another example Consider the equation (also a LS) The solution set is given by 3x 1 2x 2 5x 3 = 0 x 1 = 2 3 x 2 + 5 3 x 3 x 2, x 3 free So the general solution is 2 x 1 3 x 2 + 5 3 x 2 3 3 x 5 2 3 x 3 x = x 2 = x 2 = x 2 + 0 x 3 x 3 0 x 3 2 5 3 3 = x 2 1 + x 3 0, x 2, x 3 R vector parametric form 0 1 Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 15 / 31
Another example (cont.) So the general solution is 2 5 ( ) ( ) 3 3 x 2 1 + x 3 0 2 5 = x 2 u + x 3 v, where u = 3, 1, 0, v = 3, 0, 1 0 1 where x 2, x 3 can be any scalars. x 3 So the solution set is Span{ u, v} v x 1 u x 2 Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 16 / 31
Solutions to homogeneous systems Description in terms of Span The solution set of a homogeneous system can always be written in the form Span{ v 1,..., v p } for some vectors v 1,..., v p. To find the set of vectors {v 1,..., v p } we: solve the linear system as usual, write the solution in vector notation, (replace basic variables by their expressions in terms of free variables), split the vector into a sum, one term for each free variable, and factor out the free variables the vectors appearing yield the set. E.g. x 1 x =. = x 1 [. ] ] + x 4 [. (if x 1 and x 4 are the free variables) x n Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 17 / 31
Solutions to homogeneous systems Important note: The above is only true for homogeneous systems! For example, the system x = 1 y = 2 has the unique solution (x, y) = (1, 2) and this solution set is not the span of a set of vectors (for instance, 0 is always in any span). Another note: If a homogenous system has only the trivial solution, the solution set is Span{ 0}. Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 18 / 31
Nonhomogeneous systems Example: Describe all solutions of A x = b where 1 1 2 3 A = 1 3 6, b = 5. 2 1 5 4 Solution: We first row reduce: 1 1 2 3 1 3 6 5 2 1 5 4 Then we write the general solution: row reduce 1 0 3 1 0 1 1 2 0 0 0 0 x 1 + 3x 3 = 1 x 1 = 1 3x 3 x 2 x 3 = 2 x 2 = 2 + x 3 0 = 0 x 3 free Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 19 / 31
Then we switch to vector notation: x 1 = 1 3x 3 x 1 1 3x 3 1 3 x 2 = 2 + x 3 x = x 2 = 2 + x 3 = 2 +x 3 1, x 3 free x 3 x 3 0 1 So the vector parametric form of the general solution is x = p + t v, t R x 3 R where p = (1, 2, 0) and v = ( 3, 1, 1). Note: We have replaced x 3 by a parameter t. x 3 v x 2 The solution set is a line p through p, parallel to v. x 1 Solution set Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 20 / 31
Homogeneous and nonhomogeneous systems Question What is the relationship between homogeneous and nonhomogeneous systems? In our previous example, we solved A x = b and described the solution set as x = p + t v, t R. If we solved the corresponding homogeneous system A x = 0 we would get the solution (same A as above) x = t v, t R (same v as above). Note: The only difference is the presence of the vector p, which is a solution of the nonhomogeneous system (corresponding to parameter value t = 0). Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 21 / 31
Homogenous and nonhomogeneous systems Theorem If A x = b is consistent and p is any solution, then full the solution set is the set of all vectors of the form w = p + v h where v h is any solution of the corresponding homogeneous equation A x = 0. Notation In the above, p is called a particular solution. So if we know all the solutions to the homogenous system (obtained by setting the constant terms to zero), then we get all the solutions to the nonhomogeneous system just by adding any particular solution p to them all! Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 22 / 31
Advantages The relation between homogeneous and nonhomogeneous systems can save us a lot of time. Question Suppose we have to solve a bunch of systems with the same coefficients but different constant terms. How could we do this efficiently? Answer 1 Solve the corresponding homogenous system. 2 For each system find one particular solution (sometimes this is easy to do by inspection). 3 Add the particular solutions to the solution set of the homogenous system. Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 23 / 31
Geometric interpretation x 3 A x = b A x = 0 p x 2 x 1 The solution set of A x = b is obtained by shifting the solution set of A x = 0 by a particular solution p (i.e. vector satisfying A p = b). Note: We can shift by any particular solution (green arrows represent other choices). Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 24 / 31
Another example Find the solution set to the matrix equation 1 2 1 2 5 1 2 3 4 x = 13. 2 4 0 10 2 Write the answer in vector parametric form. Solution: 1 2 1 2 5 1 2 3 4 13 2 4 0 10 2 The general solution is row reduce 1 2 0 5 1 0 0 1 3 4 0 0 0 0 0 x 1 = 2x 2 5x 4 1 x 3 = 3x 4 + 4 x 2, x 4 free Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 25 / 31
We switch to vector notation: x 1 2x 2 5x 4 1 x = x 2 x 3 = x 2 3x 4 + 4 x 4 x 4 = 1 0 4 0 2 5 + x 1 2 0 + x 0 4 3, 0 1 x 2, x 4 R Question: What is the solution set to the corresponding homogeneous equation 1 2 1 2 0 1 2 3 4 x = 0 2 4 0 10 0 (same equation but with zeros on the right)? Answer: We just remove the particular solution. The solution set is 2 5 2 5 Span 1 0, 0 3 = s 1 0 + t 0 3 s, t R 0 1 0 1 Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 26 / 31
How to find the vector equation of a line Question: What is the vector with tail at point a and tip at point b? b a a b Example Vector with tip at point (3, 1, 5) and tail at ( 2, 0, 8) is v = (3 ( 2), 1 0, 5 8) = (5, 1, 3). Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 27 / 31
How to find the vector equation of a line Procedure To find the vector equation of a line 1 Find a vector v parallel to the line (can use any two points on the line and find the vector from one to the other as above). 2 Find a point p on the line. 3 The vector equation is then p + t v, t R. x 1 v x 2 p x 3 Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 28 / 31
Example Question: Find the vector equation of the line through the points (2, 0, 3) and ( 1, 1, 2). Answer: A vector parallel to the line is A point on the line is Therefore, the vector equation is v = (2, 0, 3) ( 1, 1, 2) = (3, 1, 1). p = (2, 0, 3). (2, 0, 3) + t(3, 1, 1), t R. Note: There are lots of vector equations of any given line. Example: Another vector equation of the above line is ( 1, 1, 2) + t(3, 1, 1), t R. Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 29 / 31
Weekend problem goat You re on a game show There are 3 closed doors Behind 2 doors are goats, behind the other is 1 million dollars You choose a door (it remains closed) The host opens a door you did not choose, showing you a goat You are given a choice: stick with your original choice or switch to the other unopened door What should you do? Does it make any difference? Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 30 / 31
Next time For next time: Read Section LI Discuss homogeneous equations in the language of vector equations Linear dependence/independence Important: Students often find linear dependence a difficult topic. So read the section before class! Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture 6 31 / 31