Systems of linear equations. We turn to the problem of solving for the inputs needed to achieve a given result. For example, in the previous lecture, we were given a specific menu and we wished to compute the resulting nutritional value for that menu. Now you would like to reverse this process, given a set of target nutritional values, what combination of foods will yield those target values. For instance, suppose that we wish to have a combination of eggs, milk and potatoes to reach a specified nutritional target. In this particular case, 23 grams of carbohydrates, 35 grams of fat and 37 grams of protein. We start with a system of equations in three unknowns and we have three equations. In a future lecture, we will discuss the case where the number of unknowns and the number of equations are not the same. But for now, we study the case where they are the same. So we have three equations. One is for carbohydrates. So we have 1 gram of carbohydrate per egg plus 10 grams per cup of milk plus 9 grams per potato. These numbers are a bit fictional, but they serve their purpose that we have here. So if we have one egg, we would contribute one gram of carbohydrate, seven grams of fat and seven grams of protein. So if we have a certain number eggs, milk and potatoes, we can add up this equation and hopefully get 23 grams of carbohydrates. We wish to solve for the property of eggs, milk and potatoes that would reach, achieve these levels of nutrition. To solve for this vector x of unknowns, we must eliminate the variables one by one starting with x1. So here are the set of equations that we had from the previous slide. The first step is to multiply the first equation by -7 to get minus 7x1-70x2-63x3 is equal to -161 and add this equation to the other 2 to eliminate the 2 entries in red boxes. The result is the second to the last two equations that were replaced by this combination. So the second equation is replaced by itself, -7 times the first equation and the last equation is replaced by itself -7 times the first equation and we have eliminated these 2 entries. So now, these three equations have x2 and x3 in them. In the next step, we will take the second equation and add a multiple of it to the third equation to eliminate x2. We continue by adding -62 over 63 times equation 2 to equation 3 in order to eliminate x2 from that last equation and the result is this system here. An upper triangular system in which the last equation only has one variable in it. We can now solve the system starting with the last equation and last variable to get x3 equal to 0. We can then plug x3 into the next equation and solve for x2 to get x2=2. And finally, we can go back to the first equation which, in fact is the original equation. We know what x3 and x2 are, so we can solve for x1 and we get x1 equals to 3. As a practice quiz, we can repeat the process to obtain the number of eggs, milk and potatoes needed to get 13 grams of carbs, 28 grams of fat and 29 grams of protein. The idea is to go through exactly the same process and you should be able to come up with the answer.