 What if we want to predict a value based on two or more inputs, for example, the price of a home based on the number of bedrooms to the number of bathrooms, the age of a person based on their income and number of children, or the price of tea in China based on the direction of the trade winds and the number of whale sightings? As before, we want to predict an output Y based on the inputs X1, X2, and so on where the coefficients are the unknown values. And the important thing to remember is, nothing important changes. So for example, suppose we have some data on recent home selling prices based on the number of bedrooms and bathrooms. Let's find a best fit multilinear function P equals Px plus Qy plus R, where P is the selling price in thousands, X is the number of bedrooms, and Y is the number of bathrooms, and while we're at it, let's use our formula to predict the selling price for a home with three bedrooms and three bathrooms. So as before, our data corresponds to a system of equations. We'd like to be able to predict the selling price based on the number of bedrooms and bathrooms. So with three bedrooms and one bathroom, then 3P plus 1Q plus R should be 395. And similarly for four bedrooms and one bathroom, our formula should predict a price of 444 and so on for all the rest. And so we can write our system in matrix form. We have our coefficient matrix, our column vector of variables, and our column vector of constants. As before, we'd like A applied to X to give us that column of constants, but that generally won't happen, and so again, we'll minimize the norm of AX minus B, which we can do by solving A transpose AX equals A transpose AB. So filling in our matrices, simplifying, and solving gives us... So let's try and check our formula against our observed values. If this is the correct formula for predicting the selling price of homes, then its prediction should be at least close to the actual selling prices. So we'll check it against some of our data, how about these first three homes with 3141 or 4-2 bedrooms and bathrooms, and we can predict a selling price based on the formula of, which is a pretty good fit to the actual selling price. So we have some confidence that our formula will give us a good prediction. So let's use it to make a prediction. If we have a house with 3 bedrooms and 3 bathrooms, the formula predicts a selling price of about $525,000.