Recall that with the strategy of bold play in red and black, the gambler on each game bets either her entire fortune or the amount needed to reach the target fortune, whichever is smaller. As usual, we are interested in the probability that the player reaches the target and the expected number of trials. The first interesting fact is that only the ratio of the initial fortune to the target fortune matters, quite in contrast to timid play.

Suppose that the gambler plays boldly with initial fortune $x$ and target fortune $a$. As usual, let $X=\left(\begin{array}{c}X_{0}\\ X_{1}\\ \end{array}\right)$ denote the fortune process for the gambler. Argue that for any $c> 0$, the random process $cX=\left(\begin{array}{c}cX_{0}\\ cX_{1}\\ \end{array}\right)$ is the fortune process for bold play with initial fortune $cx$ and target fortune $ca$.

Because of this result, it is convenient to use the target fortune as the monetary unit and to allow irrational, as well as rational, initial fortunes. Thus, the fortune space is $\left[0 , 1\right]$. Sometimes in our analysis we will ignore the states 0 or 1; clearly there is no harm in this because in these states, the game is over.

Recall that the betting function $S$ is the function that gives the amount bet as a function of the current fortune. Show that

$$S(x)=\n\t\t\t\n\t\t\t\tx\n\t\t\t\t\n\t\t\t\t\t1\n\t\t\t\t\tx\n\t\t\t\t\n\t\t\t\n\t\t=\begin{cases}x & \text{if $0\le x\le 1/2$}\\ 1-x & \text{if $1/2\le x\le 1$}\end{cases}$$We will denote the probability that the bold gambler reaches the target $a=1$ starting from the initial fortune $x\in \left[0 , 1\right]$ by $F(x)$. By Exercise 1, the probability that the bold gambler reaches some other target value $a$, starting from $x\in \left[0 , a\right]$ is $F(\frac{x}{a})$.

By conditioning on the outcome of the first game, show that $F$ satisfies the functional equation in part (a) and boundary conditions in part (b):

- $F(x)=\begin{cases}pF(2x) & \text{if $x\in \left[0 , 1/2\right]$}\\ p+qF(2x-1) & \text{if $x\in \left[1/2 , 1\right]$}\end{cases}$
- $F(0)=0\text{,\hspace{0.5em}}F(1)=1$

From the prvious exericse, and a little thought, it should be clear that an important role is played by the function $d$ defined on $\left[0 , 1\right)$ by

$$d(x)=2x-\lfloor 2x\rfloor =\begin{cases}2x & \text{if $x\in \left[0 , 1/2\right)$}\\ 2x-1 & \text{if $x\in \left[1/2 , 1\right)$}\end{cases}$$The function $d$ is sometimes called the doubling function, mod 1, since $d(x)$ gives the fractional part of $2x$. Note that until the last bet that ends the game (with the player ruined or victorious), the successive fortunes of the player follow iterates of the map $d$. Thus, bold play is intimately connected with the dynamical system associated with $d$.

One of the keys to our analysis is to represent the initial fortune in binary form. The binary expansion of $x\in \left[0 , 1\right)$ is

$$x=\sum_{i=1}^{\infty} \frac{x_{i}}{2^{i}}$$where $x_{i}\in \{0, 1\}$ for each $i\in $. This representation is unique except when $x$ is a binary rational (sometimes also called a dyadic rational), that is, a number of the form $\frac{k}{2^{n}}$ where $n\in $ and $k\in \{1, 3, , 2^{n}-1\}$; the positive integer $n$ is called the rank of $x$. For a binary rational $x$ of rank $n$, we will use the standard terminating representation where $x_{n}=1$ and $x_{i}=0$ for $i> n$. Rank can be extended to all numbers in [0, 1) by defining the rank of 0 to be 0 (0 is also considered a binary rational) and by defining the rank of a binary irrational to be $\infty $. We will denote the rank of $x$ by $r(x)$.

Applied to the binary sequences, the doubling function $d$ is the shift operator:

Show that $d(x)_{i}=x_{i+1}$ for $x\in \left[0 , 1\right)$

Bold play in red and black can be elegantly described by comparing the bits of the inital fortune with the game bits.

Suppose that gambler starts with initial fortune $x\in \left(0 , 1\right)$. Show that the gambler eventually reaches the target 1 if and only if there exists a positive integer $k$ such that $I_{j}=1-x_{j}$ for $j\in \{1, 2, , k-1\}$ and $I_{k}=x_{k}$. That is, the gambler wins if and only if when the game bit agrees with the corresponding fortune bit for the first time, that bit is 1.

The random variable whose bits are the complements of the fortune bits will play an important role in our analysis. Thus, let

$$W=\sum_{i=1}^{\infty} \frac{1-I_{j}}{2^{j}}$$Note that $W$ is a well defined random variable taking values in $\left[0 , 1\right]$.

Suppose that the gambler starts with initial fortune $x\in \left(0 , 1\right)$. Use the result of the previous exercise to show that the gambler reaches the target 1 if and only if $W< x$.

Show that $W$ has a continuous distribution. That is, show that $(W=x)=0$ for any $x\in \left[0 , 1\right]$.

From the previous two exercises, it follows that $F$ is simply the distribution function of $W$. In particular, $F$ is an increasing function, and since $W$ has a continuous distribution, $F$ is a continuous function.

Show that the success function $F$ is the unique continuous solution of the functional equation in Exercise 3.

- Use induction on the rank to show that any two solutions must agree at the binary rationals.
- Use part (a) and continuity to show that any two continuous solutions must agrre for all $x$.

If we introduce a bit more notation, we can give nice expression for $F(x)$, and later for the expected number of games $G(x)$. Let $p_{0}=p$ and $p_{1}=q=1-p$.

Show that

$$F(x)=\sum_{n=1}^{\infty} p_{x_{1}}p_{x_{n-1}}px_{n}$$Show that $F$ is strictly increasing on $\left[0 , 1\right]$. This means that the distribution of $W$ has support $\left[0 , 1\right]$; that is, there are no subintervals of $\left[0 , 1\right]$ that have positive length, but 0 probability.

In particular, show that

- $F(1/8)=p^{3}$
- $F(2/8)=p^{2}$
- $F(3/8)=p^{2}+p^{2}q$
- $F(4/8)=p$
- $F(5/8)=p+p^{2}q$
- $F(6/8)=p+pq$
- $F(7/8)=p+pq+pq^{2}$

Suppose that $p=1/2$. Show that $F(x)=x$ for $x\in \left[0 , 1\right]$ in two ways:

- Using the functional equation in Exericse 3.
- Using the representation in Exercise 10.

Thus, for $p=1/2$ (fair trials), the probability that the bold gambler reaches the target fortune $a$ starting from the initial fortune $x$ is $\frac{x}{a}$, just as it is for the timid gambler. Note also that the random variable $W$ has the uniform distribution on $\left[0 , 1\right]$. When $p\neq 1/2$, the distribution of $W$ is quite strange. To state the result succinctly, we will indicate the dependence of the of the probability measure $$ on the parameter $p\in \left(0 , 1\right)$. First we define

$$C_{p}=\{x\in \left[0 , 1\right]\colon \frac{1}{n}\sum_{i=1}^{n} 1-x_{i}\to p\text{\hspace{0.5em}as\hspace{0.5em}}n\to \infty \}$$Thus, $C_{p}$ is the set of $x\in \left[0 , 1\right]$ for which the relative frequency of 0's in the binary expansion is $p$.

Use the strong law of large numbers to show that

- $_{p}(W\in C_{p})=1$ for $p\in \left(0 , 1\right)$
- $_{p}(W\in C_{t})=0$ for $p\neq t$

Show that when $p\neq 1/2$, $W$ does not have a probability density function, even though it has a continuous distribution. The following steps outline a proof by contradiction

- Suppose that $W$ has probability density function $f$
- Then $_{p}(W\in C_{p})=\int_{C_{p}} f(x)\,d x$.
- By the previous exercise, $_{p}(W\in C_{p})=1$.
- But also $\int_{C_{p}} 1\,d x=_{1/2}(W\in C_{p})=0$. That is, $C_{p}$ has Lebesgue measure 0.
- Hence $\int_{C_{p}} f(x)\,d x=0$.

When $p\neq 1/2$, $F$ has derivative 0 at almost every point in $\left[0 , 1\right]$, even though it is strictly increasing. The following picture shows the graphs of $F$ when $p=0.5$, $p=0.4$, and $p=0.2$.

In the red and black experiment, select *Bold Play*. Vary the initial fortune, target fortune, and game win probability with the scroll bars and note how the probability of winning the game changes. In particular, note that this probability depends only on
$\frac{x}{a}$.
Now for various values of the parameters, run the experiment 1000 times with an update frequency of 100 and note the apparent convergence of the
relative frequency function to the probability density function.

Let $G(x)=(N, X_{0}=x)$ for $x\in \left[0 , 1\right]$, the expected number of trials starting at $x$. For any other target fortune $a\in \left(0 , \infty \right)$, the expected number of trials starting at $x\in \left[0 , a\right]$ is just $G(\frac{x}{a})$.

By conditioning on the outcome of the first game, show that $G$ satisfies the following functional equation in (a) and boundary conditions (b):

- $G(x)=\begin{cases}1+pG(2x) & \text{if $x\in \left(0 , 1/2\right]$}\\ 1+qG(2x-1) & \text{if $x\in \left[1/2 , 1\right)$}\end{cases}$
- $G(0)=0\text{,\hspace{0.5em}}G(1)=0$

Note, interestingly, that the functional equation is not satisfied at $x=0$ or $x=1$. As before, we can give an alternate analysis using the binary representation of an initial fortune $x\in \left(0 , 1\right)$.

Suppose that the initial fortune of the gambler is $x\in \left(0 , 1\right)$. Show that $N=\min\{(I_{k}=x_{k})\lor (k=r(x))\mid (I_{k}=x_{k})\lor (k=r(x))\}$.

- If $x$ is a binary rational then $N$ takes values in the set $\{1, 2, , r(x)\}$. Play continues until the game number agrees with the rank of the fortune or a game bit agrees with the corresponding fortune bit, whichever is smaller. In the first case, the penultimate fortune is $1/2$, the only fortune for which the next game is always final.
- If $x$ is a binary irrational then $N$ takes values in $$. Play continues until a game bit agrees with a corresponding fortune bit.

We can give an explicit formula for the expected number of trials $G(x)$ in terms of the binary representation of $x$.

Suppose that $x\in \left(0 , 1\right)$, and recall our special notation: $p_{0}=p$, $p_{1}=q$. Show that

$$G(x)=\sum_{n=0}^{r(x)-1} p_{x_{1}}p_{x_{n}}$$- Note that the $n=0$ term is 1, since the product is empty.
- The sum has a finite number of terms if $x$ is a binary rational.
- The sum has an infinte number of terms if $x$ is a binary irrational.

Use the result of the last exercise to verify the following values:

- $G(1/8)=1+p+p^{2}$
- $G(2/8)=1+p$
- $G(3/8)=1+p+pq$
- $G(1/8)=1$
- $G(5/8)=1+q+pq$
- $G(6/8)=1+q$
- $G(7/8)=1+q+q^{2}$

Suppose that $p=1/2$. Show that

$$G(x)=\begin{cases}2-\frac{1}{2^{(r(x)-1)}} & \text{if $x\text{\hspace{0.5em}is binary rational}$}\\ 2 & \text{if $x\text{\hspace{0.5em}is binary irrational}$}\end{cases}$$In the red and black experiment, select *Bold Play*. Vary
$x$,
$a$, and
$p$ with the scroll bars and note how the expected number of trials changes. In particular, note that the mean depends only on the ratio
$\frac{x}{a}$.
For selected values of the parameters, run the experiment 1000 times with an update frequency of 100 and note the apparent convergence of the sample mean to the distribution mean.

For fixed $x$, show that $G$ is continuous as a function of $p$.

However, as a function of the initial fortune $x$, for fixed $p$, the function $G$ is very irregular.

Show that $G$ is discontinuous at the binary rationals in $\left[0 , 1\right]$ and continuous at the binary irrationals.