Welcome to lecture three on options pricing buyouts transform techniques. I'm borrowing, the last slide of the previous lecture, which was how to price a call option. Simply that was a formula that we had the discounted value of this integral, which is integral, you simply, the payoff of the call option, multiplied by its conditional probability distribution over all possible values for S, which would be from zero to infinity, and of course to get rid of this positive board, we just need to go from K to infinity, which makes this one a non-negative. That means we can simply drop that positive sandwiches, the positive part. Now, what we are trying to do is that we trying to evaluate this integral, and they might be a case that we can do it actually analytically but for this case constraint that we might have, various different [inaudible] is not as easy to do it analytically, the goal is to actually do the evaluation numerically. Now then the next five slides, I will be just discussing the evaluation of the integral. Now, the very first question would come in mind is how to do it? Then, definitely, in case of call options we need to make it a definite integral because it goes from K to infinity for the case of a call. For the put, it would be actually zero to k that we are okay because it's already a definite integral. Now, then the first thing is as I said we have to make it to a definite integral and that simply means as opposed to going to infinity we will go to some large number like B to be determined. Now, then after that, then we have say K to B, what we are doing is we're dividing it into N equal sub-intervals. Then over each of those sub intervals we have a sub-integral and we evaluate each sub-integral. Again, by evaluation means numerical evaluation and we add them up. That's what I'm trying to explain to you how to do it numerically. Then from going from K to infinity, the going from K to B, B large enough and as you see equality becomes an approximation. Then definitely as B approaches infinity, this would approach the true value but if B is large enough, what we are missing is very insignificant that means it can easily neglect it. Now, the evaluation of the integral I'm distinguishing between the call options versus the put options. Now, what I would do is this is the way I would do it. That's not the only way to do it. The way I would do it is I would choose Eta which is the length of each sub-intervals and N independently. That means what happens is I'm not picking B, I'm picking Eta and N. Then I would know what B would be which would set it up as I would sit grid points. Starting definitive from K going to B, which the way I'm looking at the B is, I'm setting up the grid as K plus j minus 1 Eta. J goes from one in case of a one of course, the first starting would be K to N plus 1, which would substitute here would be K plus N Eta, which this K plus N Eta is what I will be calling B exactly as I'm explaining it here. That becomes our upper bound. As I said Eta and N are chosen independently. Now, in the case of put options actually, that's not the case because we already know the upper bound, K, then what we were doing is we just choose N and Eta would become nothing but K minus 0 divided by N, and that becomes your Eta. Then, the way you set up the grid points simply would be going from 0, as I'm saying maybe you should have written this one that way, 0 plus j minus 1 Eta, exactly like this except here it was going from K to B here is already known that the minute that you go to N Eta, that N Eta becomes the K that we have. I just want to make sure that you distinguish between these two, and you will see it in a python could actually I'm actually respecting that as well. Now, setting that one up then what we are having as we have this sub-intervals, say one of them would be Sj to Sj plus 1, and we have N of these. That's why I'm writing that approximation that we had this I and rewriting this as that one now, which you seem would be N of these sub-integrals. That's exactly what we mean over each of these sub-intervals. Now I am taking one of those out, and I'm trying to evaluate it and what I would do for evaluation is I'm using actually trapezoidal rule. Simply means, going back again to this I'm assuming this is Sj, this is Sj plus one. I'm going to exaggerate a bit. Let's assume this is what you're trying to find the area underneath, that's what integral means. But as opposed to finding it analytically, I'm assuming I'm finding the area underneath but using trapezoidal rule. Exactly like that, that means I'm adding this to that multiplying them by this one, the length which is Eta divided by 2. That's exactly the Eta divided by 2. This one is the length over here which means simply we substituting Sj here, that is what I am doing and then the other one would be exact same thing evaluated at Sj plus 1. What I'm missing is this part. This is what you are missing in our approximation, and then remember, as Eta gets smaller, definitely an approximation to become more accurate and you're going to see it because I have some numerical examples for you. Now we simply substitute this one back into the sum, which is I am rewriting it here. That means for this one, I'm substituting this approximation for it via trapezoidal rule and what you can do is if you expand this because now you're having insights, some you have this plus that. But if you expand them and sum it up, you will actually get just this expression for Wj being Eta over two in the case of j1, otherwise Eta. That should be clear the reason for this because the neighboring trapezoid, if you look at it one more time, something like this. This one, not in common, that one in nothing common, but this would be in common. That is why even you're doing Eta divided by 2 in trapezoid, this gets counted twice, that's why anywhere else you would get Eta except for the very first one and the very, very last one. You may ask me what happened to the very, very last one, I'm not seeing it here actually dropped it. The reason I can't drop it is because I'm sensing that it's so small enough that I can neglect it. I'm going to leave this one as an exercise. What I would do is when I'm setting up the quiz problems, I actually want you to actually explore the switch, you can do it easily in one line. Now let's make sure we understand the computational cost. By computational costs, I mean roughly, if this operation I call it as one operation how many of those operations should I do, that would be n of them. That is why the operation cost is O and it's very, very important for us because as you will see later on when we're trying to do say M other options, that means with this method, operations would become M multiplied by N. That's very important to know because for each option, if it's O N for M options that would be OMN. It's always important to keep track of computational cost. Now, I will do exact same thing now for Put without going through the entire derivation, simply would be exactly some of the call except for j minus Sj, and of course, you already know how to set up the Sj for the put if you go back to the previous slides, which also in the Python code you will see exactly the way I have done it. Exact same computational cost, exact same one. Now, let's go through the example, first I am going through the example, then I'm going to go through the Python code. For the example, I'm looking at the simplest possible-