We now apply the method of generating functions to solve problems in stochastic processes.
What is the distribution of the time at which two successes in a row first occur in Bernoulli trials.
We use the same tree of possibilities at the start of the process to define the rv and obtain , the pgf of , by conditioning on .
Using with gives
where, as in Chapter 2,
if = then =
So, remembering that is just a number,
Again we use the fact that and have the same distribution as , so that they also have the same pgf which therefore satisfies (dropping the argument for convenience):
or
so that
First, we expand by a method which works for the ratio of any two polynomials, first multiplying out:
and then equating coefficients of powers of to get, for
This last equation enables us to calculate each term in the pdf in succession from the previous two. It is a relationship which we could have derived directly without using the pgf argument, but the pgf does provide a reliable derivation.
For example to evaluate . Again multiply out and use implicit differentiation of both sides of:
to get
and set , remembering that since is proper,
from which
after simplifying to get the same answer as before.
Calculate the pgf of the time until a simple random walk, started at first reaches either or .
So
and hence
Let the rv be the time to ruin in a RW starting from . Then the pgf of satisfies
Condition on the first step and consider
Using the same notation as in Theorem 2.2.5:
so that
Now consider , the further time to ruin from . This has exactly the same distribution as , the time to ruin from . Further,
the sum of the lengths of the first two games, which are independent rvs each with the same distribution as , and therefore the same pgf . Hence
giving
as required. ∎
We have not explicitly taken account of the fact that may not be a proper rv.
There is no difficulty on this point if we consider the definition of as the power series , because the first proof presented in Proposition 3.1.2(c) for the pgf of sums of random variables does not require the rvs to be proper; it just represents the relationship between the probabilities of the rvs taking different, finite, values.
Solving the quadratic equation gives
We have eliminated the solution because it gives as whereas the other one is form with a limit.
To obtain the pmf, e.g. in the case , we expand
so
giving , , ….
Note that .
To derive the moments of , in the case when is proper i.e. , we find by implicit differentiation of
giving
Setting , (since is proper) and gives