Random Walks

Imagine a gambler who bets one dollar on a fair coin flip. She does this over and over, forever. Does she ever return to break even? If so, how often? This simple question opens onto one of the richest objects in probability theory: the random walk on the integers. Random walks model an enormous range of phenomena. Examples include a particle jittering under molecular collisions, a stock price moving tick by tick, and a population size fluctuating by births and deaths. The integer walk is the cleanest laboratory for seeing a fundamental dichotomy. Some processes keep returning home. Others eventually escape forever. The central surprise was first made precise by George Pólya in 1921. Dimension and symmetry decide everything. A symmetric walk on Z\mathbb{Z} is recurrent. With probability one, it returns to its starting point. In fact, it does so infinitely often. The moment the walk is biased even slightly — a coin that lands heads with probability p≠1/2p \neq 1/2 — the walk becomes transient. It drifts away and returns only finitely many times. This article proves both halves of that dichotomy rigorously. It computes exact hitting probabilities via a first-step decomposition. It also shows how gambler's-ruin-style boundary problems are solved in closed form. The walk on Z\mathbb{Z} is also the ancestor of three ideas that recur throughout probability. It is a Markov chain whose state classification (transient vs. recurrent) is exactly what we compute here. It is the discrete-time precursor of Brownian motion via scaling limits. And the partial sums defining it are the prototypical example of an martingale when the steps are centered. The branching structure of population models also borrows the same recursive, first-step logic used below. This foreshadows Branching Processes. By the end of this article you will be able to state and prove Pólya's recurrence theorem for p=1/2p=1/2. You will also prove its transience counterpart for p≠1/2p \neq 1/2. You will derive the gambler's ruin formula from a linear difference equation. And you will understand precisely which hypotheses (symmetry, one-dimensionality, i.i.d. increments) are load-bearing.

Key takeaways
  • A simple random walk on Z\mathbb{Z} takes i.i.d. steps ±1\pm 1, with P(step=+1)=pP(\text{step}=+1)=p.
  • The walk is a time-homogeneous Markov chain on state space Z\mathbb{Z}.
  • Pólya's theorem: the symmetric walk (p=1/2p=1/2) returns to 00 with probability 11 (recurrent).
  • Any asymmetric walk (p≠1/2p \neq 1/2) returns to 00 with probability strictly less than 11 (transient) and drifts to ±∞\pm\infty.
  • Gambler's ruin: on a finite interval [0,N][0,N], the ruin/hitting probabilities solve an explicit linear recursion, giving closed-form formulas involving (q/p)k(q/p)^k.
  • Key idea: recurrence versus transience is decided by whether the expected number of returns to the origin — a sum of binomial return probabilities — diverges or converges.

Where this lives today

Random walks on Z\mathbb{Z} are the discrete skeleton underneath continuous diffusion models used across science. In physics, the symmetric walk models Brownian diffusion of particles in a fluid, and Pólya's dichotomy explains why a diffusing particle in one or two dimensions returns to its neighborhood infinitely often while in three dimensions it typically escapes — a fact relevant to reaction-diffusion kinetics and the recurrence of gases. In finance, gambler's-ruin-type calculations underlie barrier option pricing and value-at-risk models where an asset's log-price is modeled as a biased or unbiased walk hitting stop-loss or profit-target boundaries, directly generalizing Worked Example 2. In computer science, random walks power PageRank-style algorithms, random walk hashing, self-stabilizing token-passing protocols in distributed systems, and Markov Chain Monte Carlo samplers whose mixing-time analysis depends on recurrence/transience-type estimates. In cryptography, Pollard's rho algorithm for integer factorization and discrete logarithms is explicitly a random walk on a finite group, using birthday-paradox-style collision (return) statistics analogous to u2nu_{2n}. In statistics, sequential probability ratio tests (Wald's SPRT) reduce exactly to gambler's ruin on the log-likelihood-ratio scale, using the same linear difference equation solved in Example 2. Finally, the walk's centered version Sn−n(p−q)S_n - n(p-q) is the model example of a discrete-time martingale, and its diffusive scaling limit is precisely Brownian motion, while its recursive first-step structure is the direct ancestor of the extinction/survival analysis in Branching Processes.

Ask the tutor: How does the gambler's ruin formula change if the gambler can also stay put with some probability at each step?

DefinitionSimple random walk on the integers

Let (Xi)i≥1(X_i)_{i \ge 1} be independent and identically distributed random variables with

P(Xi=+1)=p,P(Xi=−1)=q:=1−p,0<p<1.P(X_i = +1) = p, \qquad P(X_i = -1) = q := 1-p, \qquad 0 < p < 1.

Define S0=0S_0 = 0 and Sn=X1+X2+⋯+XnS_n = X_1 + X_2 + \cdots + X_n for n≥1n \ge 1. The process (Sn)n≥0(S_n)_{n\ge 0} is called the simple random walk on Z\mathbb{Z} started at 00; it is called symmetric if p=1/2p = 1/2 and asymmetric otherwise. The walk is a discrete-time, time-homogeneous Markov chain on state space Z\mathbb{Z} with transition probabilities

P(i,i+1)=p,P(i,i−1)=q,P(i,j)=0 otherwise.P(i,i+1) = p, \qquad P(i,i-1) = q, \qquad P(i,j) = 0 \text{ otherwise.}

A state ii is recurrent if, starting from ii, the chain returns to ii with probability 11; otherwise it is transient. By the irreducibility of this chain (every state communicates with every other), all states share the same classification, so we simply say the walk is recurrent or transient. Write f=P0(∃ n≥1:Sn=0)f = P_0(\exists\, n\ge 1: S_n = 0) for the return probability to the origin.

Intuition

Picture the walk as a token on a number line, starting at 00, jumping right with probability pp and left with probability q=1−pq=1-p at each tick of a clock. Over many steps, the typical position grows like n(p−q)n(p-q) — a straight-line drift — while the fluctuation around that drift grows only like n\sqrt{n}, by the central limit theorem scaling that anticipates Brownian motion. When p=q=1/2p=q=1/2 the drift term vanishes entirely, and the walk is only fluctuation: it has no systematic reason to prefer one side of the origin, and this lack of drift is exactly what forces it back through 00 infinitely often. The key computational device throughout is the first-step decomposition: condition on the outcome of X1X_1, and the walk restarted after one step is again a random walk, now aiming at a shifted target. This self-similarity turns hitting-probability questions into linear recursions that can be solved exactly — the same idea that later solves absorption probabilities in general Markov chains and ruin probabilities in Branching Processes.

Figure
Sample paths of symmetric (p=1/2p=1/2) vs. asymmetric (p=0.65p=0.65) walks over 20 steps, both starting at 0
n Sₙ 0 p = 0.65 (drifts up) p = 0.5 (wanders, returns)
TheoremPólya's Recurrence Dichotomy for the Simple Random Walk on Z\mathbb{Z}

Let (Sn)n≥0(S_n)_{n\ge0} be the simple random walk on Z\mathbb{Z} with P(Xi=+1)=pP(X_i=+1)=p, P(Xi=−1)=1−p=qP(X_i=-1)=1-p=q, started at S0=0S_0=0. 1. If p=1/2p = 1/2, the walk is recurrent: P0(Sn=0 for infinitely many n)=1P_0(S_n = 0 \text{ for infinitely many } n) = 1. 2. If p≠1/2p \neq 1/2, the walk is transient: P0(Sn=0 for infinitely many n)=0P_0(S_n = 0 \text{ for infinitely many } n) = 0, and in fact Sn→+∞S_n \to +\infty a.s. if p>1/2p>1/2, Sn→−∞S_n \to -\infty a.s. if p<1/2p<1/2.

LemmaReturn probability via expected number of visits

Let un:=P0(Sn=0)u_n := P_0(S_n = 0) and let N:=∑n=1∞1{Sn=0}N := \sum_{n=1}^\infty \mathbf{1}\{S_n = 0\} be the total number of returns to 00. Then

E0[N]=∑n=1∞un,E_0[N] = \sum_{n=1}^\infty u_n,

and the walk is recurrent if and only if ∑n=1∞un=∞\sum_{n=1}^\infty u_n = \infty.

Proof

Step 1: E0[N]=∑nunE_0[N] = \sum_n u_n. By definition N=∑n≥11{Sn=0}N = \sum_{n\ge1} \mathbf 1\{S_n=0\}, so by the monotone convergence theorem (all terms nonnegative) we may exchange sum and expectation:

E0[N]=E0[∑n=1∞1{Sn=0}]=∑n=1∞P0(Sn=0)=∑n=1∞un.E_0[N] = E_0\Big[\sum_{n=1}^\infty \mathbf 1\{S_n=0\}\Big] = \sum_{n=1}^\infty P_0(S_n=0) = \sum_{n=1}^\infty u_n.

Step 2: Renewal decomposition of returns. Let f=P0(walk ever returns to 0)f = P_0(\text{walk ever returns to } 0). By the strong Markov property of the chain (the future after a stopping time depends only on the current state), each time the walk is at 00, the event "it returns to 00 again" is independent of the past and has probability ff, exactly as in a sequence of independent trials. Hence the number of returns NN given that at least one return occurs is again geometric-like: precisely,

P0(N≥k)=fkfor k=0,1,2,…P_0(N \ge k) = f^k \quad \text{for } k = 0,1,2,\dots

This is proved by induction on kk using the strong Markov property at the (kk-th) return time: P0(N≥k)=P0(N≥k−1)⋅fP_0(N\ge k) = P_0(N\ge k-1)\cdot f, with base case P0(N≥0)=1P_0(N\ge 0)=1.

Step 3: Compute E0[N]E_0[N] from the distribution of NN. Since NN takes values in {0,1,2,… }\{0,1,2,\dots\},

E0[N]=∑k=0∞P0(N>k)=∑k=0∞P0(N≥k+1)=∑k=0∞fk+1=f1−fE_0[N] = \sum_{k=0}^\infty P_0(N > k) = \sum_{k=0}^\infty P_0(N \ge k+1) = \sum_{k=0}^\infty f^{k+1} = \frac{f}{1-f}

if f<1f<1, and E0[N]=∞E_0[N]=\infty if f=1f=1 (since then P0(N≥k)=1P_0(N\ge k)=1 for every kk).

Step 4: Conclude the equivalence. If f=1f=1 (recurrent), E0[N]=∞E_0[N]=\infty, so ∑nun=∞\sum_n u_n = \infty by Step 1. If f<1f<1 (transient), E0[N]=f/(1−f)<∞E_0[N] = f/(1-f) < \infty, so ∑nun<∞\sum_n u_n <\infty. These two cases are exhaustive and mutually exclusive, giving the stated equivalence. ■\blacksquare

∎
Proof

Proof of the Theorem, using the Lemma. Since the walk can only return to 00 after an even number of steps (each step changes the parity of SnS_n, and S0=0S_0=0 is even), u2k+1=0u_{2k+1}=0 for all kk, and we must compute u2n=P0(S2n=0)u_{2n} = P_0(S_{2n}=0).

Step 1: Exact formula for u2nu_{2n}. The event {S2n=0}\{S_{2n}=0\} occurs exactly when among the 2n2n steps, exactly nn equal +1+1 and nn equal −1-1. Since the steps are i.i.d. Bernoulli-type (±1\pm1 with probabilities p,qp,q), the number of +1+1's among 2n2n steps is Binomial(2n,p)\mathrm{Binomial}(2n,p), so

u2n=(2nn)pnqn.u_{2n} = \binom{2n}{n} p^n q^n.

Step 2: Asymptotics via Stirling's formula. Stirling's formula gives n!∼2πn (n/e)nn! \sim \sqrt{2\pi n}\,(n/e)^n as n→∞n\to\infty (meaning the ratio of the two sides tends to 11), so

(2nn)=(2n)!(n!)2∼4πn(2n/e)2n2πn(n/e)2n=4nπn.\binom{2n}{n} = \frac{(2n)!}{(n!)^2} \sim \frac{\sqrt{4\pi n}(2n/e)^{2n}}{2\pi n (n/e)^{2n}} = \frac{4^n}{\sqrt{\pi n}}.

Hence

u2n∼(4pq)nπn.u_{2n} \sim \frac{(4pq)^n}{\sqrt{\pi n}}.

Step 3: Case p=1/2p=1/2. Here 4pq=4⋅14=14pq = 4\cdot\frac14 = 1, so

u2n∼1πn.u_{2n} \sim \frac{1}{\sqrt{\pi n}}.

Since ∑nn−1/2=∞\sum_n n^{-1/2} = \infty (the pp-series with p=1/2≤1p=1/2\le1 diverges), and u2n∼(πn)−1/2u_{2n}\sim (\pi n)^{-1/2}, the comparison/limit test for series gives

∑n=1∞u2n=∞.\sum_{n=1}^\infty u_{2n} = \infty.

By the Lemma, f=1f=1: the walk is recurrent, i.e. it returns to 00 almost surely. Because the return probability from 00 to 00 is itself 11, the strong Markov property applied repeatedly (as in Step 2 of the Lemma's proof) shows the number of returns NN satisfies P0(N≥k)=1k=1P_0(N\ge k)=1^k=1 for every kk, so N=∞N=\infty a.s.: the walk returns to 00 infinitely often, almost surely.

Step 4: Case p≠1/2p\ne 1/2. Here q=1−p≠pq=1-p\ne p, and by AM–GM, pq≤(p+q2)2=14pq \le \left(\frac{p+q}{2}\right)^2 = \frac14 with equality iff p=qp=q; since p≠qp\ne q the inequality is strict, so 4pq<14pq < 1. Let r:=4pq∈(0,1)r:=4pq \in (0,1). Then u2n∼rn/πnu_{2n}\sim r^n/\sqrt{\pi n}, and since r<1r<1,

∑n=1∞u2n≤∑n=1∞u2nrn/πn⋅rnπn\sum_{n=1}^\infty u_{2n} \le \sum_{n=1}^\infty \frac{u_{2n}}{r^n/\sqrt{\pi n}} \cdot \frac{r^n}{\sqrt{\pi n}}

is dominated for large nn by a convergent geometric series (formally: since u2n/(rn/πn)→1u_{2n}/(r^n/\sqrt{\pi n}) \to 1, there is C<∞C<\infty with u2n≤Crnu_{2n}\le C r^n for all n≥1n\ge1, and ∑Crn=Cr/(1−r)<∞\sum C r^n = Cr/(1-r) <\infty). Hence

∑n=1∞u2n<∞.\sum_{n=1}^\infty u_{2n} < \infty.

By the Lemma, f<1f<1: the walk is transient.

Step 5: Directional drift when transient. By the strong law of large numbers applied to the i.i.d. sequence XiX_i with E[Xi]=p−q≠0E[X_i] = p-q \ne 0,

Snn→p−qalmost surely as n→∞.\frac{S_n}{n} \to p - q \quad \text{almost surely as } n\to\infty.

If p>1/2p>1/2, then p−q>0p-q>0, so Sn/n→p−q>0S_n/n \to p-q>0 a.s., forcing Sn→+∞S_n \to +\infty a.s. (if Sn/n→c>0S_n/n\to c>0, then for large nn, Sn>cn/2→∞S_n > cn/2 \to \infty). Symmetrically, if p<1/2p<1/2, Sn→−∞S_n\to-\infty a.s. In either case the walk visits 00 only finitely often almost surely, confirming transience directly. ■\blacksquare

∎
CorollaryRecurrence is a knife-edge property

Among all simple random walks on Z\mathbb{Z} indexed by p∈(0,1)p\in(0,1), exactly one value, p=1/2p=1/2, yields recurrence; every other value yields transience with the walk escaping to +∞+\infty or −∞-\infty according to the sign of p−1/2p-1/2.

Worked examples

Example 1 — Exact return probability for a biased coin, p=0.6p = 0.6. Take p=0.6p=0.6, q=0.4q=0.4. We compute u2n=(2nn)(0.24)nu_{2n}=\binom{2n}{n}(0.24)^n (since pq=0.24pq = 0.24) for a few small nn to see transience concretely, and then find the exact return probability ff using generating functions. The generating function of (u2n)(u_{2n}) is known in closed form: for the simple random walk,

U(x):=∑n=0∞u2nx2n=11−4pqx2,∣x∣<1,U(x) := \sum_{n=0}^\infty u_{2n} x^{2n} = \frac{1}{\sqrt{1-4pqx^2}}, \qquad |x|<1,

which follows from the binomial series identity ∑n(2nn)yn=(1−4y)−1/2\sum_n \binom{2n}{n} y^n = (1-4y)^{-1/2} applied with y=pqx2y = pqx^2. The relation between U(x)U(x) and ff comes from the renewal argument (Step 2–3 of the Lemma's proof) applied at the level of generating functions: if F(x):=∑nP0(first return at time n)xnF(x):=\sum_n P_0(\text{first return at time } n) x^n then U(x)=1/(1−F(x))U(x) = 1/(1-F(x)), and f=F(1)=1−1/U(1)f = F(1) = 1 - 1/U(1). Here

U(1)=11−4pq=11−4(0.6)(0.4)=11−0.96=10.04=10.2=5.U(1) = \frac{1}{\sqrt{1-4pq}} = \frac{1}{\sqrt{1-4(0.6)(0.4)}} = \frac{1}{\sqrt{1-0.96}} = \frac{1}{\sqrt{0.04}} = \frac{1}{0.2} = 5.

Hence

f=1−15=45=0.8.f = 1 - \frac{1}{5} = \frac{4}{5} = 0.8.

So with p=0.6p=0.6 the walk still returns to its start with probability 0.80.8 — quite likely on a single attempt — but by the Lemma the expected number of returns is f/(1−f)=0.8/0.2=4f/(1-f) = 0.8/0.2 = 4, finite, confirming transience: the walk returns a finite (geometric-mean-4) number of times and then escapes to +∞+\infty forever, consistent with p−q=0.2>0p-q=0.2>0. Contrast with p=1/2p=1/2: there 4pq=14pq=1, so U(1)=∞U(1)=\infty and formally f=1−0=1f = 1-0 = 1 — perfectly consistent with recurrence and an infinite expected number of returns.

Example 2 — Gambler's ruin on {0,1,…,N}\{0,1,\dots,N\} with p≠qp\ne q, unequal stakes and asymmetric boundary. A gambler starts with $k\$k (0<k<N0<k<N) and stakes $1\$1 per round on independent bets, winning with probability p=0.4p=0.4 and losing with probability q=0.6q=0.6. She stops when her fortune hits 00 (ruin) or NN (target). Take N=10N = 10, k=3k = 3. We find the probability of ultimate ruin, Pk(hit 0 before N)P_k(\text{hit } 0 \text{ before } N). Let pk:=Pk(hit N before 0)p_k := P_k(\text{hit } N \text{ before } 0) for k=0,…,Nk=0,\dots,N, with boundary conditions p0=0p_0 = 0, pN=1p_N=1. First-step analysis (condition on the first bet) gives, for 0<k<N0<k<N,

pk=p pk+1+q pk−1.p_k = p\, p_{k+1} + q\, p_{k-1}.

This is a linear second-order recursion with characteristic equation px2−x+q=0p x^2 - x + q = 0, whose roots are x=1x=1 and x=q/px = q/p (checked by substitution: p⋅1−1+q=p+q−1=0p\cdot 1 - 1 + q = p+q-1=0, and p(q/p)2−q/p+q=q2/p−q/p+q=(q/p)(q−1)+q=−(q/p)(p)+q=−q+q=0p(q/p)^2 - q/p + q = q^2/p - q/p + q = (q/p)(q-1) + q = -(q/p)(p)+q = -q+q=0). Since p≠qp\ne q, the roots 11 and q/pq/p are distinct, so the general solution is

pk=A+B(qp)k.p_k = A + B\left(\frac{q}{p}\right)^k.

Boundary conditions: p0=A+B=0⇒A=−Bp_0 = A+B = 0 \Rightarrow A=-B; and pN=A+B(q/p)N=1p_N = A + B(q/p)^N = 1. Substituting A=−BA=-B:

B[(qp)N−1]=1  ⟹  B=1(q/p)N−1,A=−B.B\left[\left(\frac{q}{p}\right)^N - 1\right] = 1 \implies B = \frac{1}{(q/p)^N - 1}, \quad A = -B.

Hence

pk=1−(q/p)k1−(q/p)N.p_k = \frac{1-(q/p)^k}{1-(q/p)^N}.

Now plug in numbers: q/p=0.6/0.4=1.5q/p = 0.6/0.4 = 1.5, N=10N=10, k=3k=3. Compute (q/p)3=1.53=3.375(q/p)^3 = 1.5^3 = 3.375 and (q/p)10=1.510(q/p)^{10} = 1.5^{10}. We compute 1.5101.5^{10} stepwise: 1.52=2.251.5^2=2.25, 1.54=2.252=5.06251.5^4 = 2.25^2 = 5.0625, 1.55=5.0625×1.5=7.593751.5^5 = 5.0625\times1.5 = 7.59375, 1.510=7.593752=57.665039...1.5^{10} = 7.59375^2 = 57.665039.... Precisely, 7.593752=57.665039...7.59375^2 = 57.665039...; let's verify: 7.593752=7.59375×7.593757.59375^2 = 7.59375\times7.59375. Compute 7.59375×7=53.156257.59375\times7 = 53.15625, 7.59375×0.59375=4.5093...7.59375\times0.59375 = 4.5093...; sum ≈57.6656\approx 57.6656. So (q/p)10≈57.6650(q/p)^{10}\approx 57.6650. Then

p3=1−3.3751−57.6650=−2.375−56.6650=2.37556.6650≈0.04191.p_3 = \frac{1-3.375}{1-57.6650} = \frac{-2.375}{-56.6650} = \frac{2.375}{56.6650} \approx 0.04191.

So the probability of reaching $10\$10 before ruin, starting from $3\$3 against an unfavorable game (p=0.4p=0.4), is only about 4.19%4.19\%. Correspondingly, the ruin probability is

P3(ruin)=1−p3≈0.9581,P_3(\text{ruin}) = 1-p_3 \approx 0.9581,

illustrating how strongly a small unfavorable edge compounds over even a modest gap to the target — a quantitative version of the transience just proved, now confined to a finite interval.

CounterexampleDropping the i.i.d. hypothesis breaks recurrence

The recurrence theorem crucially uses that the increments XiX_i are independent and identically distributed. Here is a process on Z\mathbb{Z}, still with symmetric ±1\pm1 steps at each stage in the sense that each step is individually a fair coin flip, but where the steps are not independent, and recurrence fails. Construct YnY_n as follows: flip a single fair coin Z∈{−1,+1}Z\in\{-1,+1\} once, and set every subsequent step equal to ZZ: Xi=ZX_i = Z for all i≥1i\ge1. Each XiX_i individually satisfies P(Xi=1)=P(Xi=−1)=1/2P(X_i=1)=P(X_i=-1)=1/2, matching the marginal law of the symmetric walk's steps exactly. But the steps are maximally dependent (all equal), so

Sn=X1+⋯+Xn=nZ.S_n = X_1+\cdots+X_n = nZ.

With probability 1/21/2 (Z=1Z=1), Sn=n→+∞S_n = n \to +\infty and the walk never returns to 00 after time 00. With probability 1/21/2 (Z=−1Z=-1), Sn=−n→−∞S_n=-n\to-\infty, again never returning. Hence

P(Sn=0 for some n≥1)=0≠1,P(S_n = 0 \text{ for some } n\ge1) = 0 \ne 1,

so this process is not recurrent, despite each step being an unbiased ±1\pm1 coin flip. This shows independence of increments — not merely their marginal symmetry — is essential to Pólya's theorem; the proof's use of the strong Markov property (Step 2 of the Lemma) genuinely requires that the future increments be independent of the past given the current position.

Scope, edge cases & common traps

SituationWhat happensWhy
p=1/2p=1/2 exactlyRecurrent; returns to 00 infinitely often a.s.4pq=14pq=1, harmonic-type divergence of ∑u2n\sum u_{2n}
p≠1/2p\ne1/2, however close to 1/21/2Transient; escapes to ±∞\pm\infty a.s.4pq<14pq<1 strictly, geometric decay of u2nu_{2n}
Finite interval [0,N][0,N], p≠qp\ne qRuin probabilities given by (q/p)k(q/p)^k formulaDistinct roots of characteristic equation
Finite interval [0,N][0,N], p=q=1/2p=q=1/2Ruin/win probabilities are linear in kk: pk=k/Np_k=k/NRepeated root 11 forces solution A+BkA+Bk
Two or more dimensions (Z2,Z3\mathbb{Z}^2,\mathbb{Z}^3)Z2\mathbb{Z}^2 symmetric walk recurrent, Zd\mathbb{Z}^d, d≥3d\ge3 transientBeyond this article's scope; different series test
Non-independent ±1\pm1 stepsRecurrence can fail entirelySee counterexample above

The mathematician behind it

Origins · 1 minGeorge Pólya and how this was discovered
GP
George Pólya
1887–1985 · Hungarian-American mathematician, Stanford University

Pólya proved the recurrence dichotomy for simple random walks on Zd\mathbb{Z}^d in 1921, showing recurrence for d=1,2d=1,2 and transience for d≥3d\ge3 — a result often summarized by his own quip that "a drunk man will find his way home, but a drunk bird may get lost forever." Beyond probability, Pólya is equally celebrated for his work on combinatorics (Pólya enumeration), complex analysis, and — perhaps most influentially for students — his book How to Solve It, a foundational text on mathematical problem-solving heuristics still assigned worldwide.

History
- 1900: Louis Bachelier's thesis models stock prices with a process anticipating random walks and Brownian motion.
- 1921: George Pólya proves the recurrence/transience dichotomy for simple random walks on Zd\mathbb{Z}^d.
- 1933: Andrei Kolmogorov's Foundations of the Theory of Probability gives random walks a fully rigorous measure-theoretic footing.
- 1944: William Feller's treatment in An Introduction to Probability Theory and Its Applications popularizes gambler's ruin and fluctuation theory for generations of students.
- 1951: Donsker's invariance principle shows rescaled random walks converge to Brownian motion, formally linking this article to Introduction to Brownian Motion.
Is the simple random walk on Z\mathbb{Z} a martingale?

Only when it is symmetric. If p=1/2p=1/2, then E[Xi]=0E[X_i]=0, so E[Sn+1∣S0,…,Sn]=Sn+E[Xn+1]=SnE[S_{n+1}\mid S_0,\dots,S_n] = S_n + E[X_{n+1}] = S_n, which is exactly the martingale property. When p≠1/2p\ne1/2, E[Xi]=p−q≠0E[X_i]=p-q\ne0, so SnS_n itself is not a martingale, but the drift-corrected process Sn−n(p−q)S_n - n(p-q) is: its conditional expectation given the past equals its current value. This drift-corrected martingale is the standard tool for computing gambler's-ruin quantities via the optional stopping theorem, an alternative route to the formulas derived here by direct recursion.

Does recurrence mean the walk returns to every state, not just 0?

Yes, by irreducibility. Because the chain can move from any state ii to any state jj in finitely many steps with positive probability (just take ∣i−j∣|i-j| steps of the appropriate sign), all states communicate. A standard fact from Markov chain theory states that communicating states share the same recurrence classification. So proving recurrence at 00, as done here, automatically implies every state is recurrent, and starting from any point the walk visits every other integer infinitely often almost surely, when p=1/2p=1/2.

Why does the expected return time diverge even though the walk is recurrent?

The first-return-time distribution to 00 has tail probabilities decaying like n−3/2n^{-3/2} (a consequence of the same Stirling asymptotics used in the proof, applied to first-passage rather than return probabilities). A distribution with tail ∼n−3/2\sim n^{-3/2} has a finite total probability mass (since ∑n−3/2\sum n^{-3/2} converges, consistent with the walk returning with probability exactly 1) but an infinite mean, since ∑n⋅n−3/2=∑n−1/2\sum n \cdot n^{-3/2} = \sum n^{-1/2} diverges. This is called null recurrence: certain return, but no finite average waiting time — the borderline case between positive recurrence and transience.

How does this connect to Brownian motion?

Donsker's invariance principle shows that if you rescale the symmetric random walk in both space and time — dividing position by n\sqrt{n} and letting time run in units of 1/n1/n — the resulting rescaled paths converge in distribution to standard Brownian motion as n→∞n\to\infty. This is why Brownian motion inherits a two-dimensional recurrence property closely mirroring Pólya's theorem, and why many Brownian motion computations (e.g., hitting probabilities for an interval) can be derived either directly or as limits of the discrete gambler's ruin formulas proven here.

What changes for random walks in higher dimensions?

Pólya's original 1921 theorem covers Zd\mathbb{Z}^d for all dd: the symmetric nearest-neighbor walk is recurrent for d=1,2d=1,2 and transient for d≥3d\ge3. The proof strategy is the same (compute P(S2n=0)P(S_{2n}=0) and test convergence of the sum), but the combinatorics of the multinomial return probability changes: in dd dimensions, u2n∼Cdn−d/2u_{2n} \sim C_d n^{-d/2}, and ∑n−d/2\sum n^{-d/2} diverges iff d≤2d\le2. This article proves only the d=1d=1 case in full rigor since it is the prerequisite baseline; the higher-dimensional argument is a direct but more technical extension.

Can the gambler's ruin formula be derived without solving a difference equation?

Yes — via the martingale (q/p)Sn(q/p)^{S_n} (when p≠qp\ne q), which is a martingale because E[(q/p)Sn+1∣Sn]=(q/p)Sn[p⋅(q/p)+q⋅(p/q)]E[(q/p)^{S_{n+1}}\mid S_n] = (q/p)^{S_n}\big[p\cdot(q/p) + q\cdot(p/q)\big]; a short calculation shows the bracket equals 11. Applying the optional stopping theorem at the hitting time of {0,N}\{0,N\} (justified because this stopping time is a.s. finite and the martingale is bounded on [0,N][0,N]) gives E[(q/p)Sτ]=(q/p)kE[(q/p)^{S_\tau}] = (q/p)^k, which expands into exactly the same linear equation solved by the difference-equation method, confirming the two routes agree.

Is the walk still Markov if p depends on time or position?

It remains Markov (the future depends only on the present state) as long as the transition probability from a state depends only on that state and possibly the current time — this defines an inhomogeneous but still Markov chain. However, Pólya's specific recurrence/transience computation relies on time-homogeneity and spatial homogeneity (the same p,qp,q everywhere), because it uses the exact binomial formula u2n=(2nn)pnqnu_{2n}=\binom{2n}{n}p^nq^n; if pp varies by state or time, u2nu_{2n} no longer has this closed form, and recurrence must be reanalyzed case by case, often losing the clean dichotomy entirely.

Before this

Where this leads