Mathematical Curiosities & Special Topics

Gambler's Ruin Calculator

Find the probability of reaching a goal before zero and the expected duration.

Mathematical Curiosities & Special Topics

Enter model data

Private calculation in your browser

Use the labelled probability protocol, game rule, finite bound, or numerical model. Simulations are seeded and reproducible; theoretical results remain separate. Inputs stay on this device.

Result

Enter valid values to see the result.

Your entries are calculated in this browser and are not submitted to 365CALCS.COM.

Quick guide

How to use this calculator

  1. Select the stated protocol, strategy, approximation, or conversion mode when one is available.
  2. Enter the labelled finite bound, probabilities, payoffs, sequence state, or special-function argument.
  3. Read the theoretical or deterministic result separately from any seeded empirical result.

Calculation method

Apply the stated mathematical model

For p=1/2, P=i/N and E=i(N−i); biased formulas use q/p powers.

The calculator validates model hypotheses, finite work limits, probability domains, singular cases, and numerical approximation ranges before returning a result.

Worked example

Worked example

Starting at 5 with goal 10 in a fair game gives win probability 1/2.

For p=1/2, P=i/N and E=i(N−i); biased formulas use q/p powers.

Supported inputs

Precision and limits

Model scope

Paradoxes depend on their information or randomization protocol. Queueing, games, fractals, and cellular automata use exactly the visible assumptions; changing those assumptions changes the answer.

Deterministic versus simulated

Exact combinatorial and theoretical probabilities are labelled separately from seeded pseudorandom simulations. Reusing a seed reproduces the same finite experiment.

Numerical methods

Finite double-precision arithmetic is used for probability models and special functions. Gamma uses a bounded Lanczos approximation, Bessel J uses a bounded convergent series, and erf/erfc disclose their approximation error.

Limits

Iteration, grid, candidate, trial, and series caps are visible in field labels or calculator-specific notes. A bounded trace never claims to prove an unresolved conjecture.