Write . The Bellman equation implies for every available action. Under any competing policy, repeated conditioning gives
The last inequality uses . The monotone convergence theorem now gives , even when . If the comparison is immediate; otherwise the nonnegative conditional bounds justify each finite induction step. This proves Bellman comparison with nonnegative rewards and superunit discount without a vanishing-terminal-term assumption.
For the unit-bet policy in this gambler's ruin problem, put . The value satisfies
The characteristic equation has the repeated root , so . The boundary values give
To justify that this finite recurrence solution is the expected reward despite , let be the transition matrix on transient states . The matrix is diagonally similar, with diagonal factors , to the symmetric tridiagonal matrix with off-diagonal entries . Its eigenvalues are , , with absolute value below one. Thus its Neumann series converges and yields exactly the absorbed-payoff expectation and the unique recurrence solution.
When , at wealth bet once and then follow the unit-bet policy. Its expected value is , since . Therefore the unit-bet policy is not optimal.
Write . The embedded birth-death chain moves upward with probability and downward with probability away from zero. The gambler's ruin formula, obtained by solving its two-point difference equation on and then letting , gives . Translation gives return probability from to . From the chain hits almost surely: before that hit it remains in a finite reflecting interval, from every state of which a uniformly positive finite-step chance of hitting is available. This also proves that starting at zero it hits each almost surely.
After departure from the return probability is therefore
The holding rate is , so the exponential occupation-time parameter is . Applying the Strong Markov property at the almost-sure first hit gives
At zero the holding rate is and return probability after departure is , again giving parameter . From initial state , the expected occupation time at zero is , since the time is zero unless zero is reached. Averaging over the initial law with probability generating function yields
For , the interpretation is , for , and ; the same formulas hold.
Let be the probability that the simple random walk started at hits before zero. The first-step analysis recurrence and boundary conditions are
If , the characteristic equation of a linear recurrence has roots and , so the boundary conditions give
If , the repeated root gives the limiting formula . This is the gambler's ruin probability.
For a fixed integer stake , the fact that divides lets us measure Patricia's wealth in units of £. She starts at and succeeds upon reaching . The formula above factors as
For , , so this probability increases as decreases. She should therefore choose the largest stake, . For , , so the probability increases as increases; she should choose the smallest stake, .
Let be the expected remaining time when the walk is at . The first-step recurrence for gambler's ruin is
with . The quadratic
satisfies both the recurrence and the boundary conditions, and their finite linear system has a unique solution. Starting from zero therefore gives
The optional stopping theorem at a bounded stopping time states that an integrable martingale satisfies whenever for a fixed finite . Apply this first to at . The simple symmetric random walk cannot cross an integer endpoint without hitting it, so
The preceding part gives almost surely, hence almost surely. The constant bound permits the dominated convergence theorem, yielding . Since is either or , solving gives its full probability distribution:
Now let
This counts the visit at time , and excludes the exit time. Apply the same bounded-time optional stopping theorem to . For each it gives
The visit counts increase to , so monotone convergence applies to the left. Dominated convergence applies to the right using . Consequently is an integrable random variable and
This is the origin case of expected occupation before interval exit for a simple symmetric random walk. The argument obtains integrability of the total occupation count before using any unbounded-time optional stopping for , so it does not presuppose the uniform integrability asked about next. The endpoint probabilities also agree with the standard gambler's ruin calculation.[ref]
Let be the indicator random variable that coin shows a head. Each expectation is , so linearity of expectation gives the expected number of heads:
For the game, write for the probability that eventually holds all coins when starting with . The states are absorbing, so and . Conditioning on the first toss and using the law of total probability gives
Thus : successive differences are constant, and . The boundary values give , , hence the gambler's ruin answer is
For completeness, the game terminates with probability one. From any nonabsorbing state, a run of consecutive heads would reach within the next tosses, and that run has probability . Conditional on survival, the same bound applies to the next block. Therefore the probability of surviving tosses is at most , which tends to zero.
Treat one visit to a level as a whole gambler's ruin excursion, starting at its chamber and ending at local chamber or . The room choices are fair, so the chance of reaching before is , and the chance of reaching first is . The one-way hatches reset the next excursion to chamber of the adjacent level. Thus the embedded Markov chain at level exits moves upward with probability and downward with probability , even though individual room choices are unbiased.
Let be the food probability from the lower starting chamber, and that from the upper chamber . The lower level either exits unsuccessfully or reaches the upper level, while the upper level either finds food or returns to the lower start. First-step analysis at these level exits gives
Substituting yields , so
This also follows from biased gambler's ruin probability on levels , starting at , with ratio : . Absorption occurs almost surely, since from each active level a fixed positive chance of terminal absorption occurs within two excursions; the original chamber excursions are also almost surely finite.
Figure 1.
The maze reduced to level exits has upward probability one quarter and downward probability three quarters
. Details.