Search Ctrl K
Home / Tools
THE FEUTEX TOOLKIT

Gambler Ruin Hitting Probability

Find the probability that a bounded random walk reaches its upper boundary before zero.

Probability workspace● Runs in your browser
01 Your input
02 Your result
View or copy raw result data
FormulaReach Upper = p===0.5 ? i/N : expm1(i*log((1-p)/p))/expm1(N*log((1-p)/p))
Sources and model references

Made for real tasks

  • Find the probability that a bounded random walk reaches its upper boundary before zero.
Explore step-by-step workflows →

Worked example

Inputs

Starting position
5 count
Upper boundary
10 count
Upward step probability
0.5 probability

Expected results

Reach Upper
0.5 probability

Load the example in the workspace to reproduce these results. Display rounding does not change the underlying calculation.

How to use this tool

  1. Enter starting position, upper boundary, upward step probability.
  2. Use the displayed units and confirm the model assumptions.
  3. Calculate and compare the outputs against your input scenario.

Try this example

{
  "i": 5,
  "N": 10,
  "p": 0.5
}

Accuracy and scope

Independent unit steps and fixed absorbing boundaries; excludes changing stakes, fees, and dependence.

Is my data uploaded?

This tool runs locally in your browser. Input and output are not sent to a processing server. Copy or download your result before leaving the page.