Choose the Constraint Before Choosing the Formula
For a simple random walk, a path is a sequence of upward and downward steps. Counting all paths of a given length with a specified endpoint is usually a binomial-coefficient calculation. Requiring the path to stay on one side of a boundary changes the problem: reflection can count the paths that violate the boundary and subtract them. A bridge that stays nonnegative is counted by a Catalan number, while a path required to stay strictly positive has a different count. A first-return condition adds another distinction: the endpoint may be zero, but the path is not allowed to visit zero earlier.
This workshop uses these constraints as a decision guide. We work with a fair simple random walk and count paths first; because every path of length \(n\) has probability \(2^{-n}\), a path count can then be converted into a probability. The boundary convention—strictly positive or merely nonnegative—must be specified before counting.
Unrestricted Endpoints and a Nonnegative Barrier
For an unrestricted endpoint count, the endpoint and length determine the numbers of upward and downward steps. If \(X_n=r\), then \(U=(n+r)/2\) and \(D=(n-r)/2\). Thus a path is possible only when \(n+r\) is even and \(|r|\le n\). When those conditions hold, choosing which \(U\) of the \(n\) step positions are upward gives the count \(\binom{n}{U}\).
Proof. For the endpoint count, each path to \(r\) has \(U-D=r\) and \(U+D=n\), so solving gives \(U=(n+r)/2\) and \(D=(n-r)/2\). If these are not nonnegative integers, there are no such paths. Otherwise, choosing the \(U\) upward-step positions gives the stated binomial coefficient. For the barrier count, begin with all paths from \(0\) to \(r\). A path that visits \(-1\) has a first visit to \(-1\). Reflect its increments up to and including that first visit, interchanging upward and downward steps. This gives a path from \(-2\) to \(r\). Conversely, every path from \(-2\) to \(r\) must visit \(-1\); reflecting its steps up to its first visit to \(-1\) recovers a path from \(0\) to \(r\) that visits \(-1\). These operations are inverse, so the bad paths are counted by paths from \(-2\) to \(r\). Such a path has \((n+r+2)/2\) upward steps, giving the subtracted term. Subtracting bad paths from all paths proves the formula. \(\square\)
The formula counts paths that may touch zero; it does not require them to stay strictly above zero. For a bridge, where \(n=2m\) and \(r=0\), it simplifies to the Catalan number \(C_m=\frac{1}{m+1}\binom{2m}{m}\). Indeed, the subtraction is \(\binom{2m}{m}-\binom{2m}{m+1}\), and \(\binom{2m}{m+1}=\frac{m}{m+1}\binom{2m}{m}\).
Worked Example: Endpoint Count with a Nonnegative Constraint
For paths of length \(8\), count the paths ending at \(2\), and then count those that never go below zero. Convert both counts to probabilities.
For endpoint \(2\), the number of upward steps must be \(U=(8+2)/2=5\), and the number of downward steps is \(D=8-5=3\). The unrestricted count is \(\binom{8}{5}=56\). Since there are \(2^8=256\) equally likely paths, the probability of ending at \(2\) is \(56/256=7/32\).
For paths that stay nonnegative, subtract paths that visit \(-1\). Reflecting up to the first visit to \(-1\) turns each such bad path into a path from \(-2\) to \(2\). That reflected path has \((8+2+2)/2=6\) upward steps, so there are \(\binom{8}{6}=28\) bad paths. The nonnegative count is \(56-28=28\), and its probability is \(28/256=7/64\).
Check: The count \(28\) is no larger than the unrestricted count \(56\). Substitution into the barrier formula gives \(\binom{8}{5}-\binom{8}{6}=56-28=28\), as obtained by reflection.
Catalan Bridges and First Returns
A nonnegative bridge of length \(2m\) starts at zero, ends at zero, and satisfies \(X_k\ge0\) at every intermediate time. Such a path has \(m\) upward and \(m\) downward steps. The barrier formula shows that their number is \(C_m\). These paths are often called Dyck paths. A first return to zero is a different event: for \(T_0^+=\inf\{n\ge1:X_n=0\}\), the condition \(T_0^+=2m\) requires the walk to avoid zero at every time from \(1\) through \(2m-1\).
Proof. A path with first return at time \(2m\) must begin with either an upward or a downward step. Consider those beginning upward. At time \(2m-1\), the walk must be at \(1\), since its final step is downward to zero. Between times \(1\) and \(2m-1\), it stays strictly positive. Subtract \(1\) from the walk’s positions over that segment: this gives a nonnegative bridge of length \(2m-2\) from zero to zero. This construction is reversible: add \(1\) to a nonnegative bridge of length \(2m-2\), prepend the upward step from zero, and append a downward step to zero. Thus the number of paths beginning upward and first returning at time \(2m\) is \(C_{m-1}\). Reflection of every increment changes upward-starting paths into downward-starting paths and preserves the first-return time, so there are another \(C_{m-1}\) paths. Finally, \(2C_{m-1}=\frac{2}{m}\binom{2m-2}{m-1}\). Since \(\binom{2m}{m}=\frac{(2m)(2m-1)}{m^2}\binom{2m-2}{m-1}\), this equals \(\frac{1}{2m-1}\binom{2m}{m}\). Dividing by \(2^{2m}\) gives the probability. \(\square\)
Worked Example: A Nonnegative Bridge and a First Return
For a fair walk, find (a) the number and probability of nonnegative bridges of length \(6\), and (b) the number and probability that the first return to zero is at time \(6\).
(a) Here \(2m=6\), so \(m=3\). The number of nonnegative bridges is \(C_3=\frac{1}{4}\binom{6}{3}=\frac{20}{4}=5\). The probability is \(5/2^6=5/64\).
(b) The first-return count is \(2C_2\). Since \(C_2=\frac{1}{3}\binom{4}{2}=\frac{6}{3}=2\), the count is \(2\cdot2=4\), and the probability is \(4/64=1/16\). The equivalent formula gives \(\frac{1}{5}\binom{6}{3}=20/5=4\).
Check: Every first-return path at time \(6\) is a bridge, but not every bridge is a first-return path. Accordingly, the first-return count \(4\) is less than the nonnegative-bridge count \(5\). The probability \(1/16\) also equals \(4/64\), using the \(64\) equally likely length-\(6\) paths.
Strict Ballot Constraints
Suppose a path has \(a\) upward steps and \(b\) downward steps, with \(a>b\). A strict ballot constraint requires \(X_k>0\) after every step \(k=1,\ldots,a+b\). Its endpoint is \(a-b>0\), but an endpoint above zero alone does not guarantee that the path stayed positive along the way.
Proof. Put \(n=a+b\). A strictly positive path must begin upward. Remove that first step and lower all subsequent positions by \(1\). The remaining path has length \(n-1\), starts at zero, ends at \(a-b-1\), and stays nonnegative. Conversely, any such nonnegative path gives a strictly positive path when raised by \(1\) and preceded by an upward step. By the nonnegative-path formula, the number is \(\binom{n-1}{b}-\binom{n-1}{b-1}\), where the second term is zero when \(b=0\). Using \(\binom{n-1}{b}=\frac{a}{n}\binom{n}{b}\) and \(\binom{n-1}{b-1}=\frac{b}{n}\binom{n}{b}\), the difference is \(\frac{a-b}{n}\binom{n}{b}\), as claimed. \(\square\)
Worked Example: A Strict Ballot Constraint
Among paths with \(5\) upward steps and \(3\) downward steps, count those whose position is strictly positive after every step. Find their probability under the fair walk.
The endpoint is \(5-3=2\), and the length is \(5+3=8\). The strict ballot formula gives \(\frac{5-3}{8}\binom{8}{3}=\frac{2}{8}\cdot56=14\). Equivalently, the first step must be upward. After removing it and lowering the remaining path by \(1\), we count nonnegative paths of length \(7\) ending at \(1\). The unrestricted count is \(\binom{7}{4}=35\); paths that hit \(-1\) are counted by \(\binom{7}{5}=21\). Their difference is \(35-21=14\). The probability is \(14/2^8=14/256=7/128\).
Check: The endpoint-only count is \(\binom{8}{3}=56\), and the strict-constraint count \(14\) is smaller. The direct ballot computation and the barrier subtraction both give \(14\).
A Practical Selection Rule and a Common Pitfall
Before applying a formula, record the path length, endpoint, and exact constraint. The following table summarizes which count addresses which question.
| Question | Counting method | Boundary convention |
|---|---|---|
| How many paths end at \(r\)? | Choose \((n+r)/2\) upward-step positions | No path constraint |
| How many paths end at \(r\ge0\) and never go below zero? | Subtract reflected paths from unrestricted paths | \(X_k\ge0\) |
| How many bridges of length \(2m\) stay nonnegative? | Catalan count \(C_m\) | \(X_k\ge0\) |
| How many paths first return at time \(2m\)? | First-return count \(2C_{m-1}\) | No zero at times \(1,\ldots,2m-1\) |
| How many paths stay strictly positive? | Strict ballot count | \(X_k>0\) after every step |
Common pitfall. For length \(8\) and endpoint \(2\), using the unrestricted count \(56\) as the count of paths that stay nonnegative is wrong: it ignores paths that visit \(-1\). The correction is to subtract the \(28\) reflected paths, leaving \(56-28=28\). A related boundary error is to treat “never below zero” as “strictly above zero.” The former allows returns to zero; the latter excludes them after time zero. Always translate the words of the constraint into an explicit inequality before counting.
Check Your Understanding
For each question, identify the applicable constraint before calculating.
- How many length-\(6\) paths end at \(2\)? What is the probability of this endpoint?
- How many length-\(6\) paths from zero to \(2\) stay nonnegative? Which paths must be subtracted by reflection?
- Why is the number of nonnegative bridges of length \(2m\) a Catalan number, rather than the unrestricted bridge count?
- Use the first-return formula to find the number of length-\(4\) paths whose first return to zero is at time \(4\).
- For \(a=4\) upward steps and \(b=2\) downward steps, state the strict ballot count and explain what “strict” excludes.