The last topic that I'm going to talk about in this module is that of optimization. Now earlier on I had talked a little bit about optimization when we have linear functions and linear constraints. That was known as linear programming. Now, I'm going to show you some optimization in what I would term a more classical sense. So, I'm going to use the mathematical technique calculus now to help solve an optimization problem. And remember, I had said previously that one of the key uses of quantitative models is as inputs to optimization decisions. So, businesses are always trying to optimize their performance in some way. So optimization problems can sometimes be solved using a calculus approach, and that's what I'm going to show you. So let's go back to the model that we had used to understand the relationship between the price of a product and the quantity demanded, and ask ourselves the question, can we find the optimal price in order to maximize our profits? Now, to do that, I've gotta put a little bit of a notation in place, so that's going to happen on this slide. So let's consider the model we had looked at before. We call it demand model, where the quantity demanded of a product, and here's the model is = 60,000 p to the minus 2.5. So, I'm presenting you with that model. Now, if you're sitting there thinking like where does he get a model like that from? Well, that question actually isn't what I'm trying to do right now in this particular module. I'm going to talk about where do these models come from when I talk about regression in one of the other modules. So even though this looks like it's been pulled out of thin air, there is a basis for creating these models that we'll discuss, but for right now, I just want to show you this deterministic model. So let's say our model for demand is quantity = 60,000 price to -2.5. That shows me how quantity is related to price. Further, I'm going to assume that the price of production is a constant, act two, $2 for each unit. So every unit that I produce costs me $2. Now here's the question. What price is profit maximized at? So you can choose price. It's your product, do whatever you want. You could set a very low price and you'll probably sell a lot, but if the price was lower than your cost of production you wouldn't be making any money. You could set a really, really high price for one of these objects that you're selling, and you'd get a lot if you sold one, but you wouldn't sell many units. So there's this tradeoff between price and quantity sold. And we're trying to figure out how to hit the sweet spot in that tradeoff in order to maximize our profits. So what is profit? Well, usually we think of profit as the revenue- cost. And revenue can be written as the price that you sell the object at times the quantity that you sell. So if you're selling candy bars, they cost $2 for someone to purchase, I mean the price is $2 and you sell ten of them, then your revenue is $20, right? Two times 10, so that's what's going on there. We write that more generally as p x q, price times quantity. Now, the profit is the revenue- cost. So, the profit equals pq which is the revenue. Now what is the cost of producing q units? Each unit costs c dollars to produce, and I'm going to produce q of them. So the total cost according to this model is c times q. So I can simplify that equation into q(p-c). So that's the profit that we're going to make. But we've got a model for q in terms of price and that model says quantity = 60,000 Price to the power -2.5. So putting it together, we can see that our profit is equal to 60,000 p to the negative 2.5, that's the quantity, times (p- c) and in this particular example, I'm taking the cost of production at $2.00 per unit so that's p- 2. So now you're looking at an equation that has come out of the quantitative model for quantity. And I am now going to ask at what value of p is the profit maximized? So choose profit p to maximize this equation. So this is what we mean by an optimization. As I said before, optimization is one of the things that we tend to do with our quantitative models. So how we going to do it? Well there is a brute force approach to this. We've got a function for profit. Let's just choose different values of price, which I'm writing as a little p, and plug them into the function and see what the profit looks like. And so in the table on this slide you can see I've plugged in different values for price. It's in the price column and I've used the equation, the model to figure out what the profit is. So if I charge $1.75 for this product I actually don't make any profit off of it at all. There's a negative profit, otherwise known as a loss, and of course, that makes perfect sense, because 1.75 is less than the cost of production, which is $2. If I were to price it $2, then I don't make any profit whatsoever because my price is exactly equal to my cost. So you get 0 for the second one and then the subsequent numbers in there are just coming out of the profit equation. Now if I look down through that table, that optimization just corresponds to finding the biggest number in there. And I've drawn a graph that shows you the profit as a function of price. And you're already trying to figure out at which value of PDX axis is the profit the highest. Where's the top of that graph in other words? So, this is a brute force approach because I haven't actually tried every value of p. If I'm implementing this in a spreadsheet, spreadsheets have cells and each cell you can only put in one number. And so it's a discrete approach to solving this problem, and it looks to me that the best value of price is somewhere sitting between 3 and 4, but I don't know exactly where between 3 and 4 it is right? So, this gives me a sense of where the answer is. And it might be fit for you, say it might be enough for you to say, I just want to set the price between 3 and 4, but optimization does give us the potential to be a bit more precise about it, so that's what I'm going to do now. So, the calculus approached to these problems involves the mathematical technique of differentiation and what we need to be able to do is to find the derivative, which means the rate of change of a function, with of the profit with respect to price, and we need to see where that derivative equals to zero. So optimization, the actual mathematics of optimization, is not the goal of this course. The goal of this course is to talk about modeling, and this is one of the places that models are used. And so I'm not actually going to do that, I'm going to present you with the results. If you're interested in calculus one you can, and its use in business you can certainly find other courses that will address that. So I'm just going to skip to the answer here, it turns out that by applying calculus to this problem you can obtain the optimal price. And the optimal price which I'll write as Popt, opt for optimal, is qual to c b / 1 + b, where c is the production cost and b is the exponent in the power function. So with this neat little mathematical model that we had for quantity demanded as a function of price I'm able to leverage that equation, leverage that model, and come up with an answer to the question. What's the best price to set in order to maximize my profits? Now, going back to this example, c was equal to 2, that was the cost of production, and b was equal to negative 2.5. If I plug in those numbers to the equation, you can convince yourself that the optimal value for p, for the profit, is about equal to 3.33, it's already three and a third is the best value for price. So that is solution to the problem. And by creating, or using a simple model for the quantity for the demand I'm able to end up with a simple model, you can even call it a rule of thumb if you want, a simple formula for pricing. Now, in terms of interpretation again, well, we know what c is, that was the cost, that coefficient the minus 2.5 in the power function model that we're looking at, remember this model for demand is a power function model. It was 60,000 times price to the power negative 2.5. That's a special quantity, the exponent b in this situation and it gets called the price elasticity of demand. And so, oftentimes economists will put a negative in front of that because the coefficient is negative 2.5. And one might say the price elasticity of demand is 2.5 for this particular product. What that negative 2.5 means in terms of the business process is that as you increase price by 1%, you can anticipate a fall in quantity demanded of 2.5%. So the coefficient relates percent change in x to percent change in y, and the negative 2.5 means that as x is going up, y is going down, so a one percent increase in price is associated with a 2.5% fall in quantity demanded and that proportionate relationship, proportional change in x to proportional change in y is true for any value of x. That's what's very special about the power functions that that proportionate change between x and y is a constant and in this case, it's negative 2.5. And, as I say, people might call the price elasticity of demand here, 2.5. So that's the calculus approach. And I'll finish this off with a slide that shows you what the calculus approach is doing. The blue curve is the demand equation. That is the curve 60,000 times price to the negative 2.5. So that shows how price and quantity demanded are related. Now for any value of the price, so fix the price, stop the box moving, means fix the price. For any value of the price you can go up to the curve and record what that point is. That will define a box. And that box that's the light grey shaded area in the graph here actually is the profit that's associated with that price. And you know it's the profit because the width of the box is p minus z, that was price minus cost and the height of the box is q, the quantity demanded. Remember, that was how we were able to write our profit here as q times p minus c. So q is the height of the box, p minus c is the width of the box, the product of those two numbers is the profit, and the product of those two numbers is the area of the box. So what the calculus approach does is take your quantitative model, which is the blue curve here, that's what we contribute with the modeling, and then we do the optimization which is simply to find the value of p at which the area of the grey shaded box is largest. If I can find that value of p, I've solved the optimization problem. And so again, one of the nice things about these quantitative models is they can help you visualize the solution to a problem. And without this visual here it's hard to kind of see in the same way as to what we're really trying to achieve, and as I say, what we're trying to achieve when we maximize the profit is essentially to find the value of price of which this grey shaded box is maximized. And we know from having gone through the calculus approach that it's at p equal to three and a third, 3.33. Now that completes the topics I wanted to talk about in this module on deterministic models. Remember, deterministic was the antithesis of probabilistic or stochastic. Deterministic models has no uncertainty anywhere.