Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceProbability & MeasureStochastic ModelsMarket MicrostructureGuide
Stochastic Models
Random Walk
Random Walk labSymmetric Random WalkRescaled Random WalkStandard deviationCentral Limit Theorem
Brownian Motion
Brownian labDefining the Wiener processIncrement explorerJoint distributions and covarianceBrownian transformations and invarianceQuadratic variationBrownian bridgeRunning maximum and minimumReflection principleFirst passage timesHitting probabilities
Geometric Brownian Motion
LabDefinition: ABM vs GBMEuler–MaruyamaMean reversionJumpsCorrelated motions
Itô Process
LabItô integralItô's lemmaMartingalesGirsanov
Monte Carlo
LabVariance reductionFeynman–Kac
Connected Guides
  • Random walks and Brownian motion
  • Itô's lemma
  • Filtrations, adapted processes and stopping times
  • Conditional expectation and martingales
  • Properties of Brownian motion
  • The reflection principle and first passage times
  • The Brownian bridge
  • The Itô integral

© 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.

First passage times

When does a Brownian path first reach level a, and how long do we have to wait?

Goal: stop paths at the level, measure the distribution of first passage times and compare it with the Lévy density.

Simulation controls

Level (barrier) aDoubling a roughly quadruples the waiting time: τₐ ∼ a²·τ₁
0.50
0.22.5
1,500
1003000
7
19999
Predict first

What share of paths touches the barrier a = 0.50 at least once by t = 1?

Empirical vs theory

P(τₐ ≤ 1) empirical
?
2(1 − Φ(a)) theory
?
Median of τₐ, empirical
0.672
Median of τₐ, theory
0.550

Almost every path eventually reaches level a, yet E[τₐ] = ∞: rare, very long waits weigh enough to make the mean infinite. That is why the median is the meaningful summary here.

Calibration: 90% range

Give a 90% range for the first time the path reaches a = 0.50.

The hitting-time law is heavy-tailed: its mean is infinite, so allow a long right tail.

0.001010000
Your 90% range: 0.10 … 1.00

Try this

  1. Predict first: if you double a, by what factor does the median of τₐ grow? Check a = 0.5 against a = 1.
  2. Look at the density near t ≈ 0: why is an almost immediate hit practically impossible?
  3. Push a above 2: what happens to the fraction of paths that hit within [0, 1] and to the area under the histogram?
Paths stopped at the level, W(t ∧ τₐ)
a = 0.50

Each path freezes as soon as it reaches level a. The fraction collecting at the level grows with t, but slowly: many paths take a very long time to get there.

Density of τₐ on [0, 1]
τₐ empiricalLévy density

The histogram is normalised by the full sample, so its area is P(τₐ ≤ 1) < 1 — the remaining paths arrive after t = 1. The curve is a/√(2πt³)·exp(−a²/2t).