which the expected value of betting everything is the same as that of cashing
in. If the game only has two possible outcomes, u
1
= −1 with probability
1 − p and u
2
= u, a positive integer, with probability p, then a
n
can be
calculated by finding the integer r such that N/(u + 1)
r
≤ n < N/(u + 1)
r−1
,
and then a
n
= p
r
((u + 1)
r
n − m), so a
n
is a piecewise linear function on
n. I cannot prove all this, but I have quite good numerical evidence. The
idea for the proof I have depends on some kind of convexity of the sequence
a
n
. (Convexity means a
n
≤ (a
n−1
+ a
n+1
)/2, in other words, that the player
should always take a bet with no house edge. I would only need something
weaker, that a
n
/n increases with n, and a
n+k
≤ a
n
+ k, the latter meaning
that value of the phantom bonus decreases as n increases.)
If the conjecture is true, then the calculations can be restricted to n < N ,
which makes each iterative step finite.
Another approach to the problem is that if the optimal strategy is known
for each n, then we can write down the linear equations relating the a
n
and
solve them, this gives exact answers, unfortunately the optimal strategy is
not known in advance.
The method described below is a combination of iterations and linear
equations.
Step 1. Calculate N by (1). Set a
n
= n for n < 0, a
n
= 0 for 0 ≤ n ≤ m,
and a
n
= n − m for m < n ≤ N.
Step 2. Check for each n, 0 < n ≤ N, whether betting the maximum possible
amount improves the current value of a
n
, and if so, update the value of a
n
.
Do this 10, 20 or 50 times, the exact number does not seem to make much
difference in the running time. For some reason I do not understand, going
in decreasing order of n gives faster convergence than in increasing order.
Step 3. Calculate the optimal strategy using the current values for a
n
, and
solve the resulting linear equations. This is equivalent to using the currently
optimal strategy and letting it converge. This is the slowest step because
it involves solving a large, but sparse system of linear equations, usually
consisting of several hundred equations.
Step 4. For each n, calculate the expected value of betting any of possible
bet sizes using the current values of a
n
. If this does not give an improvement
for any n, then the current numbers are the exact values of a
n
, and we can
also deduce the optimal strategy. If improvement is possible, then go back
to Step 2.
The calculations were carried out using Mathematica, which can handle
3