 Okay, so I will just clear up one issue that we had left over from last class, right and then there is one topic that I want to talk about because that brings me to a summary of some of the things that we have been doing in this course, okay. And then in tomorrow's class we will do a closure so you can tell your friends and everybody to be ready to try to recollect what we did in the last 40 plus classes, is that fine? Okay, so we will try to make that a collective affair, we will see if we can together recollect what happened in the last class, an overview, right, so that is fine. Now before I go, so we had there was some issue, we had a problem, we had J of U as integral a to b x squared given U of a, we called it U sub a and U of b as U sub b, right, this is what, this is where we were and I had discretized this using hat functions and got something that looks like this. I will just sort of write this out, you can work out, right, you can work out if there is some issue. And the whole point is actually, you have to just go through it blindly, the minute you start counting you can start making mistakes. So this turned out to be a 1 over 2h if I remember right, I am doing this from memory so just make sure that I do not make any mistakes, i equals 1 through n minus 1 minus Ui Ui minus 1 plus Ui squared plus Ui Ui plus 1. I should really write the secular terms in front so that there is no confusion with, I make a mistake minus, did I get a 2 Ui squared, okay, is that fine, okay. And then of course you have these terms which is plus Ua squared by 2h plus Ub squared by 2h, right. So what we do is we want to find the extremum, we want to find, depends on maximum and minimum depends in fact on whether you, how you write, right, whether it is minus Uxx squared or minus Uxx or Uxx. I differentiate this with respect to Uj as I said because the second example I gave I did this funny counting, right and if you want to check this out you can actually count and see. So what does this give me? This gives me 1 over 2h summation i equals 1 to n minus 1 and we just go through this blindly, okay. So this gives me minus dou Ui dou Uj Ui minus 1 minus Ui dou Ui minus 1 dou Uj plus 4 Ui dou Ui dou Uj then minus dou Ui dou Uj Ui plus 1 and sort of learning out a space where I will write it underneath, minus Ui dou Ui plus 1 dou Uj, okay and this whole thing is in the under the summation, constants of course disappear, is that fine, okay. So if you say j equals 1 or j, right, j equals some particular value then obviously depending on what is the dou U2 dou U1 is 0, right. So only if i equals 1 it works, right. So this is going to work. So each one of these derivatives is going to work. So if j equals 1 only if i minus 1 is 1 it works, right. So you find out when these are non-zero. So this is non-zero if i is j. This is non-zero if i minus 1 is j, right. This is non-zero if i is j. This is non-zero if i plus 1 is j. Am I making sense? Is that okay? And this is non-zero if i plus 1 is j. This should be i equals j, i equals j. So if you say i equals j then that becomes j minus 1. If i is j then that becomes j minus 1. So this is minus Uj minus 1. This is Uj plus 1. This one is 4Uj minus Uj plus 1 and this should be Uj minus 1. This is the derivative for j equals 1 through n minus 1, right. Now we are going to pick each of the j's. So each one of the j's j equals 1 we differentiate set it equal to 0 get an equation. j equals 2 we differentiate set it equal to 0 get an equation. You understand? So we will get a bunch of these equations. We are going to set it equal to 0 and this is 4j equals 1 through n minus 1. You understand what I am saying? Okay. This is 1 over 2h outside that I have left out. Okay. So this is just by way of otherwise, so this is Uj minus 1 plus 2Uj minus Uj plus 1 by h. Okay. Multiply and divide by h it obviously looks like the second derivative being set equal to 0. Is that fine? Okay. Fine. Yeah. So I just wanted to clear that up. The other possibility is actually if you enumerate since it is in one dimension you can actually enumerate. You can count them. Okay. You can count them and you may get a different recursive formula here or you may get a different expression. You could write it in a different fashion right because they are sums. You can combine them in different fashion. So if you wanted to collapse, you wanted to combine this with that you could actually do it. If you rewrite the sums a little you could write this as jh of U is 1 over 2h oops 1 over h and I am just doing this from memory. So you can check it out later. Summation minus Ui Ui minus 1 plus Ui squared plus Ua squared by 2h i equals 1 through n. So the n is there minus Ub squared by 2h. You can check this out. Okay. The nth one here shows. So you can rearrange these terms. It is just a matter of how you collect the terms. Okay. There are different ways by which you can combine the terms. So you could get something of this sort. If you wanted to combine the i plus 1 term with the i minus 1 term. But my suggestion is all of this work you can do this kind of stuff very easily when you are dealing with 1d, one-dimensional. The problems are relatively separate. It gets a little messy even once you go to multiple dimensions. Okay. So I bring the calculus of variations. It is not as I said it is not quite finite element method. But you have an idea that you can use these hat functions and various basis functions that we developed to solve differential equations. There is a variational form. So you have the differential form, the differential equation form and then there is a variational form that is associated with that differential equation. There is a relationship between them. Okay. So there is a completely different class of techniques that you may or may not have seen earlier. Okay. There are completely different class of techniques. That is fine. Now what we will do is we will change gears a little. Right. So it is sort of an abrupt change from what we are doing so far. But it is okay. It does not matter. I mean since we are near the end of the semester it is a natural progression. You know generally I am going to pick a topic which is normally taboo in most cultures which is gambling. So gambling is illegal. Supposedly legal in India. I say supposedly because if you go do the right paperwork I can actually come to you and make a bet. I could bet for instance that I am going to, I bet 1000 rupees that I am going to die tomorrow. Right. And you can say no, no. I bet 1 lakh rupees that you will not. You would of course be an insurance company and I would be a person who is coming to you paying 1000 rupees is a premium. Making sense. So there are, this business of gambling is a very, very strange, very strange thing. So there are lots of situations if you actually look at it you can finally decompose it into some form of a gamble. Okay. Some form of a gamble. Right. So I give that example of insurance to rationalize the fact that I am going to give, take gambling as a motivation. Okay. A game of chance. Let me call it instead of gambling let us call it a game of chance. So there are two players in this game of chance. The two players are for lack of anything better I will call them A and B. There are two players A and B in this game of chance. Between the two players they have some token. They are 100 chips. Tokens are what they use to figure out who is winning, who is losing. So between the two players they have 100 chips. Okay. So at any given time, at any given time if A has x chips, B has 100-x chips. What we would call a zero sum game. Okay. So if A wins, B loses. Right. So there is no win-win situation here. That is what I mean when I say it is a zero sum game. Right. So we simply if B wins, A loses. So we know that if we know the story of one of them we know what is the story of the other. It is a complementary story. So we would like to know, we will just look at A. We will now ignore B. We will just look at the story of A. What is the story of A? So you can be wondering what the heck does this have to do with CFD. So we will see whether it has, whether the story has anything to do with CFD or what we have been doing so far. So if A has x chips, now we are concerned. Now we ask the question, what is the probability that A will be ruined? By A will be ruined means through a sequence of events that A has zero chips. Okay. So what are the events? The event is what is called a round. After each round, right, after each round, whatever that round is, there is a probability, there is a probability P that A will win the round and if A wins the round, one chip is transferred from B to A. Okay. So with the probability P, with the probability P, right, at any given round, A will win that round. With the probability Q, so this is win. With the probability Q, A will lose the round. Is that fine? Everybody. So yes, this is all very nice. This is that single round, but what I would like to know, what A would like to know, right, what I would like to know is if A has x chips, what is the probability of ruin? What is the probability that A is ruined given that A has x chips? You understand what I am saying? So we will call that probability, probability of ruin, probability of ruin because of A given x chips, we are just setting up the problem. We are doing, we are doing, so that is Q of x. Is that fine? Probability of ruin is Q of x, fine? Everyone. So now you start. We basically say that A starts with x chips. You start the, start the process. You go round 1, round 2, round 3, round 4 and you ask the question what happens. So if you are at, if you are at round 1 and you have x chips, so Q of x, Q sub x is the probability that you get, that A gets ruined. After one round with probability P, it could be x plus 1 chips and the probability that A gets ruined with x plus 1 chips is Q of x plus 1. What is the other possibility that you lose? The probability Q and you have Q of x minus 1 chips. So the probability that you get ruined having x chips is in fact the probability that you go to x plus 1 and then get ruined P into Q of x plus 1 plus the probability that you go to x minus 1 and get ruined plus Q into Q of x minus 1. So just say it can be, if one of them is not cheating then P is likely to equal Q. They are not cheating. I say PQ, one of them may be cheating but if they are not cheating then P is likely to equal to Q. But we know that P plus Q is 1. There are only two possible, I have enumerated the two events. There are only two possible events. So you either go from here, you transition. I use the word transition. You transition from x to x plus 1 with the probability Q. You understand what I am saying? Or you transition from x to x minus 1 with the probability P here, the probability Q there. So Qx would be this. Now if it turns out that neither of them is cheating and it is an even game then P equals Q equals equals 1 half. So this tells me that if I substitute Qx equals Qx plus 1 plus Qx minus 1 divided by 2. This is round n. This is round n. This is round n minus 1. I will count the other way around. I will count the other way around. So this is, I will decrement instead of incrementing. And now this is starting to look familiar. So what I do is I subtract, I subtract Qx minus Qx n minus 1 from both sides. So I get Qx n minus Qx n minus 1 equals Qx plus 1 n minus 1 plus 2 Qx n minus 1 Qx minus 1 n minus 1 subtract. So I have minus divided by 2. This 2 comes because in the denominator I have a 2. This looks like heat equation. This looks like the discretization of heat equation. Is that fine? So we started off with 2 gamblers. We are talking about the ruin and we end up with a heat equation. What is the deal? How does this help us? What does this do for us? What does this do? It looks like the discretization of heat equation. This is 1 half. You remember the stability condition for heat equation? That is, we created a, we had a parameter. This is lambda. 1 half is lambda. Lambda equals 1 half. If you go back to the heat equation which was kappa delta t by delta x squared, okay. That is exactly at that stability margin, at that stability on the edge of that stability envelope, okay. So yeah, it is a heat equation. It looks like the discretization of the heat equation. So before, okay, let us see. So we have the heat equation. We need boundary conditions. Where do the boundary conditions come from? This is all very nice. This looks like the discretization of the heat equation. Where does the boundary condition come from? You go back here. Go back here. If x has 0 chips, then the probability that x loses is 1 because you are not, that is it. You have nothing. The game does not go on anyway. You understand what I am saying? So q of 0, q of 0, q0 of 0, q sub 0 is 1, right. And if x has 100 chips, then the probability of loss is 0 because you have already won. You understand? So the boundary conditions are this q of the probability of ruin if you have 100 chips is 0. Is that okay? Is that fine? Okay. So here it looks like our usual heat equation, discretization of the heat equation. We have the boundary conditions. So that is a 100, 0, that is a grid point 0, that is a grid point 100, and q of 0 is 1, q of 100 is 0, okay. And what you would do is you would take in between, you would take values and you would take the averages, keep evolving in time. It could keep evolving in time and what is the solution going to be? What is the solution to this equation? ut equals kappa uxx is going to be a straight line going down from 100 to 0. So that gives you the probability distribution basically. It is going to be a straight line going from the probability 1 to 0 and the y value there is 0. Is that fine? Everyone? Okay. Of course there is a difference here. This is a continuum. There are discrete chips. There there are discrete chips. This is a continuum. That means somehow I have to fragment the chips. If I want to do this limiting process I have to keep breaking the chips down, right? I have to keep breaking the chips down. What we do know is the limit of that equation as delta x goes to 0 as the quantization of that chip goes to 0, it goes towards the heat equation. Is that okay? So that equation is consistent with the heat equation. So before we set about asking ourselves the question, instead of solving the heat equation, so that is the finite difference representation of the heat equation. Okay, so before we go about wondering, we talked about probabilities and all that and can we use those probabilities directly to solve this problem, right? Instead of instead of working at the way where we have just worked it, right now this would be, this is called the Fokker-Planck equation. You heard this term? Maybe not. Okay, that is fine. So what we are basically doing is we are basically showing that this process, this random process, there is a random process. There are two people playing. They are tossing a coin or something of that sort. Is a random process. There is a continuous equation associated with it. Okay, where u is the probability. Use the probability. Okay. And you can solve it using the finite difference techniques that we have got, we have done so far. Okay. The point that I want to make, so why do I bring this up at this point in the semester? The point that I want to make is, it is consistent. Scheme is consistent. Whatever that process that I explained is consistent, right? It is consistent with the heat equation. It converges to the heat equation, right? If you have molecules bouncing around, you do some kind of limiting process or averaging or whatever is consistent with the heat equation. If you are looking at energy equation, if there is no motion in the sense that no drift velocity, no mean velocity, then the energy equation degenerates to the heat equation. Okay. If I do a finite difference scheme in this fashion, if I do a finite difference scheme in this fashion, it is consistent. It is consistent with the heat equation. So if I start with the heat equation and I discretize it using a finite difference scheme or I discretize it using calculus variations and differences, I discretize it using finite element method, whatever it is, I generate an automaton, I show it is consistent. All of these, there are a variety of models at the discrete level, whether they are molecules, whether it is some A and B gambling, you understand. All of these, all of these in some limiting sense are governed by the heat equation. Okay. So in CFD, what we are basically doing, we say we have the fluid flow, which is a process we have done continuum and got a differential equation. There is a limiting process. Then we are saying there is this numerical scheme, there is consistency, convergence and all of that stuff going on. They both model the same equation. They both in the limit go to the same equation. So we are saying that I will use the discretization that I have done to model the reality of these molecules. Am I making sense? We are basically saying well this is equivalent to that because both of them in the limit go towards this differential equation. Am I making sense? Is that okay? So what is the underlying, what is the underlying automaton that you say, whether do you discretize using finite difference method, do you discretize using finite element method, do you discretize using something like this, we will figure out how to do this. Okay. We do something like this. So there are different ways by which there are different, it is not microscopic, you understand. So microscopic would be to do it at the molecular level. That is too much because you already know that the number of molecules we are talking about is of the order of Avogadro number of molecules. It is a huge number, 10 power 23. So you turn, we back out from there and say well here are these 100 grid points that seem to go to the same problem, that seem to go to the same differential equation. Am I making sense? Okay. So the underlying process that you pick, what we are trying to do here is, we are trying to come out with a discrete representation, some kind of a discrete representation which will simulate, which goes towards the same differential equation that are alternate discrete, the one that we are trying to simulate goes to, even though it is discrete. Is that fine? Okay. So that at one level that is the point that I wanted to show you something that is very different. Now the point is, I have shown you from here, I have shown you that we get the same governing equation. I did this simply to show you that you get the same equation. Okay. But this is not how I am going to solve it. If I solve this, I am solving finite difference method. If I solve this equation, then I am saying instead of gas flow or instead of a solid rod being, heat conduction being governed in a solid rod by the heat equation, I am saying oh the heat equation governs this and I will solve it using finite difference method. That is not the objective here. You could do it but that is not the objective here. What we will do instead is we will ask the question, what we have stated here is the problem, can it be modeled as such? Can it actually be modeled as such? So in order to do that, you need to create 101 bins, containers. You need to create 101 bins and if you have a chip or a colored ball in that bin, for that you can toss a coin and you can decide whether that ball goes to the right or the ball goes to the left. You can decide whether the ball goes to the right or ball goes to the left. The probability in this case because p and q are both equal to half, the probability half the ball will either go to the left or the ball will go to the right. Am I making sense? Okay. So that much is clear. So we have already done this. This is important. I want you, this picture I do not want you. So given that your x either goes to the right or goes to the left. This picture is important. So we come back here. So what do we have? So I have in each one of these, how many balls does the first bin have? Well, it just depends on what is the discretization of the probability that you want to do. So the probability in the first one is 1. The probability in the first bin is, the probability that the ball in the first bin, the probability is 1. So what I am going to do is, I am going to make sure that there are, I will quantize. So the probability is 1, that 0 to 1, that magnitude 1. I will quantize using 100 balls which means that each ball represents 100th of a probability. So whatever happens here, whatever happens here, so when if you start off with 100 balls and you basically say I am going to toss a coin or whatever and decide what is to happen, what is the end result after that one round, it is possible that one ball ends up here or the ball goes into the oblivion which does not make sense. But anyway, so if there are for each of these, if you do that, then if there are only 99 balls or 98 balls, then I top it off because it is supposed to be 100 at all time. In the last bin, if there is a ball or a chip that shows up there, I remove it because there is supposed to be none there. Is that fine? And you just, this is the game that you play. So you just basically say that I have a chip here or I have a ball here, I toss a coin, the ball either ends up here or here. And what you will see is all of these balls jumping around, normally unfortunately we do not have a time for a demo for this but you could actually try this. This is very easy to program. The critical thing that you need here is a random number generator. You need a random number generator. So to generate pseudo random numbers, I would suggest that you read, you read Knudts, the art of computer programming volume 2, semi numerical algorithms. There are lots of materials out there, there is a lot of material out there on generating random numbers. I think if I remember it, this book has like 100 pages or 150 pages. It is quite a lot of space dedicated to it. And it is very important. As I jokingly say, I forget who said this but random numbers are too important to leave to chance. You have to generate them properly. These are, you cannot just generate, you understand what I am saying. So the standard random number generator that you see out there may not be the best there are lots of random number generators but make sure that you are using a good random number generator. Your computer may have a random number generator which is a true random number generator, meaning that it is based on the thermal state of a diode somewhere and the CPU is actually using a A to D converter to read that, read the read of the voltage, random voltage that is coming from it. Not a good idea. You are writing a program, you want a random number generator but you want to use what are called pseudo random numbers which is what he is going to give you. Because you are not sure whether your program, when you are developing your program, you do not know whether your program is working or not. And to throw into that some random effect is not what you want. So you have random numbers that are actually not random numbers. I mean there is a sequence of numbers that look random but you know what they are beforehand and then you can debug your program. Because every time you run it, it is not going to do something different and you are saying is it because there is a bug in the program or is it because my random numbers have changed. So you generate the random numbers, debug your program and then you can do whatever you want but I would still suggest that you stick with pseudo random numbers. You stick with pseudo random numbers. Is that fine? So if you have a pseudo random number generator that generates uniform distribution on 01, then it is less than 0.5. It is a heads, it is greater than 0.5. I mean it is very easy. Is that fine? It is very easy. Basically what you are trying to do is you are trying to generate random numbers. In fact what you want is just two states minus 1 and plus 1. The way I have implemented I just generate a minus 1 and plus 1 and I add it, I shift it to the appropriate bin. I shift to the previous bin or I shift to the next bin. Is that fine? So and what you would expect is that you would sort of see some, you would see movement and then there will be a point when you finally get to the solution that you are not going to get that. That is only remember that you are dealing with random numbers. I do not know whether you have dealt enough with probability theory and so on, but you are dealing with random numbers. So you are not going to get a straight line. It is not just going to go to a straight line and sit there. It is going to be jumping about that straight line. So what you are going to do is you are going to get variations about the straight line. The straight line is the expectation of your random process. Straight line is the expected line. So you are going to see the function grow and sort of it is going to be jumping about that. It is going to be hovering about that. As I said, there is another way that we can do this. Here what we have done is we have taken bins and we have kept track of what is coming and going out of the bin. That is like an Eulerian method. The fluid mechanics lingo is like an Eulerian method. The other possibility is that you do a Lagrangian method. Lagrangian method is you follow a particle. You follow a particle. So if you follow a particle, I get back here as I promised. If you follow a particle, so you are here, you toss a coin. You go from this point to that point with probability half and then you toss a coin again. So one at each toss, these are actually bins. You understand what I am saying? These are actually bins. It is moving from one bin to another bin. But right now I am following that solitary, I am following that solitary particle. And in a similar fashion, you could have, you could have, so this is called a path. It is a particle trace, so it is called a path. It is called a path. So you could start off, you could start off each one of these in a similar fashion. So it is possible that some of them are biased in some fashion. So you can trace. And I seem to have biased in this fashion but it may not be biased. You start off on a path. So you can make, you can track, you can create, generate multiple paths. So from this point, you could generate 200 odd paths. And at any given time, you can find how those 200 odd paths would end up at that time level. And you will get a distribution. The distribution, you may get a distribution of some kind. Am I making sense? Is that okay? You will get a distribution of some kind. So it gives you an idea that if something starts here, what is the probability that it will end up in any given spot? Is that okay? Of course in this case, if it goes to the 0 side, it is just going to get eaten up. So 0 is what we call the absorbing boundary condition. It is called an absorbing boundary condition. It just eats up. Anything that comes to it is gone. Anything that comes to the 0 side is gone. This is called the absorbing boundary condition. And since I am talking about random numbers and distribution of some kind, right? And since I am talking about random numbers and the distribution of some kind and the toss of a coin and so on, this class of schemes are called Monte Carlo schemes. This class of schemes are called Monte Carlo schemes. Is that fine? So you could actually, this would be with x, you know, you could actually start off, you could start off at different points and go through the same process. So this is used in a very variety of ways. Now that I have mentioned Monte Carlo, I will just say a little something about Monte Carlo schemes. The most important part of Monte Carlo schemes of course is the random number generator, right? So since I am not sure as to what your background of probability theory and, right? I do not think, have you guys looked at, seen any, have you done probability theory? Okay. So maybe then I do not say anything about stochastic process. So there is a second step that you can go to called stochastic process. I will just write out the equation because I did not, intended at least that you be familiar with it, right? So typical stochastic differential equation, okay. So if I am talking about the probability distribution is a normal distribution, Gaussian normal. This is the mean also called the drift. This sigma squared dt is the variance rather, so these are dz, z are random, dz are random numbers which are, who have variance, which have variance that looks like, well the combination looks like sigma squared dt, variance looks like sigma squared dt. So if you look at, if you think about it, you may say what is this equation, right? What is this strange equation? This equation basically describes that process there, what I have shown, what I have shown there is with, it could be mu 0 or if you look at it, what I have actually drawn, it is drifting to one side, you understand? So it is possible that you can imagine if you just had simple diffusion, you had just had simple diffusion. So simple diffusion is the best way for me to describe it is you have some fluid flow in this direction, I have, I set up the fluid flow so that I have a time like direction in the downward direction as time progresses, something that was here will end up is travelling at a constant speed, we already know that, right? Propagation speed is a, it will travel downstream, okay. So if I drop some dye there, some ink there, this is the example that I gave in the beginning when I was talking about linear wave equation, I said oh I put some chalk dust and the chalk dust is carried along advection and then I said there is a diffusion but we are ignoring diffusion, now I am going to talk about the diffusion. So I put dye there, what happens to that dye as it goes long when I, if I drop dye, so the dye is carried down and it also starts to diffuse, it also starts to diffuse. So the distribution of dye that you expect is something like this, the distribution of dye is something like this, something like that, which we could have got by random walk, that process that I wrote there is also called a random walk, okay. The process of generating paths is also by a random walk, that is I take a particle and I go through, I go through, I take so many steps randomly, okay, it is a random walk. And this envelope basically shows maybe 10,000 such paths that I have drawn and I get a distribution that look, when I look at the end, this is the distribution that I get, random walk, that is because the flow is in this direction. What if I added a small velocity as a very tiny velocity component that way, left to right, so you would expect that the distribution will be slightly distorted. So what will happen is you will get something, and the distribution may be something like that, am I making sense, it will be slightly distorted. So the drift velocity mu, that is the mu, that is drift, okay, and this is the pure Gaussian process, am I making sense, okay, and you have seen this before. So normally when we did, as I said earlier when we are talking about, we are talking about for molecules or it is the same differential equation that finally comes up. So when you are talking about, when you did some element of statistical mechanics earlier in your physics or chemistry or whatever, you would have seen that you break up the, you break up the motion of the individual molecules which you have considered to be hard spheres, you break it up into a drift component, and the variance about that drift, a change about the drift. The drift component gives you what you call the speed of the fluid at that point in the continuum, and the variance gives you the, measure gives you, variance gives you what, measure of the temperature, right. The variance gives you a measure that becomes an internal variable, the temperature becomes an internal variable, right. Therefore you tie it to internal energy, becomes an internal, the internal it is beneath or it is beneath what we see in the continuum that we can capture. In the continuum we can only capture this, variance becomes an internal variable, okay. As I said, the objective of doing this whole business was for me to make, tie up a few of these, I wanted to connect, I wanted to connect a few of these things together. So if you have a stochastic differential equation of this sort, what it basically says is, yes you have the drift component, you would normally call what you would have seen in your physics and chemistry is the drift velocity, and then you have added to it the random component about it which you capture in the form of some kind of a variance which is actually a measure of the temperature, okay. So in that sense this equation is not very different from something like CPT0 is CPT plus u squared by 2. One has the drift component, but of course this is an energy equation, not the same, be careful, I am just writing this out, this sort of struck me randomly and I wrote it right now, but this is a relationship, you understand what I am saying, this is in terms of energy, it is not in terms of speed itself, but that is basically it. So here what you could do is, if you had a stochastic differential equation like this, you can actually generate normal, the normal random numbers using normal distribution with mu and sigma squared or mu and 1 depending on how you want to do it, right, mu and 1, mu as the mean and 1 as the variance or this would be, z would be 0 mean and unit variance, then mu would be the, mu would have the, would take care of the drift, change in the mean and this would take care of the random steps, is that fine, is that okay, are there any questions, right. So these Monte Carlo schemes, they can be used for various things, I give you a last typical application because it is about distributions, it is about distributions and I will give you the final simple application not to differential equations, this is most probably the kind of thing that you may have seen in school, I am not sure if you have seen this in school. So if you have some random shape for which you want to find the area, right, so if you are saying that why are you doing all these random numbers, what is happening, right, so let me give you a simple straightforward application. So if you want to find the area, what do you want to do, the process of integration actually, you can find a bounding square which is, which you can scale and the easiest thing, I am going to break it up into blocks because that is my nature but the easiest thing to do is generate random numbers on the square, generate, so this is x and that is y, generate random positions, so just say you generate 100 of them, so these random positions, maybe I should make them a little bigger because it has to be seen, so you generate a bunch of these random x's and y's, okay, the reason why I wanted to give this two dimensional one is an example, I will tell you why because I have a warning at the end, okay. So you generate, you generate a uniform distribution in both of them, in both directions, right, so it is bivariate uniform and count how many you have inside divided by the total gives you the fraction of this fraction of the total area, am I making sense, it is a relatively simple minded way to do it, it really works quite well, so you can generate, if you could generate instead of 100 random numbers, you can generate 10,000 random numbers, locate them all over, right, find out how many of them are inside the area that you want, find out how many of them are or what is the total number you know, so this is of course you have chosen to be a square, so the area of the square is very easy to find, you can find out what is the area of that, an estimate, get an estimate of that area, is that, does that make sense, is that okay, the reason why I picked this, the reason why I picked this is you want to make sure that the random numbers that you generate in the x coordinate direction and the random numbers that you generate in the y coordinate direction are not correlated, okay, so you really should be careful, as I said it is not that simple of just generating the random numbers and using them, okay, they are not, so you have to ensure that the numbers are not correlated, the other thing that you do is you are talking about pseudo random numbers, we go back right now to the beginning of this course, we are talking about a finite representation of a number, the mantissa is fixed, 24 bits, the mantissa is fixed, it has 24 bits, remember if I am generating random numbers between 0 and 1, all that matters is the mantissa, right, 24 bits is 16 million numbers, 24 bits is 16 million numbers, that means that the best that you can get at every 16 million numbers you will have a cycle, every 16 million numbers, so if you have a good random number generator, the cycle will be 16 million, if you have a pathetic random number generator, if you have a bad random number generator, every 100 it will keep repeating, okay, does that make sense, fine, okay, so you go to double precision, so that will give you a larger number of, right or you use integers, right, you do not need the exponent, you are talking about numbers between 0 and 1, so you use integers and you are already at 4 billion random numbers, if you have a good algorithm, remember you can still have a bad algorithm, so if you have a good algorithm, that loop that it gets, so if you go to two dimensions and if you generate 1 million random numbers, 1 million x coordinate, 1 million y, you have already done 2, if you go to, you understand what I am saying, if you go to three dimensions, you can imagine now that your random numbers may start getting correlated, there may be other issues, okay, so there are, I do not want to give you this impression that these are actually relatively easy to implement, they are not that efficient, they are relatively easy to implement, they are convergence properties on that good most of the time, so you will use them when you are in a difficult situation, typically use them when you are in a difficult situation, but otherwise what happens is you can go through this process, but please, please bear in mind that underlying all of your, all the Monte Carlo schemes deep down inside, the core of your scheme is a random number generator, so you have to make sure that you understand that your random number generator is doing the right thing, is that fine, okay, are there any questions, okay, fine, thank you.