1
$\begingroup$

I have a random walk with master equation $$\hat{P}_{i}(n)=p_{i-1}\hat{P}_{i-1}(n-1)+q_{i+1}\hat{P}_{i+1}(n-1)$$ where $\hat{P}_{i}(n)$ is the probability of the random walker of being in position $i$ at time $n$. Also, $p_i$ is the probability of hopping from $i$ to $i+1$ and $q_i$ from $i$ to $i-1$.

The books wants to find the generating function so multiplies by $z^n$ both sides and sums up from $0$ to $\infty$ but I don't understand how he gets from the above, to $$\hat{P}_i(n)=p_{i-1}z\hat{P}_{i-1}(z)+q_{i+1}z\hat{P}_{i+1}(z)+\delta_{i,0}$$

How do you get the above equation? The book doesn't even explain what is the delta and why it came up. Can you at least hint me in the right direction?

1 Answers 1

3

If you want to become fluent with generating functions, you have to learn "the method". Quoting Wilf (page 8 of Generatingfunctionology), here it is:

THE METHOD

Given: a recurrence formula that is to be solved by the method of generating functions.

  1. Make sure that the set of values of the free variable (say $n$) for which the given recurrence relation is true, is clearly delineated.
  2. Give a name to the generating function that you will look for, and write out that function in terms of the unknown sequence (e.g., call it $A(x)$, and define it to be $\sum_{n\ge0} a_nx^n$).
  3. Multiply both sides of the recurrence by $x^n$, and sum over all values of $n$ for which the recurrence holds.
  4. Express both sides of the resulting equation explicitly in terms of your generating function $A(x)$.
  5. Solve the resulting equation for the unknown generating function $A(x)$.
  6. If you want an exact formula for the sequence that is defined by the given recurrence relation, then attempt to get such a formula by expanding $A(x)$ into a power series by any method you can think of. In particular, if $A(x)$ is a rational function (quotient of two polynomials), then success will result from expanding in partial fractions and then handling each of the resulting terms separately.

I might add for the sake of clarity that it would be a good idea to change your notation slightly in order to highlight the difference between the quantities involved here. You have $p_i$ and $q_i$ for the probabilities of moving right or left if the walker is at site $i$. I would let $P_i(n)$ without the hat represent the probability that the walker is at site $i$ at time $n$, and then let $\hat P_i(z)=\sum_{n\ge0}P_i(n)z^n$ with the hat represent the generating function of the time sequence of probabilities at site $i$.

Then we can follow Wilf's steps.

  1. Your master equation is good for all times $n\ge1$. You didn't mention any initial condition, but a common assumption would be that the walker starts at the origin. That's where the $\delta$ notation comes in: $\delta_{i,0}$ is 1 if $i=0$, and $\delta_{i,0}$ is 0 if $i\ne0$. This notation is sometimes called the Kronecker delta.

    1. You actually have a family of generating functions, $\hat P_i(z)=\sum_{n\ge0}P_i(n)z^n$, one at each site $i$. Note that because of the initial condition, the only generating function with a nonzero constant term is $\hat P_0(z)$.

    2. To turn your master equation into a relation about the family of generating functions, you multiply each instance of the master equation by a appropriate power of $z$ and then sum over the allowed times from step 1, namely $n\ge1$. This gives $$\sum_{n\ge1}P_i(n)z^n=p_{i-1}\sum_{n\ge1}P_{i-1}(n-1)z^n+q_{i+1}\sum_{n\ge1}P_{i+1}(n-1)z^n.$$

    3. The term on the left $\sum_{n\ge1}P_i(n)z^n$ coincides with $\hat P_i(z)$, except possibly for the $n=0$ term. From the initial condition, this term is 0, except at the origin, in which case the term on the left is $\hat P_0(z)-1$. You can put both cases into a single expression with $\hat P_i(z)-\delta_{i,0}$. For the terms on the right, there's a factoring and a shift of variables going on. For instance, $$\sum_{n\ge1}P_{i-1}(n-1)z^n=z\sum_{n\ge1}P_{i-1}(n-1)z^{n-1}$$ by factoring one $z$ out of the sum. Then, by shifting the limits of the sum $n'=n-1$ $$z\sum_{n\ge1}P_{i-1}(n-1)z^{n-1}=z\sum_{n'\ge0}P_{i-1}(n')z^{n'}=z\hat P_{i-1}(z).$$ Doing the same thing with the other term on the right gives your final equation $$\hat P_i(z)=p_{i-1}z\hat P_{i-1}(z)+q_{i+1}z\hat P_{i+1}(z)+\delta_{i,0}.$$

I hope that gives you some of the direction you were looking for.

  • 0
    that looks like a lot of effort, writing that answer, I will read it, it will take time, but surely you'll get the points for the answer! Thank you!2017-02-14
  • 0
    I am happy to help. Incidentally, if you're new to generating functions and trying to get a feel for them, Wilf's book in the link above is a great place to start.2017-02-15
  • 0
    I just read it, this is incredibly sophisticated for my current knowledge. I understood the passages thank you! And I thought about the Kronecker delta but couldn't figure out how he found it. Anyway I think you have some typos in the last equation but that's fine2017-02-15
  • 0
    I will have a read at it! What kind of prerequisites do you think are required to understand it?2017-02-15
  • 0
    You probably should have a couple semesters of calculus (at least through Taylor series). It would also be handy to know some discrete math (like permutations, combinations and the principle of inclusion/exclusion). If you haven't had those yet, there are no worries. Everything will come in its own time.2017-02-15