Why Small Counting Conventions Matter
For a simple random walk, a path is a sequence of up-steps and down-steps. A count can go wrong before any difficult calculation: an endpoint may be unreachable at the chosen time, “hits the barrier” may be confused with “crosses above the barrier,” or a path may be counted more than once because its maximum occurs at several times. These are not cosmetic distinctions. Each changes the set being counted.
Work on the probability space \((\Omega,\mathcal{F},\mathbb{P})\), where \(\Omega=\{-1,+1\}^{\{1,2,\ldots\}}\), \(\mathcal{F}\) is the product sigma-field, and the coordinate increments \(\xi_k\) are independent with \(\mathbb{P}(\xi_k=1)=\mathbb{P}(\xi_k=-1)=\tfrac12\). Define the discrete-time walk \((S_n)_{n\ge0}\) by \(S_0=0\) and \(S_n=\sum_{k=1}^n\xi_k\), with state space \(S=\mathbb{Z}\). The natural filtration is \(\mathcal{F}_n=\sigma(\xi_1,\ldots,\xi_n)\). For counting paths of length \(n\), each of the \(2^n\) increment sequences has probability \(2^{-n}\); thus a path count divided by \(2^n\) gives its probability.
Parity Before Counting
If a length-\(n\) path ends at \(j\), and it has \(u\) up-steps and \(d\) down-steps, then \(u+d=n\) and \(u-d=j\). Therefore \(u=(n+j)/2\). This must be an integer between \(0\) and \(n\). In particular, an endpoint is reachable only when \(n\) and \(j\) have the same parity and \(|j|\le n\).
To justify the rule, choose which \(u=(n+j)/2\) of the \(n\) step positions are up-steps; all other steps are down-steps. Each choice produces exactly one path, and every path produces exactly one such choice. The parity check is therefore part of the formula, not an optional preliminary simplification.
Worked Example: An Unreachable Endpoint
Count length-\(4\) paths ending at \(0\), and compare with paths ending at \(1\). For endpoint \(0\), the number of up-steps must be \((4+0)/2=2\), so the count is \(\binom42=6\). For endpoint \(1\), it would have to be \((4+1)/2=\tfrac52\), which is not an integer, so the count is \(0\).
As a direct check, four steps have an even sum: the sum of four numbers each equal to \(+1\) or \(-1\) is even. Thus \(1\) cannot be an endpoint at time \(4\). The formula and the parity argument agree.
Touching a Barrier Is Not Crossing It
The reflection principle is useful only after the barrier event and the reflected endpoint are specified correctly. The next result counts paths that hit a positive integer level \(a\), then end below it. Its proof also explains why one cannot substitute a crossing event without changing the level.
Proof. Given a path ending at \(j<a\) that hits \(a\), find its first time at \(a\). Leave the part up to that time unchanged and reflect every later position \(x\) to \(2a-x\). Since each later increment changes sign, the result is still a nearest-neighbor path. Its endpoint is \(2a-j\). Conversely, any path from \(0\) to \(2a-j>a\) must hit \(a\): it starts below \(a\), ends above \(a\), and changes by one at each step. Reflecting its part after its first hit of \(a\) recovers the original type of path, ending at \(j\). The two operations undo one another, so they give a bijection. The unrestricted count to \(2a-j\) follows from the endpoint counting rule. If that endpoint has the wrong parity or lies outside the reachable range, both sides count zero. \(\square\)
To count paths that cross above \(a\), apply the theorem at level \(a+1\), not at level \(a\). In contrast, paths that stay at or below \(a\) are obtained by subtracting the number that hit \(a+1\) from the unrestricted endpoint count. This subtraction works because every path is either in that crossing event or is not, and the two classes are disjoint.
Worked Example: Touching Level 1 Versus Crossing Above It
Among length-\(4\) paths ending at \(0\), count those that hit level \(1\), and those that cross above level \(1\). There are \(\binom42=6\) unrestricted paths. For a hit of level \(1\), take \(a=1,j=0\): reflection gives endpoint \(2\), with \((4+2)/2=3\) up-steps. The count is \(\binom43=4\). For crossing above level \(1\), the path must hit level \(2\); reflection at \(a=2\) gives endpoint \(4\), with \((4+4)/2=4\) up-steps. The count is \(\binom44=1\).
Listing the six paths provides an independent check: \(UUDD, UDUD, UDDU, DUUD, DUDU, DDUU\), where \(U\) and \(D\) denote up and down. The first four hit \(1\), but only \(UUDD\) reaches \(2\). Hence the counts \(4\) and \(1\) match the reflection calculations.
Weak Nonnegativity and Strict Positivity
“Positive path” is ambiguous unless its boundary convention is stated. A path from \(0\) cannot be strictly positive at every time including time \(0\), because it starts at \(0\). Here, weak nonnegativity means \(s_k\ge0\) for every \(0\le k\le n\). Strict positivity means \(s_k>0\) for every \(1\le k\le n\); the initial value \(s_0=0\) is excluded by definition.
Proof. For weak nonnegativity, start with all paths ending at \(j\ge0\). A path that fails the condition has a first hit of \(-1\). Reflect its part after that first hit across level \(-1\), sending each later position \(x\) to \(-2-x\). The endpoint \(j\) becomes \(-2-j\). Conversely every path from \(0\) to \(-2-j\) must hit \(-1\), and reflecting after its first such hit recovers a path in the excluded class. Thus the excluded count is the unrestricted count to \(-2-j\), which equals \(\binom{n}{(n+j+2)/2}\) by the endpoint rule and symmetry of binomial coefficients. Subtracting it gives the weakly nonnegative formula. For strict positivity with \(j>0\), the first step must be up. After that step, subtract \(1\) from all remaining positions: the remaining \(n-1\) steps form a weakly nonnegative path from \(0\) to \(j-1\). Applying the formula just proved with length \(n-1\) and endpoint \(j-1\) gives the stated expression. If the parity conditions fail, the corresponding counts are zero by the same convention. \(\square\)
Worked Example: Strictly Positive or Merely Nonnegative?
Count length-\(3\) paths ending at \(1\). The weakly nonnegative count is \(\binom32-\binom33=3-1=2\). The strict-positive count is \(\binom21-\binom22=2-1=1\). The paths ending at \(1\) are \(UUD\), \(UDU\), and \(DUU\). The first two stay weakly nonnegative; only \(UUD\) stays strictly positive at times \(1,2,3\). The formulas give exactly those counts.
The path \(UDU\) is the boundary case that distinguishes the conventions: it touches zero at time \(2\), so it is allowed under weak nonnegativity but not strict positivity. Checking the endpoint alone would not reveal this difference.
When the Maximum Is Attained More Than Once
For a fixed path, define its set of maximum times by \(A_n=\{k\in\{0,\ldots,n\}:S_k=M_n\}\). If a problem asks for “the time of the maximum,” it must specify a selection rule when \(A_n\) has more than one element. The first maximum time is \(\min A_n\), and the last maximum time is \(\max A_n\); both are uniquely defined. Counting pairs consisting of a path and any time at which its maximum occurs is a different task: a path with \(r\) maximum times contributes \(r\) pairs, not one.
Worked Example: A Tied Maximum in a Four-Step Bridge
Consider the length-\(4\) paths ending at \(0\). There are \(\binom42=6\), as checked above. The paths with maximum exactly \(1\) are \(UDUD\), \(UDDU\), and \(DUUD\), so there are \(3\). In \(UDUD\), the heights are \(0,1,0,1,0\), and the maximum \(1\) occurs at times \(1\) and \(3\). In \(UDDU\), the heights are \(0,1,0,-1,0\), and the maximum occurs only at time \(1\). In \(DUUD\), the heights are \(0,-1,0,1,0\), and it occurs only at time \(3\).
Thus these three paths contribute \(2+1+1=4\) path-time pairs with height equal to the maximum, although there are only \(3\) paths. If a count partitions paths by a chosen maximum time, define it as the first or last maximum time so that each path belongs to exactly one class. Counting every maximizing time without adjusting for ties overcounts.
A Reliable Counting Checklist
Before using a path-count formula, write down the event in words and translate it into conditions on \(s_0,\ldots,s_n\). In particular, specify whether the barrier event is a hit, a strict crossing, or avoidance; state whether the boundary inequality is strict or weak; and say whether a maximum time means the first, last, or any maximizing time. Then check endpoint parity and reachable range before evaluating binomial coefficients.
A common mistake is to count paths ending at \(0\) at time \(4\) that cross above level \(1\) by reflecting at level \(1\). That calculation gives \(\binom{4}{3}=4\), but it counts paths that hit \(1\), including paths that never reach \(2\). The correction is to translate “cross above \(1\)” into “hit \(2\)” and reflect at \(2\), giving \(\binom44=1\). The explicit list in the earlier example verifies the corrected event. The error is not in reflection itself; it is in applying a correct count to the wrong barrier event.
These conventions are especially useful when comparing formulas derived by different methods. A difference of two binomial coefficients may encode a strict boundary restriction; a reflected count may encode a hit at the boundary; and a sum over candidate maximum times may count tied paths repeatedly. Making the event explicit turns each formula into a checkable statement about a precisely defined set of paths.
Check Your Understanding
For each question, state the endpoint and boundary convention before calculating.
- How many length-\(6\) paths end at \(2\)? How many end at \(1\)? Explain the parity distinction.
- Among length-\(4\) paths ending at \(0\), how many hit level \(1\), and how many cross above level \(1\)? Which level is used for each reflection?
- For length \(3\) and endpoint \(1\), identify the path that is weakly nonnegative but not strictly positive.
- In the path \(UDUD\), list every time the maximum is attained. What is the first maximum time, and what is the last?
- Why does counting paths together with every maximizing time fail to count each path exactly once when ties occur?