Pólya recurrence · does a random walk come home?
A drunkard staggering on a grid always finds his way home — does a drunken bird in the air? Does a simple random walk return to where it started, and does the answer depend on dimension?

▶ Run the simulationSee the measured result
Units: dimensionless probability (p₃ = 1 − 1/W₃, W₃ = (√6/32π³)·Γ(1/24)Γ(5/24)Γ(7/24)Γ(11/24) = 1.5163860591519778 — Watson 1939, Glasser & Zucker 1977)
How the lab tests it
Run thousands of independent simple random walks (each step ±1 along one uniformly-chosen axis) on the lattice Zᵈ for d=1,2,3 and record the first-return time of each; build the return probability R_d(N)=P(returned by step N). Three live walkers (a line, a plane, a space) also race home, scoring a RETURN when they hit the origin and an ESCAPE when they wander off.
What it checks
Pólya's theorem: the walk is RECURRENT in d=1,2 (R_d(N)→1, return certain) but TRANSIENT in d≥3 — R_3(N) plateaus at the Pólya constant p₃≈0.3405 (a finite-horizon N^(−½) extrapolation of the upper curve recovers it). One extra dimension turns certain return into probable escape.
Pólya random walk calculator (return probability, recurrence/transience, expected visits)
A drunkard staggering at random on an infinite grid of streets is certain to find his way home. A drunken bird staggering at random through the air is not: it escapes for ever with probability about 0.659, and comes home with probability 0.3405373295509990. That gap between two and three dimensions is Pólya's theorem of 1921, and this page computes both halves of it rather than quoting them. The bridge is one exact relation: if W is the expected number of times a walk visits its starting point, counting the visit at step zero, then the probability it ever returns is p = (W − 1)/W. Everything else is a question about W. The hard part is that W for the 3-D cubic lattice is Watson's integral, which is usually quoted as a product of four Gamma functions at twenty-fourths — Γ(1/24)Γ(5/24)Γ(7/24)Γ(11/24) times √6/32π³ — and that spelling makes the constant look unreachable without a special-function library. It is not. Routed through the elliptic form the same constant is W₃ = 3(18 + 12√2 − 10√3 − 7√6)/AGM(1, k′)², where k = (2 − √3)(√3 − √2) is the sixth singular modulus and AGM is the arithmetic–geometric mean, and the π² in the numerator cancels the π² hiding inside K(k)² exactly. Every Gamma disappears, every π disappears, and the whole of Pólya's constant is reachable with square roots and averaging — which is what this page does, in about five iterations, to the last bit the reference carries. The rival this lab falsified is even cleaner: for the diagonal walk whose three coordinates all step at once, Γ(1/4)⁴/4π³ collapses to 2/AGM(1, √2)², so its return probability is exactly 1 − AGM(1, √2)²/2 = 0.2822 with no Gamma and no π anywhere. Two arithmetic warnings come with the territory, and both are load-bearing here rather than decorative. The first is the constant itself: written as the textbook's four-term sum, 18 + 12√2 − 10√3 − 7√6 cancels 18 down to 0.5036 and lands 57 ulps from the truth, while the algebraically identical (2 − √3)·√3·(2√3 − 2 − 2√2 + √6) lands 1 ulp from it — a factor of 86 on W₃, for a rearrangement that changes nothing about the mathematics. The second is the bridge relation: 1 − 1/W is the way everyone writes it and it is the way to lose the answer in high dimensions, where W approaches 1 and p approaches 0, because the division rounds before the subtraction can be exact. Over 200000 Green's functions within 1e-14 of 1 the two spellings disagree on 194057, and 1 − 1/W is wrong by up to 7.450e-9 where (W − 1)/W stays at 2.203e-16. What this page will not do: it will not compute p₄ or p₅ — Montroll's higher-dimensional constants have no elementary closed form of this kind and this lab recovered them by counting, so they appear here only as numbers to be scored; it will not tell you the return probability of a walk that is not a simple nearest-neighbour one, because W is a property of the lattice and the step rule together; and it will not revise a single value this lab recovered.
p_d = (W_d − 1)/W_d, never 1 − 1/W_d · W₃ = 3(18+12√2−10√3−7√6)/AGM(1,k′)² with k = (2−√3)(√3−√2) — π CANCELS, and so does every Γ · p₃ = 0.34053732955099902 · returns ~ Geometric(p): E[returns] = W − 1 exactly · u_d(n) ≈ 2(√(d/2πn))^d, so Σ converges iff (d−2)/2 > 0 — that IS Pólya's theorem · the falsified diagonal-walk rival: p = 1 − AGM(1,√2)²/2