Math 307 Spring, 2003 Hentzel Time: 1:10-2:00 MWF Room: 1324 Howe Hall Instructor: Irvin Roy Hentzel Office 432 Carver Phone 515-294-8141 E-mail: hentzel@iastate.edu http://www.math.iastate.edu/hentzel/class.307.ICN Text: Linear Algebra With Applications, Second Edition Otto Bretscher ============================================================ Friday, Mar 28 Chapter 5.5 Page 240 Problems 1 through 43 Main Idea: Key Words: Goal: ============================================================== Previous Assignment Page 221 Problem 4 Let A be an mxn matrix. Is the formula _|_ T (ker A) = im(A ) necessarily true: Explain. This statement says: V kills Ker A <==> V is in RowSpace[A] By definition, Row Space of A kills the Null Space of A. Ker A Rows of A Null Space of A |---------R1------| | | | | | | | |---------R2------| | | | | | | | |--------- ------| | | | | | | | |--------- ------| | C1 C2 Cs | = 0 |--------- ------| | | | | | | | |---------Rm------| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The difficult part of the question, is, can we add more rows to A which also kill the Null Space of A? Ker A Rows of A# Null Space of A |---------R1------| | | | | | | | |---------R2------| | | | | | | | |--------- ------| | | | | | | | |--------- ------| | C1 C2 Cs | = 0 |--------- ------| | | | | | | | |---------Rm------| | | | | | | | |---------R*------| | | | | | | | | | | | | | | | | | | | | | The answer is yes, if R* is in the Row Space of A. If R* is not in the Row space of A#, then we get one more stair step one in the Row Canonical form of A#, and one less basis vector in the null space of A#. Thus the only vectors which kill Ker A are already in the Row Space of A. ---------------------------------------------------------------- Page 221 Problem 22 Find the least squares solution xbar* of the system |3 2| |5| AX = B where A = |5 3| and B = |9| |4 5| |2| |3 5 4| |3 2||x| |3 5 4||5| |2 3 5| |5 3||y| = |2 3 5||9| |4 5| |2| |50 41||x| = |68| |41 38||y| |47| | 38 -41||50 41||x| = | 38 -41||68| |-41 50||41 38||y| |-41 50||47| |219 0 ||x| =| 657| | 0 219||y| |-438| |x|= 1/219 | 657| = | 3 | |y| |-438| |-2 | | 5| |3 2|| 3| |0| | 9| - |5 3||-2| = |0| | 2| |4 5| |0| So the least squares solution is actually a solution, not just an approximate solution. ------------------------------------------------------------ Page 221 Problem 38 In the accompanying table, we list the height h, the gender g, and the weight w of some young adults. Height h Gender G Weight w (in Inches above 1 = Female in pounds 5 feet. 0 = Male 2 1 110 12 0 180 5 1 120 11 1 160 6 0 160 Fit a function of the form w = co + c1 h + c2 g to these datsa, using least squares. Before you do the computations, think about the signs of c1 and c2. What signs would you expect if these data were representative of the general population? Whay? What is the sign of Co? What is the practical significance of Co. | 2 1 1||c1| | 110 | | 12 0 1||c2| | 180 | | 5 1 1||co| = | 120 | | 11 1 1| | 160 | | 6 0 1| | 160 | W = 125 + 5 h -25 g W - 125 + 5 h -25 g co = 125 represents the base for people five feet tall. c1 = 5 means that the expected weight increment is five pounds per inch. c2 = -25 means that men are twenty five pounds heavier than woman of the same height. --------------------------------------------------- Out[19]= {{c0 -> 125, c1 -> 5, c2 -> -25}} B = {110,180,120,160,160}; A = { { 2, 1, 1}, { 12, 0, 1}, { 5, 1, 1}, { 11, 1, 1}, { 6, 0, 1}}; Solve[Transpose[A].A.{c1,c2,c0} == Transpose[A].B]; ==================================================== I want to go over the material from yesterday on the best solution to AX = B. Point 1. We want to find Xo such that A Xo is as close to B as possible. Point 2. We measure close by using the length of a vector. That is, we want | B-AXo | to be as small as possible. Point 3. One can recognize the best Xo. AXo is closest to B when (B-AXo) is perpendicular to the columns of A. Point 4. AXo + N = B where N is perpendicular to the columns of A where N is in the null space of A^T. Point 5. The process in pictures. | | | | | | | | | X | | | | | | | | | | A | | B | | | = | | | | | | | | | | | | | | | | | | | | | | We adjoin the null space of A^T to the columns of A. This gives us a square matrix which is invertible. | : | | | | | | : | | X | | | | : | |___| | | | A : NS(A^T) | | | = | B | | : | | | | | | : | | Y | | | | : | | | | | | : | | | | | | : | | | | | This has a unique solution AXo + NS(A^T)Yo= B and B-AXo is in the Null Space of A^T which means that Xo is the best solution. Point 6. We tie in the Xo from Point 5 with the method. | : | | | | | | : | | Xo| | | | : | |___| | | | A : NS(A^T) | | | = | B | | : | | | | | | : | | Yo| | | | : | | | | | | : | | | | | | : | | | | | If we multiply the above equality by the transpose of the coefficient matrix, we end up with | : | | | | | | A^T A : 0 | | Xo| | A^T B | | : | |___| | | |........:..........| | | = |.......| | : | | | | | | 0 : garbage | | Yo| |garbage| | : | | | | | | : | | | | | The Xo that you want will also be the solution to A^T A X = A^T B ========================================================= New Material. The idea here is for approximation. If we want to iterate to a solution to something, we have to have some measurement so that we can tell if we are making progress. We have to be able to measure how much we currently are in error, so that we can continuously shrink that error until we are close enough. The most common way to measure distance is using the square root of the sum of the squares. But sometimes that is not what you really want. Maybe one coordinate was more important that another. You might want to weight that component more that another one. Thus you want to modify the length assigned to a vector. Another possibility is that your vectors are functions like Sin[x], Sin[2x], Sin[3x]. These functions are linearly independent. What should their length be? How can you tell when two functions are "close". ---------------------------------------------------------- A convenient way that works to assign a distance is through something called an "inner product". An inner product in a linear space V is a rule that assigns a real scalar (denoted by (f,g) ) to any pair f, g of elements of V, such that the following properties hold for all f,g,h in V and all c in R. (a) (f,g) = (g,f) (b) (f+g,h) = (f,h) + (g,h) (c) (cf,g) = c (f,g) (d) (f,f) > 0 for all nonzero f in V. A linear space endowed with an inner product is called an inner product space. All this is essentially to get part (d) which allows us to tell if something is small. ------------------------------------------------------------- Examples 1 page 226: If f and g are continuous functions, b let (f,g) = INT f(t) g(t) dt a All the properties are clear, and the continuity of f implies b that INT f(t)^2 dt cannot be zero unless f == 0. a ----------------------------------------------------------- Example 2 page 227: Consider all infinite sequences which Infinity such that SUM xi^2 converges. i=0 Infinity Define (x,y) = SUM xi yi i=1 One has to show that this sum is actually finite. ------------------------------------------------------------ Example 3 page 227: Simply take the mxn matrices and define the inner product by SUM aij bij . Actually i=1,m j=1,n this is just the "dot product" with the vectors written differently. But it has a nice formula. = trace( A^T B ) = trace( B^T A). ------------------------------------------------------------- The length in an inner product space is | f | = Sqrt[ (f,f) ]. The distance between two elements f and g is given by d(f,g) = | f-g | = Sqrt[ (f-g,f-g) ]. ------------------------------------------------------------- Find an orthonormal basis of the polynomial of degree 2? the basis is 1, x, x^2. We use Gram-Schmidt to get x=1 an orthonormal basis. Use the inner product (f,g) = INT f g dx x=0 1 x x^2 V1 V2 V3 W1 = V1 = 1. (V1,W1) W2 = V2 - ------- W1 (W1,W1) 1 1 (V1,W1) = INT x dx = | x^2 | = 1 0 0 1 1 (W1,W1) = INT 1 dx = | x | = 1 0 0 W2 = x - 1/2. (V3,W1) (V3,W2) W3 = V3 - -------- W1 - ------- W2 (W1,W1) (W2,W2) 1 (V3,W1) = INT x^2 dx = 1/3 0 1 1 (V3,W2) = INT x^2(x-1/2) = | x^4/4 - x^3/6 | = 1/12 0 0 (W1,W1) = 1 1 1 (W2,W2) = INT (x-1/2)(x-1/2) = | (x-1/2)^3/3 | = 1/12 0 0 W3 = x^2 -(1/3)/(1) - (1/12)/(1/12) (x-1/2) = x^2 -1/3 - (x-1/2) The orthogonal basis is 1 x-1/2 x^2 - x + 1/6 The orthonormal basis is (x-1/2) x^2 - x + 1/6 1 ------------ ---------------- Sqrt[1/12] Sqrt[1/180] ------------------------------------------------------------------ The big big example of orthogonal bases are the Fourier Series. The basis Sin[t], Cos[t], Sin[2 t], Cos[2 t], ...., Sin[n t], Cos[n,t] ... are an orthonormal basis under the inner product Pi (f,g) = 1/Pi INT f(t) g(t) dt. -Pi If we wish to find how a string which is deformed will vibrate, we first express it in terms of the orthogonal basis of Sines and Cosines. Then the subsequent positions of the string will be given by the linear combination at any time t. The seventh harmonic does not sound very good. On a piano, they depress this harmonic by having the hammer hit at 1/7 of the way from the end of the string. This forces there not to be a node at the 1/7 place so the 1/7 harmonic will be missing.