Math 307 Spring, 2005 Hentzel Time: 10:00 to 10:40 MWF Room: 205 Carver Hall Instructor: Irvin Roy Hentzel Office 432 Carver Phone 515-294-8141 E-mail: hentzel@iastate.edu http://orion.math.iastate.edu/hentzel/class.307.05 Text: Linear Algebra and its Applications, Third Edition David C. Lay Monday, January 24 1.7 and 1.8 Page 80 Problem 6, 17, 20, 37 Main Idea: Matrices can stretch things out and twist them around. Key Words: Rotation, Dilation, Linear Transformation Goal: Look at a matrix and visualize what it does. ------------------------------------------------------------ Previous Assignment: Page 90 Problem 15 Fill in the missing entries of the matrix | ? ? ? || x1 | | 3x1 - 2x3 | | ? ? ? || x2 | = | 4x1 | | ? ? ? || x3 | | x1-x2+x3 | | 3 0 -2 | | 4 0 0 | <=== Answer | 1 -1 1 | ------------------------------------------------------------- Page 90 Problem 16 Fill in the missing entries of the matrix | ? ? || x1 | | x1-x2 | | ? ? || x2 | = | -2x1+x2 | | ? ? | | x1 | | 1 -1 | | -2 1 | | 1 0 | ------------------------------------------------------------- Page 99 Problem 1 The container of a breakfast cereal usually lists the number of calories and the amounts of protein, carbohydrate, and fat contained in one serving of the cereal. The amounts for two common cereals are given at right. Suppose a mixture of these two cereals is to be prepared that contains exactly 295 calories, 9 g of protein, 48 g of protein, 48 g of carbohydrate, and 8 grams of fat. (a) Set up a vector equation for the problem. Include a statemenet that says what your variables in the equation represent. (b) Write an equivalent matrix equation, and then determine if the desired mixture of the two cereals can be prepared. General Quaker Mills 100% Natural Cheereos Cereal Nutrient Calories 110 130 Protein(g) 4 3 Carbohydrate(g) 20 18 Fat 2 5 x = number of servings of Cheereos y = number of servings of Oatmeal | 110 | | 130 | | 295 | (a) x | 4 | + y | 3 | = | 9 | | 20 | | 18 | | 48 | | 2 | | 5 | | 8 | (b) | 110 130 | | x | | 295 | | 4 3 | | y | = | 9 | | 20 18 | | 48 | | 2 5 | | 8 | | 110 130 295 | | 4 3 9 | | 20 18 48 | | 2 5 8 | | 1 0 3/2 | | 0 1 1 | | 0 0 0 | <======== | 0 0 0 | Eat 3/2 serving of Cheereos and 1 serving of Oatmeal. A = {{ 110,130, 295 }, { 4, 3, 9 }, { 20, 18, 48 }, { 2, 5, 8 }}; RowReduce[A] ------------------------------------------------------------- Page 101 Problem 12 Budget Rent a Car in Wichita, Kansas, has a fleet of about 450 cars at three locations. A car rented at one location may be returned to any of the three locations. The various fractions of cars returned to each location are shown in the matrix below. Suppose that on Monday, there are 304 cars at the airport (or rented from there), 48 cars at the east side office, and 98 cars at the west side office. What will be the approximate distribution of cars on Wednesday? Cars rented From: Airport East West Returned to | .97 .05 .10 | Airport | .00 .90 .05 | East | .03 .05 .85 | West Monday Tuesday | 304 | | 307 | A | 48 | = | 48 | | 98 | | 95 | Monday Wednesday | 304 | | 310 | A A | 48 | = | 48 | | 98 | | 92 | Long Term distribution: Percentage Cars |0.735294 0.735294 0.735294 | | 74 % | | 331 | |0.0882353 0.0882353 0.0882353 | or | 9 % | or | 40 | |0.176471 0.176471 0.176471 | | 28 % | | 79 | A = {{ 0.97, 0.05, 0.10}, { 0.00, 0.90, 0.05}, { 0.03, 0.05, 0.85}}; B = {304,48,98} Do[ A = A.A, {i,1,10}]; ------------------------------------------------------------------- New Material Definition: A linear transformation does just what any reasonable person would expect. These are (a) T(V+W) = T(V)+T(W) for all vectors V, W. (b) T(cV) = cT(V) for all numbers c and all vectors V. What this says is simply. If you by two sacks of groceries, then what you pay for the two sacks is what you pay for the one sack plus what you pay for the other sack. i.e. Cost(S +S ) = Cost(S ) + Cost(S ). 1 2 1 2 If you by 3 identical sacks, then the cost of all three sacks is three times the cost of the individual sack. i.e. Cost(3S) = 3 Cost(S). ---------------------------------------------------------------- Now you can argue that if you buy in quantities, then you can get things cheaper. Fine! Then the cost is not a linear function. Most processes are linear if the changes are not too large. If you want to produce 10% more cars, you need 10% more labor and 10% more material. --------------------------------------------------------------- In J.I.Case Company in Burlington, they made three kinds of crawler tractors, the 310, the 750, and the 1000. The computer had a list of 20,000 parts which were in the inventory. Whenever an order came in for a tractor, the computer would subtract the parts needed form the inventory. If they wanted to make 3 of the 310, 5 of the 750, and 2 of the 1000's, then Parts( 3 310's + 5 750's + 2 1000's) = 3 Parts(310) + 5 Parts(750) + 2 Parts(1000) Or, as one would expect, the parts function is linear. --------------------------------------------------------------------- The area of matrices limits itself to things which behave linearly. Show that the function | a | | a+b | T| b | = | b-c | is linear. | c | | 2 | | 5 | First: What is T | 3 | ans |-1 | | 4 | | 1 | | 0 | What is T| -1 | ans | 0 | | -1 | Part (i) We have to check that T(V+W) = T(V)+T(W) | a | | x | | a+x | | a+x+b+y | |a+b| + |x+y| | a | | x | T( | b |+| y | ) = T | b+y | = | b+y-c-z | = |b-c| + |y-z| = T| b | + T| y | | c | | z | | c+z | | c | | z | Part (ii) We have to check T(cV) = c T(V). | x | | cx | | cx+cy| | x+y | | x | T( c| y | ) = T| cy | = | cy-cz| = c| y-z | = c T| y | | z | | cz | | z | --------------------------------------------------------------- Any linear function can be represented by a matrix. The matrix for T is gotten by evaluating the situation and writing down just what it has to be. First, Since T converts a vector of length three to a vector of length 2, T must be a 2x3 matrix. | a | | a+b | T| b | = | b-c | | c | T = | 1 1 0 | | 0 1 -1 | ----------------------------------------------------------- Check it with a general vector as follows | 1 1 0 | | a | | a+b | | 0 1 -1 | | b | = | b-c | | c | --------------------------------------------------------------------- Write the matrix for this linear function. | x | | 1x + 2y + z | f| y | = | 2x + 5y - z | | z | | 5x + 4y +24z | | | 1 | | 0 | | 0 | | Notice that the matrix for f is just | f| 0 | f| 1 | f| 0 | |. | | 0 | | 0 | | 1 | | ----------------------------------------------------------------- (a) Write the matrix for rotation of the x-y plane by 90 degrees. (b) Write the matrix for rotation of the x-y plane by 45 degrees. (c) Write the matrix for rotation of the x-y plane by 30 degrees. ---------------------------------------------------------------- What is the inverse for (a). What is the inverse for (b). What is the inverse for (c). ----------------------------------------------------------------- Rotation Dilation: | 1 -1 | = Sqrt[2] | 1/Sqrt[2] -1/Sqrt[2]| | 1 1 | | 1/Sqrt[2] 2/Sqrt[2]| means one rotates it through an angle theta where Cos[theta] = 1/Sqrt[2] and then stretches it by a factor of Sqrt[2]. ------------------------------------------------------------------ f[{a_,b_}] := { {1,-1},{1,1}}.{a,b}; g[P_] := Graphics[Line[{P,1/Sqrt[2] f[P],1/Sqrt[2] f[P],f[P]} ]]; T = Table[g[ {Cos[2Pi/8 i],Sin[2 Pi/8 i]}],{i,1,8}]; Show[%,AspectRatio->Automatic,PlotLabel->"A = {{1,-1},{1,1}}"]; ------------------------------------------------------------------- Shear: There is a line L such that (1) L is left fixed (2) Things not on L are moved parallel to L. i.e. T(v) = v for all v on L. T(v)-v is parallel to l for v not on L. -------------------------------------------------------------------- Show that | 1 1/2 | is a shear. | 0 1 | | a | ----> | a + 1/2 b | | b | | b | For | a | to be fixed, b has to equal zero. | b | So the X-axis is fixed. T| a | - | a | = | 1/2 b | | b | | b | | 0 | So every point is moved parallel to the x axis. -------------------------------------------------------- Suppose that U and W are perpendicular. That is U.W = 0. Show that T[X] = X + (U.X) W is a shear parallel to the line Containing W. T[kW] = kW + (U.kW)W = kW since U.W = 0. T[X]-X = (U.X) W Which is parallel to W. ------------------------------------------------------------ Projection onto a line in direction U for a Unit vector U. p(X) := (X.U)U. /| X / | / | / | / | / | / | /->----------------- Line in the direction of U. <--U.X--> ----------------------------------------------------------- Reflection in a direction U. / X / . / // /\/ `./ / . / // / . / f(X) U f(X) := 2 (X.U)U -X. f(U) = U so U the line through U is left fixed. if X is perpendicular to U, then X switches sign. -----------------------------------------------------------