Tutorials › Stochastic Processes › Positive Bridges and Dyck Paths

Simple Random Walks on the Integers · Tutorial 286 of 994

Positive Bridges and Dyck Paths

Learn how Dyck paths encode nonnegative bridges, how strict positivity changes the count, and how to calculate the corresponding bridge probabilities.

Intermediate 10 min read

What You'll Learn

  • Encode a simple symmetric walk path as a word of up-steps and down-steps.
  • Identify nonnegative bridges with Dyck paths and strict positive bridges with primitive Dyck paths.
  • Derive the Catalan count for nonnegative bridges using reflection.
  • Count strict positive bridges by removing their first and last steps.
  • Compute exact bridge and conditional probabilities at small lengths.
  • Distinguish staying nonnegative from staying strictly positive at interior times.

Bridges as Step Sequences

A bridge is a walk path that returns to its starting point at a specified time. When a simple symmetric walk is also constrained not to go below its starting point, its path can be represented by a Dyck path. A related but stricter constraint requires the walk to be above its starting point at every interior time. Keeping these two constraints separate is essential: a nonnegative bridge may return to zero before its final step, while a strictly positive bridge may not.

Work on the probability space \((\Omega,\mathcal{F},\mathbb{P})\) of infinite sequences of independent increments \(\xi_1,\xi_2,\ldots\), where \(\mathbb{P}(\xi_k=1)=\mathbb{P}(\xi_k=-1)=\tfrac12\). Let the state space be \(S=\mathbb{Z}\), define \(X_0=0\) and \(X_n=\sum_{k=1}^n \xi_k\), and use the filtration \(\mathcal{F}_n=\sigma(\xi_1,\ldots,\xi_n)\). From each state \(i\), the one-step transition probabilities to \(i+1\) and \(i-1\) are each \(\tfrac12\), so their sum is \(1\). Encode an increment \(+1\) by \(U\) and an increment \(-1\) by \(D\). The height after \(k\) steps is the number of \(U\)'s minus the number of \(D\)'s in the first \(k\) letters.

Definition: A bridge of length \(2n\) is a step sequence with \(X_{2n}=0\). A nonnegative bridge also satisfies \(X_k\ge0\) for every \(0\le k\le2n\). A strict positive bridge satisfies \(X_k>0\) for every interior time \(1\le k\le2n-1\), as well as \(X_0=X_{2n}=0\). A Dyck path of length \(2n\) is a sequence of \(n\) letters \(U\) and \(n\) letters \(D\) whose partial heights are all nonnegative. A primitive Dyck path is a nonempty Dyck path with strictly positive heights at every interior time.

Every bridge has the same number of up-steps and down-steps: if there are \(u\) up-steps and \(d\) down-steps, then \(u+d=2n\) and \(u-d=X_{2n}=0\), so \(u=d=n\). Thus the step-sequence representation turns a nonnegative bridge exactly into a Dyck path. The word “positive” needs care: in this tutorial, a strict positive bridge means positive at every interior time, not merely nonnegative. Such paths are precisely the primitive Dyck paths.

Counting Nonnegative Bridges

The number of nonnegative bridges of length \(2n\) is the Catalan number \(C_n=\frac{1}{n+1}\binom{2n}{n}\). The following reflection argument explains the count and makes the constraint explicit. For \(n=0\), the empty path is the single nonnegative bridge; below, take \(n\ge1\).

Theorem: The number of nonnegative bridges of length \(2n\) is \(C_n=\binom{2n}{n}-\binom{2n}{n+1}=\frac{1}{n+1}\binom{2n}{n}\).

Proof. There are \(\binom{2n}{n}\) bridges in total, since one chooses which \(n\) of the \(2n\) positions are up-steps. Call a bridge bad if it has a negative height. Each bad bridge has a first time at which its height is \(-1\). Reflect every step up to and including that first visit by interchanging \(U\) and \(D\). The reflected prefix ends at height \(+1\), and the unchanged suffix leaves the final height at \(+2\). The result is therefore a length-\(2n\) path ending at \(+2\), which has \(n+1\) up-steps and \(n-1\) down-steps.

This operation is a bijection. Given any length-\(2n\) path ending at \(+2\), it must have a first visit to \(+1\). Reflect its steps through that visit. The resulting path ends at \(0\), and has reached \(-1\) at the reflected time, so it is bad. These two reflections undo one another because the first visit to \(-1\) in a bad path corresponds to the first visit to \(+1\) in its image. Hence the number of bad bridges is \(\binom{2n}{n+1}\). Subtracting gives the number of nonnegative bridges. Finally, \(\binom{2n}{n+1}=\frac{n}{n+1}\binom{2n}{n}\), so the difference is \(\frac{1}{n+1}\binom{2n}{n}\). \(\square\)

For the simple symmetric walk, every particular length-\(2n\) sequence has probability \(2^{-2n}=4^{-n}\), since its \(2n\) increments are independent and each prescribed increment has probability \(\tfrac12\). Consequently, the probability of a nonnegative bridge is \(C_n/4^n\). This is a joint event: it requires both a return at time \(2n\) and nonnegative heights throughout.

Strict Positivity and Primitive Paths

Theorem: For \(n\ge1\), deleting the first and last steps of a strict positive bridge of length \(2n\), then lowering each remaining height by \(1\), gives a bijection with Dyck paths of length \(2n-2\). Therefore the number of strict positive bridges of length \(2n\) is \(C_{n-1}\).

Proof. A strict positive bridge must begin with \(U\): a first step \(D\) would give height \(-1\). It must end with \(D\): immediately before the last step its height must be \(1\), since the last step returns it to zero. Remove this initial \(U\) and final \(D\). The remaining path starts and ends at height \(1\) in the original coordinates. Subtract \(1\) from every one of its heights. The resulting path starts and ends at \(0\), uses \(n-1\) up-steps and \(n-1\) down-steps, and never goes below zero because the original interior heights were positive integers. It is a Dyck path of length \(2n-2\).

Conversely, take any Dyck path of length \(2n-2\). Add \(1\) to all its heights and place a \(U\) at the beginning and a \(D\) at the end. The resulting path begins at zero, has positive height at every interior time, and ends at zero; it is a strict positive bridge. These constructions undo each other, so they give a bijection. There are \(C_{n-1}\) such Dyck paths by the count above, proving the result. When \(n=1\), the remaining path is empty and there is one strict positive bridge, \(UD\), in agreement with \(C_0=1\). \(\square\)

The strict-positive probability is therefore \(C_{n-1}/4^n\). Among all bridges, the conditional probability of strict positivity is \(C_{n-1}/\binom{2n}{n}\); among nonnegative bridges, it is \(C_{n-1}/C_n\). These are different denominators and answer different questions. The conditioning events have positive probability for every \(n\ge1\), so both conditional probabilities are defined.

Worked Example: Length Four

Take \(n=2\), so the walk has four steps. The transition probabilities at every integer state are \(\tfrac12\) to the next higher state and \(\tfrac12\) to the next lower state, summing to \(1\). The total number of bridges is \(\binom{4}{2}=6\). The Catalan count gives \(C_2=\frac{1}{3}\binom{4}{2}=2\) nonnegative bridges. They are \(UUDD\), with heights \((0,1,2,1,0)\), and \(UDUD\), with heights \((0,1,0,1,0)\).

Only \(UUDD\) is strictly positive at both interior times: its interior heights are \(1\) and \(2\). The other path returns to zero at time \(2\). The bijection also gives \(C_1=\frac{1}{2}\binom{2}{1}=1\) strict positive bridge, confirming the direct list.

Check: Each four-step path has probability \(1/16\). Thus the return probability is \(6/16=3/8\), the nonnegative-bridge probability is \(2/16=1/8\), and the strict-positive-bridge probability is \(1/16\). Conditional on a return, the strict-positive probability is \(1/6\); conditional on a nonnegative bridge, it is \(1/2\). The counts \(6\), \(2\), and \(1\) agree with the respective formulas.

Worked Example: Listing All Length-Six Dyck Paths

Take \(n=3\), so every bridge has three \(U\)'s and three \(D\)'s. The row sums of the walk’s transition probabilities are again \(\tfrac12+\tfrac12=1\). The Catalan formula gives \(C_3=\frac{1}{4}\binom{6}{3}=\frac{20}{4}=5\) nonnegative bridges. Listing them and recording their heights gives:

  • \(UUUDDD\): \((0,1,2,3,2,1,0)\).
  • \(UUDUDD\): \((0,1,2,1,2,1,0)\).
  • \(UUDDUD\): \((0,1,2,1,0,1,0)\).
  • \(UDUUDD\): \((0,1,0,1,2,1,0)\).
  • \(UDUDUD\): \((0,1,0,1,0,1,0)\).

The first and second paths stay strictly above zero at every interior time. The third, fourth, and fifth paths return to zero before their final step. Thus there are exactly two strict positive bridges, as the bijection predicts: \(C_2=\frac{1}{3}\binom{4}{2}=2\).

Check: There are \(\binom{6}{3}=20\) bridges in all, each with probability \(1/64\). The return probability is \(20/64=5/16\); the nonnegative-bridge probability is \(5/64\); and the strict-positive-bridge probability is \(2/64=1/32\). Given a return, the strict-positive probability is \(2/20=1/10\). Given a nonnegative bridge, it is \(2/5\). These conditional probabilities use different conditioning events, as their denominators show.

Worked Example: Length Eight

For \(n=4\), the walk has eight increments, with transition probabilities \(\tfrac12\) up and \(\tfrac12\) down at each state, again summing to \(1\). There are \(\binom{8}{4}=70\) bridges. The nonnegative count is \(C_4=\frac{1}{5}\binom{8}{4}=\frac{70}{5}=14\). The strict-positive count is \(C_3=\frac{1}{4}\binom{6}{3}=\frac{20}{4}=5\).

Each specified sequence has probability \(1/2^8=1/256\). Therefore the return probability is \(70/256=35/128\), the nonnegative-bridge probability is \(14/256=7/128\), and the strict-positive-bridge probability is \(5/256\). Conditional on being a nonnegative bridge, the strict-positive probability is \(5/14\). As a check on the strict count, deleting the first \(U\) and last \(D\) from every such path leaves a Dyck path of length six, and the length-six list contains exactly five Dyck paths.

Common Counting Pitfalls

A common error is to count all nonnegative bridges as strictly positive bridges. For length six, this mistake gives \(C_3=5\) strict positive paths and hence the incorrect probability \(5/64\). But the height list shows that \(UUDDUD\), \(UDUUDD\), and \(UDUDUD\) each have an interior zero. Only \(UUUDDD\) and \(UUDUDD\) remain strictly above zero at interior times. The corrected strict-positive count is \(2=C_2\), and the corrected probability is \(2/64=1/32\).

A second error is to divide by the wrong event when calculating a conditional probability. The strict-positive probability conditional on a return at time six is \(2/20=1/10\), because there are \(20\) bridges in total. Conditional on a nonnegative bridge, it is \(2/5\), because there are only \(5\) nonnegative bridges. Neither value is the unconditional probability \(2/64\).

The distinction is useful whenever a path constraint is part of the event being counted. A return condition fixes the endpoint but says nothing about intermediate heights. Nonnegativity permits intermediate visits to zero; strict positivity rules them out. For small lengths, listing heights provides a direct check, while the Catalan count and the first-step/last-step bijection give a scalable method for larger lengths.

Check Your Understanding

In each question, distinguish the return condition from the path constraint, and use strict positivity only at interior times when that is what is asked.

  1. How many nonnegative bridges of length \(10\) are there? How many are strictly positive at all interior times?
  2. For a simple symmetric walk of length \(4\), calculate the probability of a nonnegative bridge and the probability of a strict positive bridge.
  3. Among the five Dyck paths of length \(6\), which ones return to zero at an interior time?
  4. Explain why a strict positive bridge must start with \(U\) and finish with \(D\).
  5. For length \(8\), find the probability of a strict positive bridge conditional on the walk being a nonnegative bridge.