Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceStochastic ModelsGuide
Guide
Derivatives pricing
01Forwards, calls and puts02Combining positions03Arbitrage and the forward price04Put–call parity05The one-step binomial model06Risk-neutral probabilities07Multi-step trees and backward induction08American options and early exercise09Delta and hedging10Geometric Brownian motion11The Black–Scholes formula12The Greeks: gamma, vega, theta and rho13Implied volatility and the volatility smile14Stochastic volatility and the Heston model15Static replication: Breeden–Litzenberger and Carr–Madan16Exotic options: barriers, Asians and digitals
Portfolio & risk
01Returns and volatility02Diversification and correlation03The efficient frontier and the capital market line04Risk aversion and the optimal complete portfolio05CAPM, beta and the security market line06Performance measures: Sharpe, Treynor, Jensen and information ratio07Factor models and systematic risk08Value at Risk and expected shortfall
Fixed income
01Bond prices and yields02Duration and convexity03Immunization and duration matching04Spot rates, forward rates and the yield curve05Bond futures and the cheapest-to-deliver06Interest rate swaps07Callable bonds and negative convexity08Credit risk: default probabilities and credit spreads
Corporate finance
01Interest, compounding and discounting02Annuities, perpetuities and loan amortization03Net present value and internal rate of return04The weighted average cost of capital05Capital structure and the Modigliani–Miller theorems06Discounted cash flow valuation07Relative valuation with multiples08Real options: the value of flexibility
Stochastic models
01Random walks and Brownian motion02Probability spaces, σ-algebras and random variables03Filtrations, adapted processes and stopping times04Conditional expectation and martingales05Properties of Brownian motion06The reflection principle and first passage times07The Brownian bridge08The Itô integral09Itô's lemma10Kolmogorov equations and the Feynman–Kac formula11Change of measure and Girsanov's theorem12Monte Carlo option pricing13Simulating SDEs: the Euler–Maruyama scheme14Mean reversion: Ornstein–Uhlenbeck and Vasicek15Jumps and the Merton jump-diffusion model
Knowledge graph

© 2026 Quant Sandbox · A study aid for quantitative finance

Privacy & dataNo cookies

This site does not use cookies and asks for no personal data. It keeps a few small settings in your browser's local storage — your chosen theme and language, the sidebar layout, and your progress and answers in the Guides — so it remembers them on your next visit. This data never leaves your device; clearing your browser storage removes it. Inputs you change can also be captured in the page URL, so you can share or bookmark a specific setup. The site uses Vercel Web Analytics, a privacy-friendly, cookieless service that records only anonymous, aggregated usage (such as page views) without identifying you or tracking you across other sites.

Guide/Stochastic models

The reflection principle and first passage times

Lesson 6 of 15 · 1 min read

This lesson computes the distribution of the running maximum of Brownian motion and of the first time it reaches a given level. The tool is the reflection principle, which rests on the strong Markov property from "Properties of Brownian motion" and on the notion of a stopping time from "Filtrations, adapted processes and stopping times". The results are exact closed forms, and they are the basis of barrier option pricing.

Running maximum and first passage time

Let WWW be a standard Brownian motion with natural filtration (FtW)(\mathcal{F}^W_t)(FtW​) and fix a level a>0a > 0a>0. Define the running maximum and the first passage time

Mt=max⁡0≤s≤tWs,τa=inf⁡{t≥0:Wt=a}.M_t = \max_{0 \le s \le t} W_s, \qquad \tau_a = \inf\{t \ge 0 : W_t = a\}.Mt​=0≤s≤tmax​Ws​,τa​=inf{t≥0:Wt​=a}.

The maximum exists because the path is continuous on the compact interval [0,t][0, t][0,t]. Since W0=0<aW_0 = 0 < aW0​=0<a and paths are continuous, the intermediate value theorem gives the identity of events

{τa≤t}={Mt≥a},Wτa=a  on {τa<∞}.\{\tau_a \le t\} = \{M_t \ge a\}, \qquad W_{\tau_a} = a \ \text{ on } \{\tau_a < \infty\}.{τa​≤t}={Mt​≥a},Wτa​​=a  on {τa​<∞}.

τa\tau_aτa​ is a stopping time. By continuity, Mt≥aM_t \ge aMt​≥a holds exactly when for every nnn some rational q∈[0,t]q \in [0, t]q∈[0,t] has Wq>a−1/nW_q > a - 1/nWq​>a−1/n, so

{τa≤t}=⋂n≥1 ⋃q∈Q∩[0,t]{Wq>a−1/n}∈FtW,\{\tau_a \le t\} = \bigcap_{n \ge 1}\ \bigcup_{q \in \mathbb{Q} \cap [0,t]} \{W_q > a - 1/n\} \in \mathcal{F}^W_t,{τa​≤t}=n≥1⋂​ q∈Q∩[0,t]⋃​{Wq​>a−1/n}∈FtW​,

a countable combination of events that are each known at time ttt. By recurrence, τa<∞\tau_a < \inftyτa​<∞ almost surely; this also follows from the formula below.

The reflection argument

Define the reflected path: follow WWW until it first reaches aaa, then mirror it in the line y=ay = ay=a:

W~t={Wt,t≤τa,2a−Wt,t>τa.\widetilde W_t = \begin{cases} W_t, & t \le \tau_a, \\ 2a - W_t, & t > \tau_a. \end{cases}Wt​={Wt​,2a−Wt​,​t≤τa​,t>τa​.​

Claim: W~\widetilde WW is again a standard Brownian motion. This is where the strong Markov property enters. Applied at the stopping time τa\tau_aτa​, it says that Bs=Wτa+s−aB_s = W_{\tau_a + s} - aBs​=Wτa​+s​−a, s≥0s \ge 0s≥0, is a Brownian motion independent of Fτa\mathcal{F}_{\tau_a}Fτa​​, and in particular of the stopped path (Wt∧τa)t≥0(W_{t \wedge \tau_a})_{t \ge 0}(Wt∧τa​​)t≥0​. By symmetry −B-B−B is also a Brownian motion independent of Fτa\mathcal{F}_{\tau_a}Fτa​​. Hence the pairs (stopped path, BBB) and (stopped path, −B-B−B) have the same joint law. WWW is obtained from the first pair by gluing a+Ba + Ba+B onto the stopped path at τa\tau_aτa​, and W~\widetilde WW from the second pair by the same gluing map, so WWW and W~\widetilde WW have the same law.

Both requirements are essential. At a fixed time sss the ordinary Markov property would suffice, but τa\tau_aτa​ is random. And the argument would fail for a random time that looks ahead, such as the time at which the maximum over [0,1][0, 1][0,1] is attained: after that time the path is forced to stay below its maximum, so it is not a fresh Brownian motion.

Now count paths. W~\widetilde WW reaches aaa at the same time τa\tau_aτa​ as WWW, and on {τa≤t}\{\tau_a \le t\}{τa​≤t} we have W~t=2a−Wt\widetilde W_t = 2a - W_tWt​=2a−Wt​, so Wt<aW_t < aWt​<a exactly when W~t>a\widetilde W_t > aWt​>a. Using that W~\widetilde WW has the law of WWW, and that {Wt>a}⊂{τa≤t}\{W_t > a\} \subset \{\tau_a \le t\}{Wt​>a}⊂{τa​≤t},

P(Mt≥a, Wt<a)=P(τa≤t, W~t>a)=P(τa≤t, Wt>a)=P(Wt>a).\mathbb{P}(M_t \ge a,\ W_t < a) = \mathbb{P}(\tau_a \le t,\ \widetilde W_t > a) = \mathbb{P}(\tau_a \le t,\ W_t > a) = \mathbb{P}(W_t > a).P(Mt​≥a, Wt​<a)=P(τa​≤t, Wt​>a)=P(τa​≤t, Wt​>a)=P(Wt​>a).

Since P(Wt=a)=0\mathbb{P}(W_t = a) = 0P(Wt​=a)=0, splitting {Mt≥a}\{M_t \ge a\}{Mt​≥a} by the sign of Wt−aW_t - aWt​−a gives the theorem.

Reflection principle: for a>0a > 0a>0 and t>0t > 0t>0, P(Mt≥a)=2 P(Wt≥a)=2(1−Φ(a/t))\mathbb{P}(M_t \ge a) = 2\,\mathbb{P}(W_t \ge a) = 2\big(1 - \Phi(a/\sqrt{t})\big)P(Mt​≥a)=2P(Wt​≥a)=2(1−Φ(a/t​)). In particular MtM_tMt​ has the same law as ∣Wt∣|W_t|∣Wt​∣.

The last statement holds because P(∣Wt∣≥a)=2 P(Wt≥a)\mathbb{P}(|W_t| \ge a) = 2\,\mathbb{P}(W_t \ge a)P(∣Wt​∣≥a)=2P(Wt​≥a) for a>0a > 0a>0. A fair picture is a mirror placed at height aaa: every path that touches aaa and ends below it has a mirror twin that ends above it, equally likely, so touching paths split evenly between the two sides. For the coin-flip walk the same argument with steps of ±1\pm 1±1 is exact and is André's classical solution of the ballot problem.

Worked numbers

Take a=1a = 1a=1, t=1t = 1t=1. Then P(W1≥1)=1−Φ(1)≈0.1587\mathbb{P}(W_1 \ge 1) = 1 - \Phi(1) \approx 0.1587P(W1​≥1)=1−Φ(1)≈0.1587, and

P(M1≥1)=2(1−Φ(1))≈0.3173.\mathbb{P}(M_1 \ge 1) = 2\big(1 - \Phi(1)\big) \approx 0.3173.P(M1​≥1)=2(1−Φ(1))≈0.3173.

About one path in three reaches level 1 within one unit of time, although only one in six ends above it. Since M1∼∣W1∣M_1 \sim |W_1|M1​∼∣W1​∣, the expected maximum is E[M1]=E∣W1∣=2/π≈0.7979\mathbb{E}[M_1] = \mathbb{E}|W_1| = \sqrt{2/\pi} \approx 0.7979E[M1​]=E∣W1​∣=2/π​≈0.7979.

Application: model the log price as driftless, ln⁡(St/S0)=σWt\ln(S_t/S_0) = \sigma W_tln(St​/S0​)=σWt​, with S0=100S_0 = 100S0​=100 and σ=20%\sigma = 20\%σ=20%. The probability that the stock touches 120 within one year is the probability that WWW reaches a=ln⁡(1.2)/0.2≈0.9116a = \ln(1.2)/0.2 \approx 0.9116a=ln(1.2)/0.2≈0.9116 by t=1t = 1t=1:

P(max⁡s≤1Ss≥120)=2(1−Φ(0.9116))≈0.362.\mathbb{P}\Big(\max_{s \le 1} S_s \ge 120\Big) = 2\big(1 - \Phi(0.9116)\big) \approx 0.362.P(s≤1max​Ss​≥120)=2(1−Φ(0.9116))≈0.362.

With a drift ν\nuν in the log price, Xs=νs+σWsX_s = \nu s + \sigma W_sXs​=νs+σWs​, the reflection principle no longer applies directly, because the drifted process is not symmetric. The answer, obtained in "Change of measure and Girsanov's theorem" by removing the drift, is

P(max⁡s≤TXs≥m)=1−Φ(m−νTσT)+e2νm/σ2 Φ(−m−νTσT).\mathbb{P}\Big(\max_{s \le T} X_s \ge m\Big) = 1 - \Phi\Big(\frac{m - \nu T}{\sigma\sqrt{T}}\Big) + e^{2\nu m/\sigma^2}\,\Phi\Big(\frac{-m - \nu T}{\sigma\sqrt{T}}\Big).P(s≤Tmax​Xs​≥m)=1−Φ(σT​m−νT​)+e2νm/σ2Φ(σT​−m−νT​).

For ν=0\nu = 0ν=0 it reduces to 2(1−Φ(m/(σT)))2(1 - \Phi(m/(\sigma\sqrt{T})))2(1−Φ(m/(σT​))). With ν=−σ2/2=−0.02\nu = -\sigma^2/2 = -0.02ν=−σ2/2=−0.02 (zero expected stock return) the touching probability above becomes about 0.3300.3300.330.

The figure fixes T=1T = 1T=1 and lets you set the level aaa between 0.2 and 2.5 (default 1). It draws one sample path that reaches aaa (paths are resampled until one does), the line y=ay = ay=a, and, dashed, the reflection of the path after τa\tau_aτa​; "New path" draws another. The readouts come from 20 000 simulated paths with 500 steps each: the share of paths with maximum at least aaa, the exact value 2(1−Φ(a))2(1 - \Phi(a))2(1−Φ(a)), and the share with W1≥aW_1 \ge aW1​≥a. The first is close to twice the third. It is also slightly below the exact value, because the simulated maximum is taken only over the 500 grid points and misses crossings that happen between them; at a=1a = 1a=1 it comes out near 0.300.300.30 rather than 0.3170.3170.317. The lesson "The Brownian bridge" computes the probability of such a hidden crossing.

Reflection principleOpen in Stochastic Learning Studio →
1.00
0.22.5
aReflected pathW(t)
Share with max ≥ a (20 000 paths)
30.98%
2·P(W₁ ≥ a)
31.73%
Share with W₁ ≥ a
16.05%

The law of the first passage time

Because {τa≤t}={Mt≥a}\{\tau_a \le t\} = \{M_t \ge a\}{τa​≤t}={Mt​≥a}, the reflection principle gives the distribution function of τa\tau_aτa​, and differentiating in ttt (using ddt at−1/2=−12at−3/2\tfrac{d}{dt}\,a t^{-1/2} = -\tfrac12 a t^{-3/2}dtd​at−1/2=−21​at−3/2) gives its density:

P(τa≤t)=2(1−Φ(at)),fτa(t)=a2πt3 e−a2/(2t),t>0.\mathbb{P}(\tau_a \le t) = 2\Big(1 - \Phi\Big(\frac{a}{\sqrt{t}}\Big)\Big), \qquad f_{\tau_a}(t) = \frac{a}{\sqrt{2\pi t^3}}\,e^{-a^2/(2t)}, \quad t > 0.P(τa​≤t)=2(1−Φ(t​a​)),fτa​​(t)=2πt3​a​e−a2/(2t),t>0.

This is the Lévy distribution. Two facts follow:

  • P(τa<∞)=lim⁡t→∞2(1−Φ(a/t))=2(1−Φ(0))=1\mathbb{P}(\tau_a < \infty) = \lim_{t \to \infty} 2(1 - \Phi(a/\sqrt{t})) = 2(1 - \Phi(0)) = 1P(τa​<∞)=limt→∞​2(1−Φ(a/t​))=2(1−Φ(0))=1: every level is reached almost surely.
  • E[τa]=∞\mathbb{E}[\tau_a] = \inftyE[τa​]=∞: for large ttt, t fτa(t)≈a (2π)−1/2 t−1/2t\,f_{\tau_a}(t) \approx a\,(2\pi)^{-1/2}\,t^{-1/2}tfτa​​(t)≈a(2π)−1/2t−1/2, which is not integrable on [1,∞)[1, \infty)[1,∞).

The level is certain to be reached, but the expected waiting time is infinite. The median is finite: P(τa≤t)=12\mathbb{P}(\tau_a \le t) = \tfrac12P(τa​≤t)=21​ when a/t=Φ−1(0.75)≈0.6745a/\sqrt{t} = \Phi^{-1}(0.75) \approx 0.6745a/t​=Φ−1(0.75)≈0.6745, that is t≈2.198 a2t \approx 2.198\,a^2t≈2.198a2. The factor a2a^2a2 is scaling at work: τa\tau_aτa​ has the same law as a2τ1a^2\tau_1a2τ1​. This also explains a point from "Conditional expectation and martingales": WWW is a martingale with W0=0W_0 = 0W0​=0, yet Wτa=aW_{\tau_a} = aWτa​​=a. Stopping at τa\tau_aτa​ turns a fair game into a sure gain only because τa\tau_aτa​ is unbounded with infinite mean, so the optional stopping theorem does not apply.

Joint law of the maximum and the endpoint

The same reflection gives more. For a≥0a \ge 0a≥0 and x≤ax \le ax≤a, on {τa≤t}\{\tau_a \le t\}{τa​≤t} the condition Wt≤xW_t \le xWt​≤x is equivalent to W~t≥2a−x\widetilde W_t \ge 2a - xWt​≥2a−x, and 2a−x≥a2a - x \ge a2a−x≥a forces τa≤t\tau_a \le tτa​≤t. Hence

P(Mt≥a, Wt≤x)=P(Wt≥2a−x)=1−Φ(2a−xt),a≥0, x≤a.\mathbb{P}(M_t \ge a,\ W_t \le x) = \mathbb{P}(W_t \ge 2a - x) = 1 - \Phi\Big(\frac{2a - x}{\sqrt{t}}\Big), \qquad a \ge 0,\ x \le a.P(Mt​≥a, Wt​≤x)=P(Wt​≥2a−x)=1−Φ(t​2a−x​),a≥0, x≤a.

Differentiating in aaa and xxx gives the joint density

fMt,Wt(m,w)=2(2m−w)2πt3 exp⁡(−(2m−w)22t),m≥0, w≤m.f_{M_t, W_t}(m, w) = \frac{2(2m - w)}{\sqrt{2\pi t^3}}\,\exp\Big(-\frac{(2m - w)^2}{2t}\Big), \qquad m \ge 0,\ w \le m.fMt​,Wt​​(m,w)=2πt3​2(2m−w)​exp(−2t(2m−w)2​),m≥0, w≤m.

For example, the probability that the path reaches 1 by time 1 but ends at or below 0 is P(W1≥2)=1−Φ(2)≈0.0228\mathbb{P}(W_1 \ge 2) = 1 - \Phi(2) \approx 0.0228P(W1​≥2)=1−Φ(2)≈0.0228.

This joint law is what barrier options need. An up-and-out call pays (ST−K)+(S_T - K)^+(ST​−K)+ only if the price stays below a barrier HHH throughout [0,T][0, T][0,T]. Under the Black–Scholes model the log price is a drifted Brownian motion, and the price of the option is a discounted integral of the payoff against the joint density of the maximum and the endpoint, adjusted for the drift as above. The closed-form barrier prices used in practice come from exactly this computation.

Summary

  • τa=inf⁡{t:Wt=a}\tau_a = \inf\{t : W_t = a\}τa​=inf{t:Wt​=a} is a stopping time and {τa≤t}={Mt≥a}\{\tau_a \le t\} = \{M_t \ge a\}{τa​≤t}={Mt​≥a}.
  • The strong Markov property at τa\tau_aτa​ makes the path reflected after τa\tau_aτa​ a Brownian motion; this gives P(Mt≥a)=2(1−Φ(a/t))\mathbb{P}(M_t \ge a) = 2(1 - \Phi(a/\sqrt{t}))P(Mt​≥a)=2(1−Φ(a/t​)) and Mt∼∣Wt∣M_t \sim |W_t|Mt​∼∣Wt​∣.
  • τa\tau_aτa​ has the Lévy density a(2πt3)−1/2e−a2/(2t)a(2\pi t^3)^{-1/2}e^{-a^2/(2t)}a(2πt3)−1/2e−a2/(2t): it is finite almost surely but has infinite mean.
  • P(Mt≥a,Wt≤x)=1−Φ((2a−x)/t)\mathbb{P}(M_t \ge a, W_t \le x) = 1 - \Phi((2a - x)/\sqrt{t})P(Mt​≥a,Wt​≤x)=1−Φ((2a−x)/t​) for x≤ax \le ax≤a; this joint law prices barrier options.
  • On a discrete time grid the simulated maximum is biased low because crossings between grid points are missed.
Try itReflect simulated paths at a level in the Stochastic Models studio →
3 questions on this lesson at the end of the series →
← PreviousProperties of Brownian motionNext →The Brownian bridge
Connections
The reflection principle and first passa…
Open the full graph →
Labs for this lesson
Stochastic Learning Studio