Gambler's Ruin
In statistics, gambler's ruin is the fact that a persistent gambler with finite wealth, playing a fair game (that is, each bet has expected value of zero to both sides) will eventually and inevitably go broke against an opponent with infinite wealth.
The concept was initially stated: A persistent gambler who raises his bet to a fixed fraction of the gambler's bankroll after a win, but does not reduce it after a loss, will eventually and inevitably go broke, even if each bet has a positive expected value.
Below simulates a situation where a game will randomly (50%-50%) increase of deduct a proportion ("Rate") of the money you have, which in the beginning is "Base".
Hit plot botton to see how your money changes during the period of you specify in "Period" field.
Final Value (rounded):
See how your money will eventually become in the long run, even though the mathematical expectation of change in money is 0, somewhat meaning you should at least get your base back in the end.
import numpy as np import matplotlib.pyplot as plt base=10000 rate=.5 period=365 seq=[] for i in range(period): seq.append(base) base*=np.random.choice([1-rate,1+rate]) print(seq[-1]) plt.plot(seq)