Tutorials › Stochastic Processes › Expected Exit Time from a Finite Random-Walk Interval

Stopping Times and the Optional Stopping Theorem · Tutorial 739 of 994

Expected Exit Time from a Finite Random-Walk Interval

Use stopped position and squared-position martingales to find and verify the expected exit time and the probabilities of leaving through either endpoint.

Advanced 10 min read

What You'll Learn

  • Define the exit time for a simple symmetric random walk in an integer interval.
  • Establish that the exit time is almost surely finite and has finite expectation.
  • Apply bounded optional stopping to the stopped position and squared-position martingales.
  • Derive the probability of exiting at each endpoint and the mean exit time.
  • Check the formulas in examples and diagnose a common algebra error.

Why Exit Time Uses Two Martingales

A fair random walk has no directional drift, so its expected position remains at its starting value. That fact determines the probabilities of exiting a finite interval through either endpoint. The expected time to exit is a different quantity: it is obtained from the martingale that subtracts elapsed time from the squared position. Using both martingales gives a direct route to the exit-time formula, provided the stopping argument is justified.

Work on a probability space \((\Omega,\mathcal{F},\mathbb{P})\) carrying independent random variables \((\xi_n)_{n\ge1}\) with \(\mathbb{P}(\xi_n=1)=\mathbb{P}(\xi_n=-1)=\tfrac12\). For an integer starting point \(x\), define the discrete-time random walk \(S_0=x\) and \(S_n=x+\sum_{r=1}^n \xi_r\), with state space \(\mathbb{Z}\). Use the filtration \(\mathcal{F}_n=\sigma(\xi_1,\ldots,\xi_n)\), with \(\mathcal{F}_0=\{\varnothing,\Omega\}\). Fix integers \(a<b\), and define the exit time from the integer interval by \(T=\inf\{n\ge0:S_n\notin\{a+1,\ldots,b-1\}\}\). Equivalently, when \(a<x<b\), \(T=\inf\{n\ge0:S_n\in\{a,b\}\}\), since each step has size one and cannot jump over an endpoint. If \(x=a\) or \(x=b\), then \(T=0\).

Definition: The simple symmetric random walk has independent increments taking the values \(1\) and \(-1\), each with probability \(\tfrac12\). Its exit time \(T\) is the first time it reaches either boundary of the finite interval. The expected exit time formula below applies to integer boundaries \(a<b\) and an integer starting point \(x\in[a,b]\).

For this walk, \((S_n)\) and \((S_n^2-n)\) are martingales with respect to \((\mathcal{F}_n)\). Indeed, \(\mathbb{E}[\xi_{n+1}\mid\mathcal{F}_n]=0\) gives \(\mathbb{E}[S_{n+1}\mid\mathcal{F}_n]=S_n\). Also, \(\xi_{n+1}^2=1\), so \(\mathbb{E}[S_{n+1}^2-(n+1)\mid\mathcal{F}_n]=S_n^2+1-(n+1)=S_n^2-n\). These martingales suggest the answer, but optional stopping at \(T\) requires care because \(T\) is not initially known to be bounded.

Finiteness and the Stopped-Martingale Argument

First show that \(T\) is finite and integrable. Let \(L=b-a\). Starting from any interior state, a run of \(L\) consecutive \(+1\) increments forces the walk to reach \(b\) within at most \(L\) steps. The probability of this run is \(2^{-L}>0\). In successive blocks of \(L\) increments, independence therefore gives, for every integer \(k\ge0\), \(\mathbb{P}_x(T>kL)\le(1-2^{-L})^k\). In particular, \(T<\infty\) almost surely. The geometric bound also implies \(\mathbb{E}_x[T]<\infty\): grouping the tail sum \(\mathbb{E}_x[T]=\sum_{n\ge0}\mathbb{P}_x(T>n)\) into blocks of length \(L\) bounds it by \(L\sum_{k\ge0}(1-2^{-L})^k=L2^L\).

Theorem: For the simple symmetric random walk just defined, if \(a<x<b\) are integers and \(T\) is the first exit time from \(\{a+1,\ldots,b-1\}\), then \(\mathbb{P}_x(S_T=b)=\frac{x-a}{b-a}\), \(\mathbb{P}_x(S_T=a)=\frac{b-x}{b-a}\), and \(\mathbb{E}_x[T]=(x-a)(b-x)\). If \(x=a\) or \(x=b\), then \(T=0\) and the expected-time formula remains valid.

Proof. Assume first \(a<x<b\), and set \(T_n=T\wedge n\), the minimum of \(T\) and the deterministic integer \(n\). This is a bounded stopping time for \((\mathcal{F}_n)\). Bounded optional stopping applies to each martingale. Thus \(\mathbb{E}_x[S_{T_n}]=x\) and \(\mathbb{E}_x[S_{T_n}^2-T_n]=x^2\). Until exit the walk lies between the endpoints, and after exit it stays at an endpoint when stopped. Consequently \(a\le S_{T_n}\le b\). Since \(T<\infty\) almost surely, \(S_{T_n}\to S_T\) almost surely; bounded convergence gives \(\mathbb{E}_x[S_T]=x\) and \(\mathbb{E}_x[S_{T_n}^2]\to\mathbb{E}_x[S_T^2]\). Also \(T_n\uparrow T\), and the already established integrability of \(T\) gives \(\mathbb{E}_x[T_n]\to\mathbb{E}_x[T]\). Passing to the limit in the two stopped identities yields \(\mathbb{E}_x[S_T]=x\) and \(\mathbb{E}_x[S_T^2]-\mathbb{E}_x[T]=x^2\).

Because \(S_T\) is either \(a\) or \(b\), write \(p=\mathbb{P}_x(S_T=b)\). The first identity says \(a(1-p)+bp=x\), so \((b-a)p=x-a\), or \(p=\frac{x-a}{b-a}\). The probability of exiting at \(a\) is \(1-p=\frac{b-x}{b-a}\). For the second identity, \(\mathbb{E}_x[S_T^2]=\frac{(b-x)a^2+(x-a)b^2}{b-a}\). To simplify without skipping the algebra, the numerator expands as \(xb^2-ab^2+ba^2-xa^2=x(b-a)(a+b)-ab(b-a)\). Therefore \(\mathbb{E}_x[S_T^2]=x(a+b)-ab\), and \(\mathbb{E}_x[T]=x(a+b)-ab-x^2=(x-a)(b-x)\). If \(x=a\) or \(x=b\), \(T=0\) by definition, and the product \((x-a)(b-x)\) is zero. This proves all the claims. \(\square\)

The truncation \(T_n\) is the key justification: optional stopping is used only at bounded times. The limit is then taken using boundedness of the stopped positions and integrability of \(T\), rather than assuming that optional stopping automatically holds at an unbounded time.

Worked Calculations

Worked Example: An Asymmetric Starting Point

A walk starts at \(x=2\) and exits the interval with integer endpoints \(a=0\) and \(b=6\). At each interior state, the transition probabilities to the neighboring states are \(\tfrac12\) and \(\tfrac12\), which sum to \(1\). Find the exit probabilities and the expected exit time.

The distance from the starting point to the lower endpoint is \(2-0=2\), and the interval length is \(6-0=6\). Hence the probability of exiting at \(6\) is \(\frac{2}{6}=\frac13\), and the probability of exiting at \(0\) is \(\frac{6-2}{6}=\frac46=\frac23\). The mean exit time is \(\mathbb{E}_2[T]=(2-0)(6-2)=2\cdot4=8\).

Check: The endpoint mean is \(\frac23\cdot0+\frac13\cdot6=2\), the starting position. The endpoint second moment is \(\frac23\cdot0^2+\frac13\cdot6^2=12\). Thus \(\mathbb{E}_2[S_T^2]-2^2=12-4=8\), agreeing with the expected-time formula.

Worked Example: An Interval Crossing Zero

A walk starts at \(x=1\) and exits through \(a=-2\) or \(b=4\). The two possible next steps each have probability \(\tfrac12\), so the transition probabilities at every interior state sum to \(1\). Find the exit probabilities and mean exit time.

Here \(b-a=4-(-2)=6\), \(x-a=1-(-2)=3\), and \(b-x=4-1=3\). Therefore the probability of exiting at \(4\) is \(\frac36=\frac12\), and the probability of exiting at \(-2\) is \(\frac36=\frac12\). The expected exit time is \(3\cdot3=9\).

Check: The expected endpoint is \(\frac12(-2)+\frac12(4)=1\). The expected squared endpoint is \(\frac12(-2)^2+\frac12(4)^2=\frac12(4)+\frac12(16)=10\). Subtracting the square of the starting position gives \(10-1^2=9\), as required.

Worked Example: Close to One Boundary

A walk starts at \(x=1\) and exits the interval with endpoints \(a=0\) and \(b=5\). From each interior state, the probabilities of stepping one unit left and one unit right are \(\tfrac12\) each, so each transition row sums to \(1\). Compute the exit probabilities and expected time.

The interval length is \(5-0=5\). The upper endpoint probability is \(\frac{1-0}{5-0}=\frac15\), and the lower endpoint probability is \(\frac{5-1}{5-0}=\frac45\). The expected time is \((1-0)(5-1)=1\cdot4=4\).

Check: The expected endpoint is \(\frac45\cdot0+\frac15\cdot5=1\). Its expected square is \(\frac45\cdot0^2+\frac15\cdot5^2=5\). The second-martingale identity gives \(\mathbb{E}_1[T]=5-1^2=4\). The endpoint probabilities sum to \(\frac45+\frac15=1\).

Common Pitfall: Mixing Up the Endpoint Weights

The probability of the upper endpoint is proportional to the distance from the lower endpoint, not the distance to the upper endpoint. Reversing the weights gives the wrong mean position. For example, with \(a=0\), \(x=2\), and \(b=6\), the upper-exit probability is \(\frac{2}{6}=\frac13\), not \(\frac{6-2}{6}=\frac23\). Using the reversed weights would give endpoint mean \(\frac23\cdot6+\frac13\cdot0=4\), which contradicts \(\mathbb{E}_x[S_T]=x=2\).

A separate algebra error can arise when simplifying the endpoint second moment. The numerator is \((b-x)a^2+(x-a)b^2=ba^2-xa^2+xb^2-ab^2\). For \(a=1\), \(b=4\), and \(x=2\), this is \(4-2+32-16=18\), as it must be from \((4-2)1^2+(2-1)4^2=18\). Replacing the term \(ba^2\) by \(ab^2\) would instead produce \(32-16+16-2=30\), an incorrect value. The correct rearrangement is \(xb^2-ab^2+ba^2-xa^2=x(b-a)(a+b)-ab(b-a)\). Dividing by \(b-a\) gives \(x(a+b)-ab\); subtracting \(x^2\) then gives \((x-a)(b-x)\).

The formula also emphasizes the importance of having two finite boundaries. Moving to a one-sided or unbounded interval changes the stopping problem; the finite-interval calculation does not establish a finite mean exit time in those settings. The proof here relies on a fixed finite distance \(b-a\), which supplies a positive chance of exit within each block of that many steps.

Check Your Understanding

For each question, take the walk to have independent increments \(+1\) and \(-1\), each with probability \(\tfrac12\), and use integer endpoints.

  1. Starting from \(x=3\), find the probability of exiting at \(b=7\) when the lower endpoint is \(a=1\), and compute the expected exit time.
  2. For endpoints \(a=-1\) and \(b=5\), what is the expected exit time when the walk starts at \(x=2\)? Check the answer using the two endpoint probabilities.
  3. Why is bounded optional stopping applied to \(T\wedge n\), rather than assumed directly at \(T\)? Name the limiting facts used in the proof.
  4. For endpoints \(0\) and \(4\), calculate the endpoint probabilities and expected exit time when \(x=0\). Explain why the interior-state argument is not needed.
  5. In the interval with endpoints \(0\) and \(6\), identify the incorrect exit probability in the common pitfall and show how the expected-endpoint check detects the error.