 having done the one sided barrier problem such as the absorber problem. In the last lecture we moved on to a two barrier problem in one dimensional random walk. A very lucid interpretation of the two barrier problem is the so called a gambler's ruin problem. So, in the gambler's ruin problem as shown in this picture basically a person who bets or person who gambles he starts with an initial amount of k dollars. And the game consists of each time say tossing a coin or randomly taking a randomly it happens that he either loses or gains 1 dollar. So, this way he continues to play until either he becomes a completely broke that is all his money is exhausted and he can no longer play now or he reaches a target amount a prefixed target amount of l dollars. To be specific you may start with 10 dollars and your target amount could be 1000 dollars. So, he continues to play with a gain or loss of 1 dollar each. So, you can see that this is actually a lattice random walk problem and could be true for an atom in which both 0 and l could represent some absorbers. Because the game stops either when he reaches an amount l dollars or when he becomes broke that is 0 dollars whichever happens first. So, you can imagine it as a random motion of a particle in the presence of 2 absorbers. So, the now the question that one can ask is what is the probability that if he starts with the k dollars he will ultimately win winning is a point of success. So, he will ultimately succeed in achieving l dollars. Obviously, we saw that the sum of the probabilities these are these are ultimate probabilities and hence somewhere he must either reach 0 or he must reach l. So, the total of such probabilities should be unity. So, if you know therefore, the probability of ultimately winning without having ever got broke then that solves the problem in an asymptotic or in the finality sense in the sense of ultimate probability. So, we now formulate this problem and there are very exciting the method of solving this is quite interesting and is quite illustrative of a mathematical tools employed in solving stochastic processes problems. For that reason we discuss this problem in detail. First as we did in the last lecture we defined two probabilities f k we denote them as f k l which is the probability the gambler wins starting from k without getting ruined which of course, is good to say it although by our rule it need not be stated because once he gets ruined the game stops anyway, but in in an actual mathematical random of models sometimes the point 0 visiting once or multiple visits could be allowed and in that context it is like it is said that probability of reaching l without ever having crossed 0. The complementary probability f k 0 therefore, is the same thing gambler gets ruined without crossing l or reaching l and then we saw obviously, as we stated the total probabilities since these are asymptotic these are probabilities at the end ultimate probabilities. So, f k 0 plus f k l should be 1. Now the interesting part was how to formulate an equation for f k and what will be the boundary conditions which also we achieved in the last lecture. So, just to recapitulate we said that if this is my line 0 to l line and if we have started from let us say he is let us say at some point k or he has started from k in fact, he can start from any point even if he starts from k the problem will remain the same if it is another point, but right now let us say he starts from k. Now you are asking for the probability that he would ultimately reach l. So, it can happen only in 2 ways each time with the probability p he could be gaining 1 dollar because it has to proceed in successive steps each time he could gain 1 dollar and each time he could lose a dollar also. So, he could have let us say gained 1 and become k plus 1 and from k plus 1 let us say he could have reached here and that probability now will be f k plus 1 by the definition of l and this probability of him him transiting from k to k plus 1 is p because he is a forward jump. So, we call it as p. So, with the probability p he jumped forward and then reached l is one way of wording the ultimate success probability. So, another alternate way is he jumped to maybe he jumped to k minus 1 with the probability q and from there this is not to say that he is jumped in one leap this is to say that maybe many leaps, but the probability f is defined such that it is ultimate. So, ultimately he reached l from k minus 1. So, that is the probability f k minus 1 l. Hence the probability of f k. So, we can write hence in view of these wordings we can say that the probability f k of reaching l should be the probability he that he jumped left with which is a probability q and then he ultimately reached the l if it is f k minus 1 of l or he jumped right with the probability p and from that point k plus 1 he reached the ultimately the point l. So, these are the only possibility. So, this formulation is not the same as the W W occupancy probability formulation must make a small difference although looks very similar deceptively. There when we say here there is no concept of steps first notice that here we have only states k etcetera its indexed only by states whereas, the occupancy probabilities were indexed by state as well as by the number of steps here number of steps could be infinity the game does not stop. So, that is one point and secondly you note that what multiplies q is not f k plus 1 in earlier if you see what multiplies q was k f of m plus 1. So, there is a certain reversal because the concepts the definitions are different here. So, you very soon compare with that notes and you can satisfy yourself that there is a genuine difference arising out of differences in concepts. So, now that we have a difference equation of this type how to solve this difference equation. So, we have once again f of k we can omit the superscript now let us say it is always l and we will put it at the end is basically q f k minus 1 plus p f k k equal to 0 1 2 etcetera is simply say superscript l is omitted for convenience we will reintroduce it later. So, what are the boundary conditions given the definition of f k l it is obvious that the person who starts with 0 dollars can never reach l. So, one boundary condition is f naught l I am omitting that is 0 the same breath I can say that a person just for argument sake he starts with l dollars straight away and he has 1 if you put in the right amount he is already having it. So, in a limiting sense nobody will ever do that because there is no gain for him. So, but mathematically speaking if you start with the l dollars you are already successful. Hence we have a kind of a difference equation involving 3 terms something like a second order equation you can say and therefore, here it is f k plus 1 let us not let us keep 1 i on the sign and other matters. So, it will be f k plus 1. So, there are k minus 1 k plus 1 and k those who have done some finite difference in solving differential equations would quickly see that this is equivalent some kind of and later in fact, we are going to prove is equivalent of a second order differential equation ordinary only one variable and we know that a second order differential equation requires 2 boundary conditions. Same way a second order difference equation also requires 2 boundary conditions and there is no initial condition required because it is not a partial problem. So, it is not a step dependent problem as we have formulated now. Hence this boundary conditions and the equation above they define the problem completely. Now, we go for solution method how do we solve this problem? There are several tricks involved not really tricks several steps let us involve once we do it it becomes quite obvious. So, let us multiply the left hand side by p plus q because p plus q is always 1 since p plus q equal to 1 we can write let us call this as equation 1 and boundary conditions as equation 1 a. Then equation 1 may be rewritten as after we write it will be obvious I am going to write p plus q f k equal to q f k minus 1 plus p f k plus 1. So, earlier it was just 1 here. So, this this 1 pre factor we have just written it as p plus q. So, it does not change the value of anything, but now it allows us to do some manipulations. It is that I keep the q f k term here and transfer the p f k term to the forward side then I would write it as q f k and I take the other term to the left hand side. So, it will be q f k minus 1 and here it will be now p f k plus 1 minus p f k. So, I can write now as q of f k minus f k minus 1 equal to p of f k plus 1 minus f k. Now, let us define a quantity j k as the difference forwarder difference between the f values at k and k minus 1. So, this is a definition j k can be conceptualized as a equivalent of a flux term. The whole thing is now dimensionless that is why it is only an equivalent of flux in normal probability random work problems. So, it is basically the difference between the values of ultimate success probabilities from k and k minus 1 denoted by j k which means I can write. So, if I call this is now equation 2 now equation 2 becomes q of j k equal to p of j k plus 1. You can easily note that if j k is f k minus f k minus 1 then j k plus 1 will be f k plus 1 minus f k or I could I can say just by bringing interchanging the positions j k plus 1 equal to q by p of j k. So, we can we can now iterate that is put k equal to 1, 2 etcetera. So, which since j k plus 1 is q by p of j k it implies j 2 equal to q by p of j 1 and then if we put this is k equal to 1. If you put k equal to 2 it becomes j 3 equal to q by p of j 2, but j 2 you have already evaluated. So, it becomes q by p whole square of j 1. Same way you can do j 4 will be q by p whole cube of j 1 so on. So, in general j k will be q by p to the power k minus 1 of j 1 for k equal to 1 2 etcetera. Just confirm this last generalization if you put k equal to 1 it means j 1 is j 1 of course, if you put k equal to 2 j 2 is q by p of j 1 which you have seen and so on. So, it is perfect j 3 is q by p square. So, k minus 1 is the correct index. So, let us call it as the previous equation was 2. So, now we call this equation 3. Now the problem remains to evaluate j 1. So, re to evaluate j 1 now it is required evaluate j 1. So, to do so we go back to the definition of j k. So, j k was f k minus f k minus 1 was j k. So, I could write f k equal to j k plus f k minus 1. So, go back considering the equation let us say this is equation 2 a just for connecting to the next step. So, if you look at equation 2 a. So, we will say from equation 2 a we can reorder it as we may reorder or rewrite it as f k equal to j k plus f k minus 1 it is just the rewriting the definition. But now it allows us to iterate which means what is the f 1 assuming this general this is general. So, I call it as equation 3 a. So, if I iterate 3 a iterating equation 3 a say starting with k equal to 1 first which means f 1 will be j 1 plus f 0. Because the difference definition is valid down to 0 or jump loss may not be valid that is why we start. Now at this point we start by iterating right from 0. So, which means what we now use one of the b c's namely f 0 equal to 0 walker starting from player starting from a broke position cannot without betting he cannot reach a let all hence f 0 was 0 that means that is f 1 is j 1. Now you go to f 2 further if you set k equal to 2 then you will get f 2 equal to j 1 plus f 1, but f 1 is already j 1. So, it is going to be sorry j 2 j 2 plus because k is 2 j 2 plus f 1, but f 1 is already j 1. So, it will be j 2 plus j 1. So, we can go on so on just to do it once more it will amount to saying f 3 equal to j 2 j 3 plus j 2 plus j 1. So, likewise it will continue. So, we can say hence we can infer that f k is going to be sigma of i equal to 1 to k j i. So, what is j i go back here we use the equation just above 3 we found that j k is q by p k minus to the power k minus 1 j 1. So, upon using the equation just above equation 3 this can be written as sigma i equal to 1 to k j i is q by p to the power i minus 1 into j 1. Now j 1 does not require to be inside the sum. So, we take it out. So, everything is everything was proportion to j 1 that was the only constant. So, we have a relationship which says f k equal to j 1 into i equal to 1 to k q by p to the power i minus 1. Now this equation let us say we call it as equation 4. Going back equation 4 is a geometric series of the type sigma it is a it is not a series it is a geometry progression because it is a finite number of terms it does not have infinite number of terms finite. So, we can call it as a progression and we know elementary summing of terms in a progression something like i equal to 1 to n x to the power n is equal to x to the power i of course. So, x to the power i minus 1 if it is then yeah it is 1 to n. So, we keep it i minus 1 it is going to be x to the power n minus 1 by x minus 1 if I mean either way whether x is more than 1 or less than 1 does not matter it takes care of the sign itself. So, if x is more than 1 it is convenient to write it as x to the power n minus 1 by x minus 1, but if it is x less than 1 while this is right, but you can write it as 1 minus x to the power n by 1 minus x either way. So, using this we have from equation 4 f k is going to be j 1 which was defined as i equal to 1 to k q by p to the power i minus 1 will now turn out to be j 1 into q by p to the power k minus 1 divided by q by p minus 1 this let us call it as equation 5. Now we have left to we have been left with one condition which we have to make use of now. Now time has come to see what happens if k equal to l and this relationship we extend to the point x equal to k equal to l itself. So, we know from BC that f l equal to 1 probability of success if you already is that the success point is treated as 1. Hence, putting k equal to l in equation 5, hence with k equal to l in equation 5 we have f l which of course, from the BC it is 1 j 1 into now at the point l everything has to be written as l here minus 1 divided by q by p minus 1. So, this implies now I can evaluate j 1. So, j 1 is just cross multiply I get that. So, q by p minus 1 divided by q by p to the power l minus 1 call it as equation 5 a. So, now that we have evaluated j 1 we can go back to equation 5 and we have the answer. So, substituting equation 5 a in equation 5 we get f k equal to q by p that is write it in a way that all the denominators and numerators are properly represented. So, we can write f k maybe we should write f clear away f k equal to q by p to the power k minus 1 divided by q by p to the power l minus 1 because the term q by p minus 1 cancels both ways. So, this call it as equation 6 is the problem solved. So, the this solves the problem. Formally we have found an expression for the probability of success starting from k. Now, here we can to come back we can superscript l we can introduce superscript l. Probability of success of reaching l after starting from k depends on the ratios of individual individual bias to the left or the right. We will discuss more about this and move on to continuously to more and more advanced aspects or more and more illustrative or insightful aspects of the random walk by considering effects on higher dimensions etcetera in our next lecture. Thank you for now.