Hitting Time Calculator

Model hitting time for Brownian motion, random walks. Choose parameters, then compute mean and risk. Keep a history and export clean reports anytime easily.

Switching the model refreshes input fields.
Initial position.
Barrier to be reached.
Mean rate of change per unit time.
Noise scale; set 0 for deterministic.
Cosmetic label for your report.

Example Data Table

Sample inputs and outputs to validate your understanding.
Values are approximate.
Model Inputs Key output
Brownian x₀=0, a=1, μ=0.5, σ=1 P≈1, E[τ]≈2
Brownian x₀=0, a=1, μ=-0.2, σ=1 P≈exp(-0.4)≈0.6703, E[τ]=∞
Random walk N=10, i=4, p=0.5 P=0.4, E[T]=24
Random walk N=10, i=4, p=0.55 P≈0.516, E[T]≈22.2

Formula Used

Brownian motion with drift
Process: Xt = x₀ + μt + σWt, hitting time τ = inf{t≥0 : Xt ≥ a}.
  • If μ>0 and a>x₀: E[τ] = (a−x₀)/μ
  • If μ>0 and a>x₀: Var[τ] = (a−x₀)σ²/μ³
  • Hit probability (μ<0): P(hit) = exp(2μ(a−x₀)/σ²)
Biased random walk (gambler’s ruin)
States 0..N, start i, step +1 with p, −1 with q=1−p, absorb at 0 or N.
  • If p=0.5: P(hit N first)=i/N, E[T]=i(N−i)
  • If p≠0.5: P=(1−(q/p)i)/(1−(q/p)N)
  • If p≠0.5: E[T] = i/(q−p) − N/(q−p)·(1−(q/p)i)/(1−(q/p)N)

How to Use This Calculator

  1. Select a model that matches your process or problem statement.
  2. Enter parameters with consistent units (levels and time units).
  3. Press Submit to compute probabilities and expectations.
  4. Review notes for edge cases like μ≤0 or boundary starts.
  5. Use the CSV/PDF buttons to export your latest history.

Why first-arrival timing matters

In threshold-driven systems, the clock to first reach a level governs decisions. If a process starts at x₀=0 and targets a=1 with μ=0.5, the mean time is 2.0 units. With μ=0.25, the mean doubles to 4.0. This scaling makes drift estimation central when planning timelines.

Drift controls typical time

For μ>0 in the continuous model, E[τ]=(a−x₀)/μ. Holding (a−x₀)=1, moving μ from 0.2 to 0.8 reduces E[τ] from 5.0 to 1.25. The change is linear in 1/μ, so small drift errors near zero produce large timing errors.

Noise controls uncertainty

When μ>0, Var[τ]=(a−x₀)σ²/μ³. With μ=0.5 and σ=1, Var[τ]=8. If σ increases to 1.5, Var[τ] becomes 18, increasing spread by 125%. Risk-aware planning should track both mean and variance, not just the average.

Downward drift reduces hit chance

When μ<0 and σ>0, reaching a higher level is not guaranteed. For x₀=0, a=1, μ=−0.2, σ=1, the hit chance is exp(−0.4)≈0.6703. If μ=−0.5 with the same σ, the chance drops to exp(−1)≈0.3679.

Discrete barriers mirror real steps

In the random-walk option with N=10 and i=4, a fair walk p=0.5 gives P(hit 10 first)=0.4 and E[T]=24 steps. With a modest bias p=0.55, the chance rises to about 0.516 while the expected absorption time often decreases slightly, reflecting more directed motion.

Interpreting the plotted curves

For μ>0, the plotted density is an inverse-Gaussian shape centered near m=(a−x₀)/μ, with a long right tail when σ is large or μ is small. For the random walk, the curve shows how starting position i shifts success probability from 0 to 1, supporting sensitivity checks across initial states.

FAQs

1) What is a hitting time?

It is the first time a process reaches a specified level or set. In this calculator, it is either the first time X(t) reaches a barrier a, or the first time a random walk hits 0 or N.

2) Why does the mean become infinite when μ≤0?

With nonpositive drift and positive noise, the process may never reach a higher barrier, so unconditional waiting can be arbitrarily long. The tool still reports the probability of ever hitting the level, which can be below 1 when μ<0.

3) What does the plotted density represent?

When μ>0, the curve approximates the hitting-time distribution using an inverse-Gaussian density with mean m and shape λ. It highlights early arrivals, the most likely time window, and the long-tail risk of late arrivals.

4) How should I choose N and i in the random walk?

Let N be the top threshold and i be your current state. Larger N increases expected absorption time. If i is near 0, reaching N first is unlikely unless p is significantly above 0.5.

5) Are the outputs exact?

The expectation and probability formulas are closed-form for both models. The plotted curve is a numerical trace computed from the analytic density (continuous case) or from repeated probability evaluation across i (discrete case).

6) What gets exported in CSV and PDF?

Exports include your recent submissions stored in the current session: timestamp, model, inputs, and key outputs. CSV is convenient for spreadsheets, while PDF provides a compact report snapshot for sharing or printing.

Recent Submissions

Stored in your session for quick exporting.
Timestamp Model Inputs Outputs
No submissions yet. Run a calculation to build history.

Related Calculators

euler maruyama methodbrownian motion toolrandom process variance

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.