The last topic that I'm going to talk about in this module is that of optimization. Now earlier on, I 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 had called it demand model, where the quantity demanded of a product, and here's the model, is equal to 60,000 times price to the power -2.5. So I'm presenting you with that model. Now you're sitting there thinking, 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 did these models come from when I talk about regression in one of the other modules. So even though this looks like it's being pulled out of thin air, there is a basis for creating these models that we will discuss. But for right now, I just want to show you this deterministic model. So let's say our model for demand is quantity equal to the 60,000 times price to the power -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 at $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, get whatever you want. You could set a very low price, and you'd 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 trade-off between price and quantity sold. And we're trying to figure out how to hit the sweet spot in that trade-off, in order to maximize our profit. So what is profit? Well, usually we think of profit as the revenue minus the 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. That's right, 2 times 10. So that's all that's going on there. We write that more generally as p times q, price times quantity. Now, the profit is the revenue minus the cost. So the profit equals pq, which is our 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 equals 60,000 times price to the power of -2.5. So putting it together, we can see that our profit is equal to 60,000 times price to the -2.5, that's the quantity, times (p- c). And in this particular example, I'm taking the cost of production at $2 per unit, so that's (p- 2). So now 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 are 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 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. That'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 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 at $2, then I don't make any profit whatsoever because my price is exactly equal to my cost. So you get zero 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, the 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 really trying to figure out at which value of p, the x-axis, is the profit the highest? Where is 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 in 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 three and four. But I don't know exactly where between three and four it is. So this gives me a sense of where the answer is. And it might be fit for use. It might be enough for you to say, I just want to set the price between three and four. 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 approach 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, 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 the, I'm going to present you with the results. If you're interested in calculus, well, and it's 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 P-opt, opt for optimal, is equal to c times b over 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 2, that was the cost of production. And b was equal to -2.5. If I plug in those numbers to those equation, you can convince yourself that the optimal value for p, for the profit, is about equal to 3.33. It's really 3 and a third, is the best value for price. So that is the 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 -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 of -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 -2.5. And one might say the price of elasticity of demand is 2.5 for this particular product. What that -2.5 means in terms of the business process is that as you increase price by 1%, you can anticipate in fall in quantity demanded of 2.5%. So the coefficient relates percent change in x to percent change in y. And the -2.5 means that as x is going up, y is going down. So a 1% increase in price is associated with a 2.5% fall in quantity demanded. And that proportional 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 proportionate change between x and y is a constant. And in this case, it's -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 -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 gray 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 c, 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 is 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 at p at which the area of the gray 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 at which this gray shaded box is maximized. And we know from having gone through the calculus approach, that it's at p equal to 3 and a third, 3.33. Now that completes the topic that I wanted to talk about in this module on deterministic models. Remember, deterministic was the antithesis of probabilistic or stochastic. Deterministic model says no uncertainty anywhere.