For the problem of the time until the first two successes in a Bernoulli process, we derived the recursion:
in 3.2.2; where is the probability of this happening at time , and is the probability of a success. We are now going to consider how to solve equations like this.
Firstly note that to solve this equation we need some initial conditions. In our case we have and . We can see that given these two initial conditions the recursion will uniquely define for .
Consider a recursion of the sequence of the form
(3.1) |
Let be the roots of the auxiliary equation
If all the roots are unique, the solution of (3.1) is
a linear combination of the powers of roots, where are arbitrary constants.
If the roots are not unique, with distinct roots and distinct root having multiplicity , then the solution of (3.1) is
where is a poylnomial of order in . This is still a linear combinations of the powers of roots but the coefficients are polynomials in ‘i’.
This can be proven by showing that these are solutions of (3.1), and noting that they have the correct number of independent constants.
If we consider the recursion for the time until two successes in a Bernoulli process:
and assume . Can we solve for ?
The auxillary equation is
This gives roots
Thus the general solution is
We use the initial conditions to solve for and :
Solving gives
Thus
Consider the simple random walk with . Assume . Calculate the probability, that before . (A special case for this was done in Exercise 2.2.2).
Here we will see how we can solve the problem using difference equations. Firstly condition on the first event of the simple random walk:
By conditioning we get
For this problem we have boundary conditions: and .
Now the auxiliary equation is
The roots of this are . Thus the general solution is
We use the boundary conditions to solve for and . As , we get , and as we have . Thus
We now consider a simple random walk with , and . This time we want to calculate the expected time until first hits either or . Denote this .
Firstly condition on the first event of the simple random walk:
Thus for :
with boundary conditions
We can rearrange the difference equation to
(3.2) |
The difference equation is different due to the constant on the right-hand side. To solve we first solve the homogeneous equation (with the right-hand side equal to 0). This is the same difference equation as in 3.3.3, and so we know the general solution
Now we need to guess a particular solution to (3.2) with in the rhs. It is normal to try a solution that is polynomial in of the same order as the polynomial on the right-hand side. However as our general solution is linear in , we will try a solution which is quadratic: .
Substituting this we get
So
Thus our solution is
We now use the boundary conditions to solve for and :
Firstly , so we have .
Secondly we have . Thus
Hence we have