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 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 — 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 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 . You will also prove its transience counterpart for . 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.
- A simple random walk on takes i.i.d. steps , with .
- The walk is a time-homogeneous Markov chain on state space .
- Pólya's theorem: the symmetric walk () returns to with probability (recurrent).
- Any asymmetric walk () returns to with probability strictly less than (transient) and drifts to .
- Gambler's ruin: on a finite interval , the ruin/hitting probabilities solve an explicit linear recursion, giving closed-form formulas involving .
- 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 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 . 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 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?
Let be independent and identically distributed random variables with
Define and for . The process is called the simple random walk on started at ; it is called symmetric if and asymmetric otherwise. The walk is a discrete-time, time-homogeneous Markov chain on state space with transition probabilities
A state is recurrent if, starting from , the chain returns to with probability ; 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 for the return probability to the origin.
Intuition
Picture the walk as a token on a number line, starting at , jumping right with probability and left with probability at each tick of a clock. Over many steps, the typical position grows like — a straight-line drift — while the fluctuation around that drift grows only like , by the central limit theorem scaling that anticipates Brownian motion. When 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 infinitely often. The key computational device throughout is the first-step decomposition: condition on the outcome of , 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.
Let be the simple random walk on with , , started at . 1. If , the walk is recurrent: . 2. If , the walk is transient: , and in fact a.s. if , a.s. if .
Let and let be the total number of returns to . Then
and the walk is recurrent if and only if .
Step 1: . By definition , so by the monotone convergence theorem (all terms nonnegative) we may exchange sum and expectation:
Step 2: Renewal decomposition of returns. Let . 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 , the event "it returns to again" is independent of the past and has probability , exactly as in a sequence of independent trials. Hence the number of returns given that at least one return occurs is again geometric-like: precisely,
This is proved by induction on using the strong Markov property at the (-th) return time: , with base case .
Step 3: Compute from the distribution of . Since takes values in ,
if , and if (since then for every ).
Step 4: Conclude the equivalence. If (recurrent), , so by Step 1. If (transient), , so . These two cases are exhaustive and mutually exclusive, giving the stated equivalence.
∎Proof of the Theorem, using the Lemma. Since the walk can only return to after an even number of steps (each step changes the parity of , and is even), for all , and we must compute .
Step 1: Exact formula for . The event occurs exactly when among the steps, exactly equal and equal . Since the steps are i.i.d. Bernoulli-type ( with probabilities ), the number of 's among steps is , so
Step 2: Asymptotics via Stirling's formula. Stirling's formula gives as (meaning the ratio of the two sides tends to ), so
Hence
Step 3: Case . Here , so
Since (the -series with diverges), and , the comparison/limit test for series gives
By the Lemma, : the walk is recurrent, i.e. it returns to almost surely. Because the return probability from to is itself , the strong Markov property applied repeatedly (as in Step 2 of the Lemma's proof) shows the number of returns satisfies for every , so a.s.: the walk returns to infinitely often, almost surely.
Step 4: Case . Here , and by AM–GM, with equality iff ; since the inequality is strict, so . Let . Then , and since ,
is dominated for large by a convergent geometric series (formally: since , there is with for all , and ). Hence
By the Lemma, : the walk is transient.
Step 5: Directional drift when transient. By the strong law of large numbers applied to the i.i.d. sequence with ,
If , then , so a.s., forcing a.s. (if , then for large , ). Symmetrically, if , a.s. In either case the walk visits only finitely often almost surely, confirming transience directly.
∎Among all simple random walks on indexed by , exactly one value, , yields recurrence; every other value yields transience with the walk escaping to or according to the sign of .
Worked examples
Example 1 — Exact return probability for a biased coin, . Take , . We compute (since ) for a few small to see transience concretely, and then find the exact return probability using generating functions. The generating function of is known in closed form: for the simple random walk,
which follows from the binomial series identity applied with . The relation between and comes from the renewal argument (Step 2–3 of the Lemma's proof) applied at the level of generating functions: if then , and . Here
Hence
So with the walk still returns to its start with probability — quite likely on a single attempt — but by the Lemma the expected number of returns is , finite, confirming transience: the walk returns a finite (geometric-mean-4) number of times and then escapes to forever, consistent with . Contrast with : there , so and formally — perfectly consistent with recurrence and an infinite expected number of returns.
Example 2 — Gambler's ruin on with , unequal stakes and asymmetric boundary. A gambler starts with () and stakes per round on independent bets, winning with probability and losing with probability . She stops when her fortune hits (ruin) or (target). Take , . We find the probability of ultimate ruin, . Let for , with boundary conditions , . First-step analysis (condition on the first bet) gives, for ,
This is a linear second-order recursion with characteristic equation , whose roots are and (checked by substitution: , and ). Since , the roots and are distinct, so the general solution is
Boundary conditions: ; and . Substituting :
Hence
Now plug in numbers: , , . Compute and . We compute stepwise: , , , . Precisely, ; let's verify: . Compute , ; sum . So . Then
So the probability of reaching before ruin, starting from against an unfavorable game (), is only about . Correspondingly, the ruin probability is
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.
The recurrence theorem crucially uses that the increments are independent and identically distributed. Here is a process on , still with symmetric 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 as follows: flip a single fair coin once, and set every subsequent step equal to : for all . Each individually satisfies , matching the marginal law of the symmetric walk's steps exactly. But the steps are maximally dependent (all equal), so
With probability (), and the walk never returns to after time . With probability (), , again never returning. Hence
so this process is not recurrent, despite each step being an unbiased 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
| Situation | What happens | Why |
|---|---|---|
| exactly | Recurrent; returns to infinitely often a.s. | , harmonic-type divergence of |
| , however close to | Transient; escapes to a.s. | strictly, geometric decay of |
| Finite interval , | Ruin probabilities given by formula | Distinct roots of characteristic equation |
| Finite interval , | Ruin/win probabilities are linear in : | Repeated root forces solution |
| Two or more dimensions () | symmetric walk recurrent, , transient | Beyond this article's scope; different series test |
| Non-independent steps | Recurrence can fail entirely | See counterexample above |
The mathematician behind it
Origins · 1 minGeorge Pólya and how this was discovered
Pólya proved the recurrence dichotomy for simple random walks on in 1921, showing recurrence for and transience for — 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.
Is the simple random walk on a martingale?
Only when it is symmetric. If , then , so , which is exactly the martingale property. When , , so itself is not a martingale, but the drift-corrected process 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 to any state in finitely many steps with positive probability (just take 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 , 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 .
Why does the expected return time diverge even though the walk is recurrent?
The first-return-time distribution to has tail probabilities decaying like (a consequence of the same Stirling asymptotics used in the proof, applied to first-passage rather than return probabilities). A distribution with tail has a finite total probability mass (since converges, consistent with the walk returning with probability exactly 1) but an infinite mean, since 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 and letting time run in units of — the resulting rescaled paths converge in distribution to standard Brownian motion as . 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 for all : the symmetric nearest-neighbor walk is recurrent for and transient for . The proof strategy is the same (compute and test convergence of the sum), but the combinatorics of the multinomial return probability changes: in dimensions, , and diverges iff . This article proves only the 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 (when ), which is a martingale because ; a short calculation shows the bracket equals . Applying the optional stopping theorem at the hitting time of (justified because this stopping time is a.s. finite and the martingale is bounded on ) gives , 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 everywhere), because it uses the exact binomial formula ; if varies by state or time, no longer has this closed form, and recurrence must be reanalyzed case by case, often losing the clean dichotomy entirely.