Skip to contents

A resource moves one unit at a time toward the first of two regions with probability p, and stops when a region holds nothing or everything (N). With \(\rho = (1-p)/p\), the probability of ending at zero from \(k\) is \((\rho^k - \rho^N)/(1 - \rho^N)\), which solves the harmonic equation \(p_k = p\,p_{k+1} + (1-p)\,p_{k-1}\) with \(p_0 = 1\), \(p_N = 0\) (Research.P4.Ruin.ruin_harmonic, ruin_boundary) by the de Moivre martingale \(\rho^{S_n}\) (deMoivre_step). At p = 1/2 the formula is 0/0 and the answer is \(1 - k/N\) (ruin_symmetric).

Usage

morie_ruin_probability(p, N, k = 0:N)

Arguments

p

Probability of a step toward the first region, in (0, 1).

N

Capacity (absorbing upper state).

k

Starting states; default all of 0:N.

Value

A numeric vector of absorption-at-zero probabilities, one per k, with rho as an attribute.

References

Grimmett G, Stirzaker D (2020). Probability and Random Processes, 4th ed., Example 12.5.8, Theorems 12.5.1 and 12.5.9. Oxford.

Examples

morie_ruin_probability(p = 0.4, N = 10)
#>  [1] 1.0000000 0.9911762 0.9779405 0.9580870 0.9283068 0.8836364 0.8166308
#>  [8] 0.7161224 0.5653598 0.3392159 0.0000000
#> attr(,"rho")
#> [1] 1.5
#> attr(,"theorem")
#> [1] "Research.P4.Ruin.ruin_harmonic"