Math 6: Ecel Lab 6 Summer Inverse Matrices, Determinates and Applications: (Stud sections, 6, 7 and in the matri book in order to full understand the topic.) This Lab will illustrate how Ecel can help ou find and use the inverse of a matri. Recall, a square matri A has an inverse matri (denoted A - ) if it is true that the matri multiplication A*A - I (the identit matri). Using Ecel to Find A - : Eample : Given matri A, as shown below, use Ecel to find A -. A Using the same procedure that was used in Project, enter matri A and its label into an Ecel spreadsheet: Since A is a matri, A - will also be a matri. Tpe the label "A^(-)" into the desired cell (in our eample, this is cell A). To the right of the label, highlight the block of cells that will contain the inverse (cells B to D7 in the eample). While the block of cells is still highlighted, tpe the following command: minverse(b:d). Now press the ke combination Shift-Ctrl-Enter, as ou did for matri operations in Project. Check our answer - it should look like the following:
When A - eists, the inverse can be used to solve a sstem of equations. Now that ou know how to use Ecel to find the inverse of a matri, eamine the following to see how to solve a sstem of equations using the inverse of the coefficient matri. Solving a Sstem of Equations: Eample : Consider the following sstem of equations: This sstem can be rewritten in matri form AX B where A is the matri obtained from the coefficients of the variables, X is the matri obtained from the variables, and B is the matri obtained from the constants. A, X, B giving the following matri sstem of equations. Given that matri A is invertible (i.e., has an inverse), use Ecel to find A - : The following steps show WHY the process of finding a solution to a sstem of equations AX B works when A - eists.
. Original sstem of equations and A - :, A -. Multipl both sides of the sstem of equations b A - :. Recall: A A - I, so simplif the left side of equation and complete the multiplication on the right side: 7 7. Since I is an identit matri, I X X, so simplif the left side of equation. 7 7. So -7, -7, and - is the solution to the sstem of equations since these are variables that make all three equations in the sstem true. Rule: If A is an invertible matri (i.e., A - eists), then the matri equation AX B has the unique solution X A - B. Note: For matri A, ou were told that A - eists. Suppose ou don't know whether the square matri in our problem has an inverse. There are various tests (some of which will be discussed in this course) to determine if a matri has an inverse, but ou can also tell from the output obtained b using Ecel's minverse command. In the following, matri A (which was known NOT to have an inverse) was entered into the Ecel worksheet. The correct steps were followed to generate the inverse of A, but note the contents of the cells that were chosen to contain the inverse. The #NUM! notation that appears in those cells indicates that no inverse eists.
Sstem of Equations (an Eample): (See section in the matri book for additional help, if necessar) The following problem is an eample of an application problem that can be solved using an inverse matri. Eample : John, Mar, and Julie went to the same grocer store to bu sugar, coffee, and butter. John bought pounds of sugar, 6 pounds of coffee, and pounds of butter for $; Mar bought pounds of sugar, pounds of coffee, and pounds of butter for $; while Julie paid $ for pounds of sugar, pounds of coffee, and 6 pounds of butter. Find the selling price per pound of each item. Let X where the price (in dollars) per pound of the price (in dollars) per pound of the price (in dollars) per pound of sugar coffee. butter John, therefore, paid $ for sugar, $6 for coffee, and $ for butter. So he spent a total of $( 6 ). Since it is given that he spent $, the first equation becomes 6. Following the same technique for Mar's and Julie's purchases to obtain the other two equations, we get the following sstem of equations: 6 6 This can easil be converted into a sstem of equations in matri form as follows: 6 6 Setting up and solving the sstem in Ecel gives the following: A 6 B 6 A^(-) -. -..66667. -. -.. -.8 X A^(-)*B.6.. Using our definition of X and the variables,, and, ou determine that the selling price for sugar is $.6 per pound; coffee sells for $. per pound; and butter is $. per pound.
NOTE:When finding inverses, ou ma find that ou want to change the appearance of some of the number values in our spreadsheet. There are two tpes of numbers for which this ma be especiall desirable.. You often will have unwield decimal answers and ma wish to reduce the number of decimal places that are displaed. This does not change the actual value that is retained in memor, onl the decimal representation that is displaed on the screen and printed in our report. To make this change, highlight the cells containing the displa that ou want to change and click on the decimal icons in the toolbar. The decimal icon shows decimals, eros, and arrows. There is one for increasing the number of decimals displaed and another for decreasing the number of decimals. To reduce the number of decimals displaed, simpl click on the appropriate icon. Continue clicking on the icon until ou have the decimal representation ou desire. An alternative method of adjusting the number of decimal places is to highlight the desired cells and select Format-Cells-Number from the toolbar. Then choose the desired number of decimals.. The second tpe of number that ou ma wish to change is a value that is displaed in a format similar to.7e-6. This particular value is scientific notation for.7*^(-6). The corresponding decimal representation for this value is.7. For all practical purposes, because this number is so etremel small, it ma be interpreted as ero. (In fact, values such as this often show up in cells where ou would obtain a ero value if ou were finding the inverse b hand but are displaed in Ecel as etremel small non-ero values due to rounding.) You ma wish to replace values such as this with ero. You must be careful, however! Tring to edit an output matri in Ecel will cause our Ecel program to "jam". In order to edit the output values, ou must convert the commands in the output cells to actual numerical values. To do this, first highlight the entire matri, then select Edit-Cop. Leave the entire matri highlighted (remember, ou are pasting over the same cells that ou copied from) and select Edit-Paste Special. A dialogue bo will pop up on the screen. You should select Values and then click on OK. This converts all of the cells in the matri to regular numerical values. Now ou ma delete a value and replace it with another value such as ero. Problems to turn in: (Part ) Work through the eample problems in the lab introduction before attempting these problems. Do not turn in the worked eamples from the introduction. Also, do not hand in this document with our lab. Work all problems in order. Do not sa see attached or other notation referring the grader to another location in the lab for part of a problem. Label problems and parts of problems with appropriate numbers and/or letters. Everthing on this lab should be tped ecept where specificall stated that hand-written work is allowed. In those cases, leave space in our document to NEATLY write the appropriate solution b hand. Use Ecel and Ecel's matri operations to complete all of the following problems.. Find the inverse for each of the following matrices, if that inverse eists. If the inverse does not eist, clearl sa so. (a) A (b) B 6
. A television manufacturing compan makes three models of television sets. The processes used in building the TVs are wiring, assembl, and testing. The time (in hours) that each model requires is provided in the following table. Wiring Time Assembl Time Testing Time Super Model 6 Delue Model Regular Model Hours available var from month to month, so the compan needs to determine the number of each tpe of TV that will be produced during a given month. The number of hours available during Januar are 6 hours of wiring time, hours of assembl time, and 8 hours of testing time. (a) Set up the sstem of linear equations to represent this problem (see following note). Use the variables of our choice, but don't forget to define our variables. You should leave space in our printed work and neatl write the sstem b hand on our printout. Note: Unlike the eamples that we have done in class the information ou need is found in the columns rather than the rows. When information is in a table, it ma or ma not be used in eactl that position. Because the total amount of wiring time available for assembl is 6 hours, the wiring time used for all models must add up to that amount. This requires looking at the wiring time column. To solve the sstem and find the number of TVs that will be manufactured during Januar, the method of solution will use the inverse of the coefficient matri. This will also allow future production levels to be quickl determined. (b) Solve the sstem to determine the number of TVs that can be made during Januar. State our answer in a complete sentence using terminolog appropriate to the contet of the problem. (c) The number of hours available during Februar are 67 hours of wiring time, hours of assembl time, and 7 hours of testing time. Solve this new sstem using the same inverse that ou found before (do not find the inverse again). State our answer in a complete sentence using terminolog appropriate to the contet of the problem. Determinants and Cramer's Rule In previous projects ou have eplored the use of Ecel to perform a variet of matri operations and using these operations to solve sstems of equations. In this project ou will be studing a function associated with matrices called the determinant. The input into the determinant function is a square matri and the output is a real number. The notation det(a) is used to indicate the determinant of matri A. 6
Determinant of a Matri: There is a simple rule for finding the determinant of a matri b hand: Rule: If M is the matri a M c b d, then det(m) ad - bc. Eample : Given Solution: M, find det(m). det(m) ()(-) - (-)() - 6. Note: Another standard notation that is used to indicate the determinant of a matri is to replace the square brackets surrounding the matri with a pair of parallel lines. For instance, the determinant of the matri in Eample can be written as det(m) (as shown in the eample) or as. Using Ecel to Find the Determinant of a Matri: As demonstrated in the above eample, finding the determinant of a matri is a simple process, but finding the determinant of a larger matri can be ver tedious. Ecel, however, has a command that makes it eas to find the determinant of an square matri. Eample : Given C, use Ecel to find det(c). Begin b entering our matri into an Ecel spreadsheet: 7
In order to use Ecel to find the determinant, tpe in the label "det(c) ". To the right of the cell containing the label, highlight one empt cell, tpe in the command mdeterm(b:d), then hold down Shift-Ctrl kes and hit Enter. This leads to the following results: C det(c) - Therefore, the determinant for C is given b det(c) -. The determinant of a square matri is a tool that has man useful applications. This project will be focusing on two of those applications. The determinant of a square matri, A, can be used to discover if A - eists, and determinants can be used to solve certain tpes of sstems of equations. 8
Solving a Sstem of Equations Using Determinants: Determinants can be used to solve a sstem of equations if the coefficient matri of the sstem has an inverse. This method of using determinants to solve a sstem of equations is called Cramer s Rule. Eample : Consider the following sstem of equations: When using Cramer's Rule to solve a sstem of equations such as this, first write the matri equation for the sstem in the form AX B: Net find det(a) to see if A - eists. If it does not, this sstem cannot be solved using Cramer's Rule. Note that A is the same matri as matri C in Eample. Since det(a) det(c) -, A is invertible. Now create new square matrices. You ma name the matrices with an variable names that ou wish (as long as the names ou choose are not A, X, or B, since those are alread used in this problem). For purposes of eplanation, in this eample the matrices are named A, A, and A. Net create matri A b replacing column in matri A with the entries in matri B; create matri A b replacing column in matri A with the entries in matri B; and create A b replacing column in matri A with the entries in matri B. A, A, and A Now find the determinant for each of the three new matrices:
A B det(a) - A det(a) - A det(a) - Using Ecel (as shown above), ou should find that: det(a ) -, det(a ) -, and det(a ) - (Notice the determinant arra is alwas written with straight sides). Now ou should have determinants: det(a) -, det(a ) -, det(a ) -, and det(a ) -. Using these determinants, and the following equations, ou are able to find the solution to the sstem of equations: In general, det(a), det(a) det(a ), and det(a) det(a ), so for this problem, det(a),, and Cramer s Rule ma be used to solve the same tpes of sstems of equations that can be solved using the method of inverse matrices. That is, both methods are onl useful in solving sstems that have a unique solution.
Problems to turn in: (Part ). Find the determinant of each of the following matrices using Ecel. (a) A. Each week at a furniture factor there are work hours available in the construction department, work hours available in the painting department, and work hours available in the packing department. Producing a chair requires hours of construction, hour of painting, and hours for packing. Producing a table requires hours of construction, hours of painting, and hours for packing. Producing a chest requires 8 hours of construction, 6 hours of painting, and hours for packing. You want to use Ecel to determine if all available time is used in ever department, how man of each item are to be produced each week. Using,, and to represent the number of chairs, tables, and chests, respectivel results in the following sstem of equations: 8 6 Solve the sstem using Cramer's Rule. Clearl state our final answer in a complete sentence using appropriate units.