Your strategy of betting on single numbers so as to double your initial stake would work for the first $24$ bets, and has a probability of $1-\left(1-\frac{1}{37}\right)^{24} \approx 0.481893977$ of succeeding in at least one of these.
The $25$th round hits the problem that you cannot reach double as you have less than $\$\frac{3000}{36}\approx \$83.33$ left. So you might say bet everything that remains on a single number, which you will probably lose, ending the game. This has an overall probability about $\left(1-\frac{1}{37}\right)^{25} \approx 0.50410316$.
But there is a probability of $\frac{1}{37}\left(1-\frac{1}{37}\right)^{24} \approx 0.014002865$ still to deal with if you are still playing after $25$ rounds. What happens to this depends on exactly how much you have left at this stage, and that depends on the casino betting rules.
If you must bet whole numbers of dollars, so rounding up your earlier bets, you will have $\$34$ left after losing the first $24$ rounds and $\$1224$ left after winning the $25$th round. Following the same strategy as before will lead to an overall probability of winning of about $0.48745373$ and of losing of about $0.51254627$
If you can bet amounts including arbitrary fractions of dollars, so not rounding up your earlier bets, you will have about $\$50.70501$ left after losing the first $24$ rounds and $\$1825.38036$ left after winning the $25$th round. Following the same strategy as before will lead to an overall probability of winning of about $0.49027046$ and of losing of about $0.50972954$
Following the ideas in the suggested reading by Trurl, here is an outline of how to go about it in your case. The main complication in comparison with the linked random walk question is that the backward step is not $-1$. I'm going to go ahead and divide your amounts by 6 to simplify them, so if you win, you win $1$, and if you lose, you lose $m$. The specific example you give has $m = 5$, but it will work with any positive integer (I haven't tried to adapt to non-integer loss/win amount ratio).
Let's say that you start with $x$, and we want to find the probability of ruin if you play forever; call that probability $f(x)$. There are two ways that can happen: either you win the first round with a probability of $p$ (in your example $p = 0.9$), followed by a ruin from the new capital of $x+1$ with probability $f(x+1)$, or losing the first round with probability $1-p$ followed by ruin from capital $x-m$ with probability $f(x-m)$. So
$$ f(x) = p f(x+1) + (1-p)f(x-m) $$
This is valid so long as $x > 0$ so that you can actually play the first round. For $x \leq 0$, $f(x) = 0$ (the reserve is already exhausted). If you rearrange the above equation, you can get a recursive formula for the function:
$$ f(x+1) = \frac{f(x) - (1-p)f(x-m)}{p}. $$
But the problem is, while we know that $f(0)=0$, we can't use that to initiate the recursion, because the formula isn't valid for $x = 0$. So we need to find $f(1)$ in some other way, and this is where the random walk comes in.
Imagine starting with capital of $1$, and let $r_i$ define the probability of (eventually reaching) ruin by reaching the amount $-i$, but without reaching any value between $-i$ and $1$ before that. For example, $r_2$ is the probability of (sooner or later) getting from $1$ to exactly $-2$ (this might happen by winning a few rounds to get to $m-2$ and then losing the next round, for instance). $r_0$ is the probability of ruin by getting to $0$ exactly. So, how can that last event happen? Losing the first round would jump over $0$ straight to $1-m$, so the only possibility is winning (probability $p$), followed by either:
- a ruin from $2$ straight to $0$ (over possibly many rounds; "straight" here refers to never passing through $1$ on the way), which is the same as from $1$ straight to $-1$ (probability of $r_1$); or
- a "ruin" from $2$ to $1$ followed by ruin from $1$ to $0$ (probability of $r_0 \cdot r_0 = r_0^2$).
In other words, we have this equation:
$$ r_0 = p(r_1 + r_0^2) $$
Similarly, by considering the possible "paths" that can take us from $1$ to $-i$ we get for each $i < m-1$
$$ r_i = p(r_{i+1} + r_0r_i) $$
The $i = m-1$ case is slightly different from the others, ruin from $1$ to $-(m-1)$ can happen either by losing the first round directly ($1-p$), or winning the first round to get to $2$ and then (eventually) dropping down from $2$ to $1$ and (again, eventually) ruin from $1$ to $-(m-1)$:
$$ r_{m-1} = (1-p) + p \cdot r_0 \cdot r_{m-1}. $$
In principle, one can solve all these equations for the $r_i$'s simultaneously, but we can use a trick to avoid that. Let $s = \sum_{i=0}^{m-1} r_i$ (this is the total probability of ruin when starting from $1$, that is, $f(1)$, which we wanted to find). Add up all the equations, and you get
$$ s = 1-p + p(s - r_0) +p r_0 s $$
Solving for $s$,
$$ (1-p-pr_0) s = 1-p-pr_0 $$
which means that $s$ will have to be 1, unless $1-p-pr_0 = 0$. As that explanation of biased random walk proves rigorously, $s$ cannot be equal to 1 (your expectation value is positive, therefore statistically you must be moving away from $0$, not returning to it with certainty). We must conclude then that $1-p-pr_0 = 0$ which gives $r_0 = (1-p)/p$. It is easy to check that this leads to $r_i =(1-p)/p$ for all $i$ and indeed these values satisfy all the $r_i$ equations above. Thus finally,
$$ f(1) = s = r_0 + r_1 + \dots + r_{m-1} = \frac{n(1-p)}{p}. $$
Using this as a a starting point, now you can use the recursive equation we got in the beginning to find $f(x)$ for any $x$. With bets of \$6, \$2000 rescales to $x=334$, so $f(334)$ gives you the risk of ruin. Or, first find which $x$ gives you a tolerable risk, and from that determine the appropriate size of the bets, $\$2000/x$.
Best Answer
We can model this as an absorbing Markov chain with transition matrix $$ P=\left( \begin{array}{cccccccc} \frac{9}{19} & \frac{10}{19} & 0 & 0 & 0 & 0 & 0 & 0 \\ \frac{9}{19} & 0 & \frac{10}{19} & 0 & 0 & 0 & 0 & 0 \\ \frac{9}{19} & 0 & 0 & \frac{10}{19} & 0 & 0 & 0 & 0 \\ \frac{9}{19} & 0 & 0 & 0 & \frac{10}{19} & 0 & 0 & 0 \\ \frac{9}{19} & 0 & 0 & 0 & 0 & \frac{10}{19} & 0 & 0 \\ \frac{9}{19} & 0 & 0 & 0 & 0 & 0 & \frac{10}{19} & 0 \\ \frac{9}{19} & 0 & 0 & 0 & 0 & 0 & 0 & \frac{10}{19} \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end{array} \right). $$ Write $$ P=\begin{pmatrix}Q&R\\ \mathbf 0&I\end{pmatrix} $$ where $Q$ is the submatrix of $P$ corresponding to transitions between transient states and $R$ the submatrix of $P$ corresponding to transitions from transient states to the absorbing state. The expected number of steps to absorbtion is given by the first entry of $N\mathbf 1$ where $\mathbf 1$ is a column vector whose entries are identically $1$ and $$ N = \sum_{k=0}^\infty Q^k = (I-Q)^{-1}. $$ This quantity is $$ \frac{1865951449}{10000000}\approx186.595, $$ agreeing with your simulation.