<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "../../xhtml-math11-f.dtd">
<?xml-stylesheet type="text/xsl" href="../../mathml.xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Bold Play</title>
<meta name="Author" content="Kyle Siegrist" />
<meta name="Keywords" content="probability, statistics, games of chance, red and black, bold play, timid play" />
<link rel="icon" href="../../MAA.png" type="image/png" />
<link rel="stylesheet" href="../../ScreenStyles.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../PrintStyles.css" type="text/css" media="print" />
<link rel="stylesheet" href="SpecialStyles.css" type="text/css" media="screen" />
<link rel="previous" href="Optimal.xml" />
<link rel="next" href="Timid.xml" />
<script src="../../scripts.js" type="text/javascript"></script>
</head>

<body>

<div class="header">
<p><a href="http://www.mathdl.org/mathDL/23/" class="internal">Loci</a>, 2008<br />
<a href="http://mathdl.maa.org/mathDL/23/?pa=content&amp;sa=viewDocument&amp;nodeID=2699" class="internal">How to Gamble if You Must</a>, Kyle Siegrist</p>
</div>

<h2 class="internal">3. Bold Play</h2>

<p>Recall that with the strategy of <dfn>bold play</dfn> in <a href="RedBlack.xml" class="internal">red and black</a>, 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 <a href="Timid.xml" class="internal">timid play</a>.</p>

<div class="exercise" title="Mathematical exercise" id="Exercise3.1">
<p><strong>Exercise 3.1.</strong> Suppose that the gambler plays boldly with initial fortune <var>x</var> and target fortune <var>a</var>.  As usual, let
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<ci><mi mathvariant="bold-italic">X</mi></ci>
		<vector>
			<apply><selector />
				<ci>X</ci>
				<cn>0</cn>
			</apply>
			<apply><selector />
				<ci>X</ci>
				<cn>1</cn>
			</apply>
			<ci>...</ci>
		</vector>
	</apply>
</math>
denote the fortune process for the gambler. Argue that for any
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><gt />
		<ci>c</ci>
		<cn>0</cn>
	</apply>
</math>,
the random process
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<apply><times />
			<ci>c</ci>
			<ci><mi mathvariant="bold-italic">X</mi></ci>
		</apply>
		<vector>
			<apply><times />
				<ci>c</ci>
				<apply><selector />
					<ci>X</ci>
					<cn>0</cn>
				</apply>
			</apply>
			<apply><times />
				<ci>c</ci>
				<apply><selector />
					<ci>X</ci>
					<cn>1</cn>
				</apply>
			</apply>
			<ci>...</ci>
		</vector>
	</apply>
</math>
is the fortune process for bold play with initial fortune
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><times />
		<ci>c</ci>
		<ci>x</ci>
	</apply>
</math>
and target fortune
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><times />
		<ci>c</ci>
		<ci>a</ci>
	</apply>
</math>.
</p>
</div>

<p>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
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<interval closure="closed">
		<cn>0</cn>
		<cn>1</cn>
	</interval>
</math>.
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.</p>

<div class="exercise" title="Mathematical exercise" id="Exercise3.2">
<p><strong>Exercise 3.2.</strong> Recall that the betting function <var>S</var> is the function that gives the amount bet as a function of the current fortune. Show that</p>

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
	<apply><eq />
		<apply>
			<ci>S</ci>
			<ci>x</ci>
		</apply>
		<math xmlns="http://www.w3.org/1998/Math/MathML">
			<apply><min />
				<ci>x</ci>
				<apply><minus />
					<cn>1</cn>
					<ci>x</ci>
				</apply>
			</apply>
		</math>
		<piecewise>
			<piece>
				<ci>x</ci>
				<apply><leq />
					<cn>0</cn>
					<ci>x</ci>
					<cn type="rational">1<sep />2</cn>
				</apply>
			</piece>
			<piece>
				<apply><minus />
					<cn>1</cn>
					<ci>x</ci>
				</apply>
				<apply><leq />
					<cn type="rational">1<sep />2</cn>
					<ci>x</ci>
					<cn>1</cn>
				</apply>
			</piece>
		</piecewise>
	</apply>
</math>
</div>

<div class="graphic" id="Figure3.1">
<p class="caption"><strong>Figure 3.1.</strong> The betting function under bold play</p>

<img src="Bold.png" alt="Bold.png" title="The betting function for bold play" />
</div>

<h3 id="Success">The Probability of Winning</h3>

<p>We will denote the probability that the bold gambler reaches the target
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<ci>a</ci>
		<cn>1</cn>
	</apply>
</math>
starting from the initial fortune
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>x</ci>
		<interval closure="closed">
			<cn>0</cn>
			<cn>1</cn>
		</interval>
	</apply>
</math>
by
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply>
		<ci>F</ci>
		<ci>x</ci>
	</apply>
</math>.
By <a href="#Exercise3.1" class="internal">Exercise 3.1</a>, the probability that the bold gambler reaches some other target value <var>a</var>, starting from
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>x</ci>
		<interval closure="closed">
			<cn>0</cn>
			<ci>a</ci>
		</interval>
	</apply>
</math>
is
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply>
		<ci>F</ci>
		<apply><divide />
			<ci>x</ci>
			<ci>a</ci>
		</apply>
	</apply>
</math>.
</p>

<div class="exercise" title="Mathematical exercise" id="Exercise3.3">
<p><strong>Exercise 3.3.</strong> By conditioning on the outcome of the first game, show that <var>F</var> satisfies the functional equation in part (a). Show directly that <var>F</var> satisfies the boundary conditions in part (b):</p>

<ol class="exercise">

	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<apply>
			<ci>F</ci>
			<ci>x</ci>
		</apply>
		<piecewise>
			<piece>
				<apply><times />
					<ci>p</ci>
					<apply>
						<ci>F</ci>
						<apply><times />
							<cn>2</cn>
							<ci>x</ci>
						</apply>
					</apply>
				</apply>
				<apply><in />
					<ci>x</ci>
					<interval closure="closed">
						<cn>0</cn>
						<cn type="rational">1<sep />2</cn>
					</interval>
				</apply>
			</piece>
			<piece>
				<apply><plus />
					<ci>p</ci>
					<apply><times />
						<ci>q</ci>
						<apply>
							<ci>F</ci>
							<apply><minus />
								<apply><times />
									<cn>2</cn>
									<ci>x</ci>
								</apply>
								<cn>1</cn>
							</apply>
						</apply>
					</apply>
				</apply>
				<apply><in />
					<ci>x</ci>
					<interval closure="closed">
						<cn type="rational">1<sep />2</cn>
						<cn>1</cn>
					</interval>
				</apply>
			</piece>
		</piecewise>
	</apply>
	</math>
	</li>
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>F</ci>
				<cn>0</cn>
			</apply>
			<cn>0</cn>
		</apply>
		<mtext>,&nbsp;</mtext>
		<apply><eq />
			<apply>
				<ci>F</ci>
				<cn>1</cn>
			</apply>
			<cn>1</cn>
		</apply>
	</math>
	</li>
</ol>
</div>

<p>The functional equation in <a href="#Exercise3.3" class="internal">Exercise 3.3</a> is highly nonlinear, in contrast to the corresponding result for timid play.  In fact, it's  clear that an important role is played by the function <var>d</var> defined on
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<interval closure="closed-open">
		<cn>0</cn>
		<cn>1</cn>
	</interval>
</math>
by </p>

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
	<apply><eq />
		<apply>
			<ci>d</ci>
			<ci>x</ci>
		</apply>
		<apply><minus />
			<apply><times />
				<cn>2</cn>
				<ci>x</ci>
			</apply>
			<apply><floor />
				<apply><times />
					<cn>2</cn>
					<ci>x</ci>
				</apply>
			</apply>
		</apply>
		<piecewise>
			<piece>
				<apply><times />
					<cn>2</cn>
					<ci>x</ci>
				</apply>
				<apply><lt />
					<ci><apply><leq />
						<cn>0</cn>
						<ci>x</ci>
					</apply></ci>
					<cn type="rational">1<sep />2</cn>
				</apply>
			</piece>
			<piece>
				<apply><minus />
					<apply><times />
						<cn>2</cn>
						<ci>x</ci>
					</apply>
					<cn>1</cn>
				</apply>
				<apply><lt />
					<ci><apply><leq />
						<cn type="rational">1<sep />2</cn>
						<ci>x</ci>
					</apply></ci>
					<cn>1</cn>
				</apply>
			</piece>
		</piecewise>
	</apply>
</math>

<p>The function <var>d</var> is sometimes called the <dfn>doubling function, mod 1</dfn>, since
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply>
		<ci>d</ci>
		<ci>x</ci>
	</apply>
</math>
gives the fractional part of
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><times />
		<cn>2</cn>
		<ci>x</ci>
	</apply>
</math>.
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 <var>d</var>.  Thus, bold play is intimately connected with the <dfn>dynamical system</dfn> associated with <var>d</var>.</p>

<div class="graphic" id="Figure3.2">
<p class="caption"><strong>Figure 3.2.</strong> The doubling function mod 2</p>

<img src="Double.png" alt="Double.png" title="The doubling map, modulo 1" />
</div>

<h3 id="Binary">Binary Expansions</h3>

<p>One of the keys to our analysis is to represent the initial fortune in binary form. The <dfn>binary expansion</dfn> of
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>x</ci>
		<interval closure="closed-open">
			<cn>0</cn>
			<cn>1</cn>
		</interval>
	</apply>
</math>
is</p>

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
	<apply><eq />
		<ci>x</ci>
		<apply><sum />
			<bvar><ci>i</ci></bvar>
			<lowlimit><cn>1</cn></lowlimit>
			<uplimit><infinity /></uplimit>
			<apply><divide />
				<apply><selector />
					<ci>x</ci>
					<ci>i</ci>
				</apply>
				<apply><power />
					<cn>2</cn>
					<ci>i</ci>
				</apply>
			</apply>
		</apply>
	</apply>
</math>

<p>where
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<apply><selector />
			<ci>x</ci>
			<ci>i</ci>
		</apply>
		<set>
			<cn>0</cn>
			<cn>1</cn>
		</set>
	</apply>
</math>
for each
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>i</ci>
		<set>
			<cn>1</cn>
			<cn>2</cn>
			<ci>...</ci>
		</set>
	</apply>
</math>.
This representation is unique except when <var>x</var> is a <dfn>binary rational</dfn> (sometimes also called a <dfn>dyadic rational</dfn>), that is, a number of the form
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><divide />
		<ci>k</ci>
		<apply><power />
			<cn>2</cn>
			<ci>n</ci>
		</apply>
	</apply>
</math>
where
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>n</ci>
		<set>
			<cn>1</cn>
			<cn>2</cn>
			<ci>...</ci>
		</set>
	</apply>
</math>
and
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>k</ci>
		<set>
			<cn>1</cn>
			<cn>3</cn>
			<ci>...</ci>
			<apply><minus />
				<apply><power />
					<cn>2</cn>
					<ci>n</ci>
				</apply>
				<cn>1</cn>
			</apply>
		</set>
	</apply>
</math>;
the positive integer <var>n</var> is called the <dfn>rank</dfn> of <var>x</var>.  For a binary rational <var>x</var> of rank <var>n</var>, we will use the standard terminating representation where
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<apply><selector />
			<ci>x</ci>
			<ci>n</ci>
		</apply>
		<cn>1</cn>
	</apply>
</math>
and
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<apply><selector />
			<ci>x</ci>
			<ci>i</ci>
		</apply>
		<cn>0</cn>
	</apply>
</math>
for
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><gt />
		<ci>i</ci>
		<ci>n</ci>
	</apply>
</math>.
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
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<infinity />
</math>.
We will denote the rank of <var>x</var> by
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply>
		<ci>r</ci>
		<ci>x</ci>
	</apply>
</math>.
</p>

<p>Applied to the binary sequences, the doubling function <var>d</var> is the <dfn>shift operator</dfn>:</p>

<div class="exercise" title="Mathematical exercise" id="Exercise3.4">
<p><strong>Exercise 3.4.</strong> Show that
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<apply><selector />
			<apply>
				<ci>d</ci>
				<ci>x</ci>
			</apply>
			<ci>i</ci>
		</apply>
		<apply><selector />
			<ci>x</ci>
			<ci><apply><plus />
				<ci>i</ci>
				<cn>1</cn>
			</apply></ci>
		</apply>
	</apply>
</math>
for
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>x</ci>
		<interval closure="closed-open">
			<cn>0</cn>
			<cn>1</cn>
		</interval>
	</apply>
</math>
</p>
</div>

<p>Bold play in red and black can be elegantly described by comparing the bits of the initial fortune with the random bits that describe the outcomes of the games .</p>

<div class="exercise" id="Exercise3.5">
<p><strong>Exercise 3.5.</strong> Suppose that gambler starts with initial fortune
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>x</ci>
		<interval closure="open">
			<cn>0</cn>
			<cn>1</cn>
		</interval>
	</apply>
</math>.
Show that the gambler eventually reaches the target 1 if and only if there exists a positive integer <var>k</var> such that
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<apply><selector />
			<ci>I</ci>
			<ci>j</ci>
		</apply>
		<apply><minus />
			<cn>1</cn>
			<apply><selector />
				<ci>x</ci>
				<ci>j</ci>
			</apply>
		</apply>
	</apply>
</math>
for
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>j</ci>
		<set>
			<cn>1</cn>
			<cn>2</cn>
			<ci>...</ci>
			<apply><minus />
				<ci>k</ci>
				<cn>1</cn>
			</apply>
		</set>
	</apply>
</math>
and
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<apply><selector />
			<ci>I</ci>
			<ci>k</ci>
		</apply>
		<apply><selector />
			<ci>x</ci>
			<ci>k</ci>
		</apply>
	</apply>
</math>.
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.</p>
</div>

<p>The <a href="http://en.wikipedia.org/wiki/Random_variable" class="external" target="external">random variable</a> whose bits are the complements of the game bits will play an important role in our analysis. Thus, let</p>

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
	<apply><eq />
		<ci>W</ci>
		<apply><sum />
			<bvar><ci>i</ci></bvar>
			<lowlimit><cn>1</cn></lowlimit>
			<uplimit><infinity /></uplimit>
			<apply><divide />
				<apply><minus />
					<cn>1</cn>
					<apply><selector />
						<ci>I</ci>
						<ci>j</ci>
					</apply>
				</apply>
				<apply><power />
					<cn>2</cn>
					<ci>j</ci>
				</apply>
			</apply>
		</apply>
	</apply>
</math>

<p>Note that <var>W</var> is a well defined random variable taking values in
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<interval closure="closed">
		<cn>0</cn>
		<cn>1</cn>
	</interval>
</math>.
</p>

<div class="exercise" title="Mathematical exercise" id="Exercise3.6">
<p><strong>Exercise 3.6.</strong> Suppose that the gambler starts with initial fortune
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>x</ci>
		<interval closure="open">
			<cn>0</cn>
			<cn>1</cn>
		</interval>
	</apply>
</math>.
Use the result of the <a href="#Exercise3.5" class="internal">Exercise 3.5</a> to show that the gambler reaches the target 1 if and only if
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><lt />
		<ci>W</ci>
		<ci>x</ci>
	</apply>
</math>.
</p>
</div>

<div class="exercise" title="Mathematical exercise" id="Exercise3.7">
<p><strong>Exercise 3.7.</strong> Show that <var>W</var> has a continuous distribution. That is, show that
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<apply>
			<ci>P</ci>
			<apply><eq />
				<ci>W</ci>
				<ci>x</ci>
			</apply>
		</apply>
		<cn>0</cn>
	</apply>
</math>
for any
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>x</ci>
		<interval closure="closed">
			<cn>0</cn>
			<cn>1</cn>
		</interval>
	</apply>
</math>.
</p>
</div>

<p>From the <a href="#Exercise3.5" class="internal">Exercise 3.5</a> and <a href="#Exercise3.6" class="internal">Exercise 3.6</a>, it follows that <var>F</var> is simply the <a href="http://en.wikipedia.org/wiki/Cumulative_distribution_function" class="external" target="external">distribution function</a> of <var>W</var>:</p>

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
	<apply><eq />
		<apply>
			<ci>F</ci>
			<ci>x</ci>
		</apply>
		<apply>
			<ci>P</ci>
			<apply><leq />
				<ci>W</ci>
				<ci>x</ci>
			</apply>
		</apply>
	</apply>
	<mtext>, &nbsp;</mtext>
	<apply><in />
		<ci>x</ci>
		<interval closure="closed">
			<cn>0</cn>
			<cn>1</cn>
		</interval>
	</apply>
</math>

<p>In particular, <var>F</var> is an increasing function, and since <var>W</var> has a continuous distribution, <var>F</var> is a continuous function.</p>

<div class="exercise" title="Mathematical exercise" id="Exercise3.8">
<p><strong>Exercise 3.8.</strong> Show that the success function <var>F</var> is the unique continuous solution of the functional equation in <a href="#Exercise3.3" class="internal">Exercise 3.3</a>.</p>

<ol class="exercise">
	<li>Use <a href="http://en.wikipedia.org/wiki/Mathematical_induction" class="external" target="external">mathematical induction</a> on the rank to show that any two solutions of must agree at the binary rationals.</li>
	<li>Use part (a) and continuity to show that any two continuous solutions of the functional equation must agree for all <var>x</var>.</li>
</ol>
</div>

<p>If we introduce a bit more notation, we can give nice expression for
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply>
		<ci>F</ci>
		<ci>x</ci>
	</apply>
</math>,
and later for the expected number of games
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply>
		<ci>G</ci>
		<ci>x</ci>
	</apply>
</math>.
Let
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<apply><selector />
			<ci>p</ci>
			<cn>0</cn>
		</apply>
		<ci>p</ci>
	</apply>
</math>
and
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<apply><selector />
			<ci>p</ci>
			<cn>1</cn>
		</apply>
		<ci>q</ci>
		<apply><minus />
			<cn>1</cn>
			<ci>p</ci>
		</apply>
	</apply>
</math>.
</p>

<div class="exercise" title="Mathematical exercise" id="Exercise3.9">
<p><strong>Exercise 3.9.</strong> Use <a href="#Exercise3.5" class="internal">Exercise 3.5</a> to show that</p>

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
	<apply><eq />
		<apply>
			<ci>F</ci>
			<ci>x</ci>
		</apply>
		<apply><sum />
			<bvar><ci>n</ci></bvar>
			<lowlimit><cn>1</cn></lowlimit>
			<uplimit><infinity /></uplimit>
			<apply><times />
				<apply><selector />
					<ci>p</ci>
					<apply><selector />
						<ci>x</ci>
						<cn>1</cn>
					</apply>
				</apply>
				<ci>&middot; &middot; &middot;</ci>
				<apply><selector />
					<ci>p</ci>
					<apply><selector />
						<ci>x</ci>
						<apply><minus />
							<ci>n</ci>
							<cn>1</cn>
						</apply>
					</apply>
				</apply>
				<ci>p</ci>
				<apply><selector />
					<ci>x</ci>
					<ci>n</ci>
				</apply>
			</apply>
		</apply>
	</apply>
</math>
</div>

<p>No, the equation in <a href="#Exercise3.9" class="internal">Exercise 3.9</a> does not have a misprint. The last part really is <var>p</var> <em>times</em>
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><selector />
		<ci>x</ci>
		<ci>n</ci>
	</apply>
</math>.
Thus, only terms with
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<apply><selector />
			<ci>x</ci>
			<ci>n</ci>
		</apply>
		<cn>1</cn>
	</apply>
</math>
are included in the sum,  Again, the player must win a game when her current fortune is in
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<interval closure="closed-open">
		<cn type="rational">1<sep />2</cn>
		<cn>1</cn>
	</interval>
</math>
(which of course happens with probability <var>p</var> and turns out to be the last game). Prior to this, she must win when her fortune is in
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<interval closure="open">
		<cn>0</cn>
		<cn type="rational">1<sep />2</cn>
	</interval>
</math>
and lose when her fortune is in
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<interval closure="open">
		<cn type="rational">1<sep />2</cn>
		<cn>1</cn>
	</interval>
</math>,
so that the game does not end earlier.</p>

<div class="exercise" title="Mathematical exercise" id="Exercise3.10">
<p><strong>Exercise 3.10.</strong> Show that <var>F</var> is strictly increasing on
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<interval closure="closed">
		<cn>0</cn>
		<cn>1</cn>
	</interval>
</math>.
This means that the distribution of <var>W</var> has support
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<interval closure="closed">
		<cn>0</cn>
		<cn>1</cn>
	</interval>
</math>;
that is, there are no subintervals of
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<interval closure="closed">
		<cn>0</cn>
		<cn>1</cn>
	</interval>
</math>
that have positive length, but 0 probability.</p>
</div>

<div class="exercise" title="Mathematical exercise" id="Exercise3.11">
<p><strong>Exercise 3.11.</strong> In particular, show that</p>

<ol class="exercise">
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>F</ci>
				<cn type="rational">1<sep />8</cn>
			</apply>
			<apply><power />
				<ci>p</ci>
				<cn>3</cn>
			</apply>
		</apply>
	</math>
	</li>
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>F</ci>
				<cn type="rational">2<sep />8</cn>
			</apply>
			<apply><power />
				<ci>p</ci>
				<cn>2</cn>
			</apply>
		</apply>
	</math>
	</li>
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>F</ci>
				<cn type="rational">3<sep />8</cn>
			</apply>
			<apply><plus />
				<apply><power />
					<ci>p</ci>
					<cn>2</cn>
				</apply>
				<apply><times />
					<apply><power />
						<ci>p</ci>
						<cn>2</cn>
					</apply>
					<ci>q</ci>
				</apply>
			</apply>
		</apply>
	</math>
	</li>
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>F</ci>
				<cn type="rational">4<sep />8</cn>
			</apply>
			<ci>p</ci>
		</apply>
	</math>
	</li>
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>F</ci>
				<cn type="rational">5<sep />8</cn>
			</apply>
			<apply><plus />
				<ci>p</ci>
				<apply><times />
					<apply><power />
						<ci>p</ci>
						<cn>2</cn>
					</apply>
					<ci>q</ci>
				</apply>
			</apply>
		</apply>
	</math>
	</li>
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>F</ci>
				<cn type="rational">6<sep />8</cn>
			</apply>
			<apply><plus />
				<ci>p</ci>
				<apply><times />
					<ci>p</ci>
					<ci>q</ci>
				</apply>
			</apply>
		</apply>
	</math>
	</li>
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>F</ci>
				<cn type="rational">7<sep />8</cn>
			</apply>
			<apply><plus />
				<ci>p</ci>
				<apply><times />
					<ci>p</ci>
					<ci>q</ci>
				</apply>
				<apply><times />
					<ci>p</ci>
					<apply><power />
						<ci>q</ci>
						<cn>2</cn>
					</apply>
				</apply>
			</apply>
		</apply>
	</math>
	</li>
</ol>
</div>

<div class="exercise" title="Mathematical exercise" id="Exercise3.12">
<p><strong>Exercise 3.12.</strong> Suppose that
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<ci>p</ci>
		<cn type="rational">1<sep />2</cn>
	</apply>
</math>.
Show that
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<apply>
			<ci>F</ci>
			<ci>x</ci>
		</apply>
		<ci>x</ci>
	</apply>
</math>
for
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>x</ci>
		<interval closure="closed">
			<cn>0</cn>
			<cn>1</cn>
		</interval>
	</apply>
</math>
in two ways:
</p>

<ol class="exercise">
	<li>Using the functional equation in <a href="#Exercise3.3" class="internal">Exercise 3.3</a>.</li>
	<li>Using the representation in <a href="#Exercise3.9" class="internal">Exercise 3.9</a>.</li>
</ol>
</div>

<p>Thus, for
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<ci>p</ci>
		<cn type="rational">1<sep />2</cn>
	</apply>
</math>
(fair trials), the probability that the bold gambler reaches the target fortune <var>a</var> starting from the initial fortune <var>x</var> is
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><divide />
		<ci>x</ci>
		<ci>a</ci>
	</apply>
</math>,
just as it is for the timid gambler. Note also that the random variable <var>W</var> has the <a href="http://en.wikipedia.org/wiki/Uniform_distribution_%28continuous%29" class="external" target="external">uniform distribution</a> on
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<interval closure="closed">
		<cn>0</cn>
		<cn>1</cn>
	</interval>
</math>.
When
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><neq />
		<ci>p</ci>
		<cn type="rational">1<sep />2</cn>
	</apply>
</math>,
the distribution of <var>W</var> is quite strange. To state the result succinctly, we will indicate the dependence of the of the probability measure <var>P</var> on the parameter
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>p</ci>
		<interval closure="open">
			<cn>0</cn>
			<cn>1</cn>
		</interval>
	</apply>
</math>.
First we define</p>

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
	<apply><eq />
		<apply><selector />
			<ci>C</ci>
			<ci>p</ci>
		</apply>
		<ci>
			<mo>{</mo>
			<apply><in />
				<ci>x</ci>
				<interval closure="closed">
					<cn>0</cn>
					<cn>1</cn>
				</interval>
			</apply>
			<mo>:</mo>
			<apply><tendsto />
				<apply><times />
					<ci><apply><divide />
						<cn>1</cn>
						<ci>n</ci>
					</apply></ci>
					<apply><sum />
						<bvar><ci>i</ci></bvar>
						<lowlimit><cn>1</cn></lowlimit>
						<uplimit><ci>n</ci></uplimit>
						<ci><mo>(</mo>
						<apply><minus />
							<cn>1</cn>
							<apply><selector />
								<ci>x</ci>
								<ci>i</ci>
							</apply>
						</apply>
						<mo>)</mo></ci>
					</apply>
				</apply>
				<ci>p</ci>
			</apply>
			<mtext>&nbsp;as&nbsp;</mtext>
			<apply><tendsto />
				<ci>n</ci>
				<infinity />
			</apply>
			<mo>}</mo>
		</ci>
	</apply>
</math>

<p>Thus,
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><selector />
		<ci>C</ci>
		<ci>p</ci>
	</apply>
</math>
is the set of
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>x</ci>
		<interval closure="closed">
			<cn>0</cn>
			<cn>1</cn>
		</interval>
	</apply>
</math>
for which the relative frequency of 0's in the binary expansion is <var>p</var>. Of course, if
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><neq />
		<ci>p</ci>
		<ci>t</ci>
	</apply>
</math>
then
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><selector />
		<ci>C</ci>
		<ci>p</ci>
	</apply>
</math>
and
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><selector />
		<ci>C</ci>
		<ci>t</ci>
	</apply>
</math>
are disjoint.</p>

<div class="exercise" title="Mathematical exercise" id="Exercise3.13">
<p><strong>Exercise 3.13.</strong> Use the <a href="http://en.wikipedia.org/wiki/Law_of_large_numbers" class="external" target="external">strong law of large numbers</a> to show that</p>

<ol class="exercise">
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<apply><selector />
					<ci>P</ci>
					<ci>p</ci>
				</apply>
				<apply><in />
					<ci>W</ci>
					<apply><selector />
						<ci>C</ci>
						<ci>p</ci>
					</apply>
				</apply>
			</apply>
			<cn>1</cn>
		</apply>
	</math>
	for
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><in />
			<ci>p</ci>
			<interval closure="open">
				<cn>0</cn>
				<cn>1</cn>
			</interval>
		</apply>
	</math>
	</li>
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<apply><selector />
					<ci>P</ci>
					<ci>p</ci>
				</apply>
				<apply><in />
					<ci>W</ci>
					<apply><selector />
						<ci>C</ci>
						<ci>t</ci>
					</apply>
				</apply>
			</apply>
			<cn>0</cn>
		</apply>
	</math>
	for
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><neq />
			<ci>p</ci>
			<ci>t</ci>
		</apply>
	</math>
	</li>
</ol>
</div>

<div class="exercise" title="Mathematical exercise" id="Exercise3.14">
<p><strong>Exercise 3.14.</strong> Show that when
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><neq />
		<ci>p</ci>
		<cn type="rational">1<sep />2</cn>
	</apply>
</math>,
<var>W</var> does not have a probability density function, even though it has a continuous distribution. The following steps outline a proof by contradiction</p>

<ol class="exercise">
	<li>Suppose that <var>W</var> has probability density function <var>f</var></li>
	<li>Then
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<apply><selector />
					<ci>P</ci>
					<ci>p</ci>
				</apply>
				<apply><in />
					<ci>W</ci>
					<apply><selector />
						<ci>C</ci>
						<ci>p</ci>
					</apply>
				</apply>
			</apply>
			<apply><int />
				<bvar><ci>x</ci></bvar>
				<condition>
					<apply><in />
						<ci>x</ci>
						<apply><selector />
							<ci>C</ci>
							<ci>p</ci>
						</apply>
					</apply>
				</condition>
				<apply>
					<ci>f</ci>
					<ci>x</ci>
				</apply>
			</apply>
		</apply>
	</math>.
	</li>
	<li>By the previous exercise,
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<apply><selector />
					<ci>P</ci>
					<ci>p</ci>
				</apply>
				<apply><in />
					<ci>W</ci>
					<apply><selector />
						<ci>C</ci>
						<ci>p</ci>
					</apply>
				</apply>
			</apply>
			<cn>1</cn>
		</apply>
	</math>.
	</li>
	<li>But also
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply><int />
				<bvar><ci>x</ci></bvar>
				<condition>
					<apply><in />
						<ci>x</ci>
						<apply><selector />
							<ci>C</ci>
							<ci>p</ci>
						</apply>
					</apply>
				</condition>
				<cn>1</cn>
			</apply>
			<apply>
				<apply><selector />
					<ci>P</ci>
					<ci><mn>1</mn><mo>/</mo><mn>2</mn></ci>
				</apply>
				<apply><in />
					<ci>W</ci>
					<apply><selector />
						<ci>C</ci>
						<ci>p</ci>
					</apply>
				</apply>
			</apply>
			<cn>0</cn>
		</apply>
	</math>.
	That is,
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><selector />
			<ci>C</ci>
			<ci>p</ci>
		</apply>
	</math>
	has Lebesgue measure 0.</li>
	<li>Hence
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply><int />
				<bvar><ci>x</ci></bvar>
				<condition>
					<apply><in />
						<ci>x</ci>
						<apply><selector />
							<ci>C</ci>
							<ci>p</ci>
						</apply>
					</apply>
				</condition>
				<apply>
					<ci>f</ci>
					<ci>x</ci>
				</apply>
			</apply>
			<cn>0</cn>
		</apply>
	</math>.
	</li>
</ol>
</div>

<p>When
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><neq />
		<ci>p</ci>
		<cn type="rational">1<sep />2</cn>
	</apply>
</math>,
<var>F</var> has derivative 0 at almost every point in
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<interval closure="closed">
		<cn>0</cn>
		<cn>1</cn>
	</interval>
</math>,
even though it is strictly increasing. Thus, <var>W</var> has a <dfn>singular continuous</dfn> distribution. Such distributions are usually considered exotic, so one of the great features of <em>red and black</em> is that it's an honest applied problem yet gives rise to such a distribution.</p>

<div class="graphic" id="Figure3.3">
<p class="caption"><strong>Figure 3.3.</strong> The success function under bold play for various values of <var>p</var>.</p>

<img src="WinProb.png" alt="Probability of Winning" title="The probability of winning" width="308" height="265" />
</div>

<div class="exercise" title="Simulation exercise" id="Exercise3.15">
<p class="sim"><strong>Exercise 3.15.</strong> In the <a href="JavaScript:openWindow('RedBlackExperiment.xml','applet',700,500)" class="ancillary" title="Open applet">red and black experiment</a>, select <em>Bold Play</em>. Vary the initial fortune, target fortune, and game win probability with the scroll bars and note how the probability of reaching the target changes. In particular, note that this probability depends only on
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><divide />
		<ci>x</ci>
		<ci>a</ci>
	</apply>
</math>.
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.</p>
</div>

<h3 id="Trials">The Expected Number of Trials</h3>

<p>Let
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<apply>
			<ci>G</ci>
			<ci>x</ci>
		</apply>
		<apply>
			<ci>E</ci>
			<ci>
				<ci>N</ci>
				<mo>|</mo>
				<apply><eq />
					<apply><selector />
						<ci>X</ci>
						<cn>0</cn>
					</apply>
					<ci>x</ci>
				</apply>
			</ci>
		</apply>
	</apply>
</math>
for
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>x</ci>
		<interval closure="closed">
			<cn>0</cn>
			<cn>1</cn>
		</interval>
	</apply>
</math>,
the expected number of trials starting at <var>x</var>. For any other target fortune
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>a</ci>
		<interval closure="open">
			<cn>0</cn>
			<infinity />
		</interval>
	</apply>
</math>,
the expected number of trials starting at
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>x</ci>
		<interval closure="closed">
			<cn>0</cn>
			<ci>a</ci>
		</interval>
	</apply>
</math>
is just
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply>
		<ci>G</ci>
		<apply><divide />
			<ci>x</ci>
			<ci>a</ci>
		</apply>
	</apply>
</math>.
</p>

<div class="exercise" title="Mathematical exercise" id="Exercise3.16">
<p><strong>Exercise 3.16.</strong> By conditioning on the outcome of the first game, show that <var>G</var> satisfies the following functional equation in (a). Show directly that <var>G</var> satisfies the boundary conditions (b).</p>

<ol class="exercise">
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>G</ci>
				<ci>x</ci>
			</apply>
			<piecewise>
				<piece>
					<apply><plus />
						<cn>1</cn>
						<apply><times />
							<ci>p</ci>
							<apply>
								<ci>G</ci>
								<apply><times />
									<cn>2</cn>
									<ci>x</ci>
								</apply>
							</apply>
						</apply>
					</apply>
					<apply><in />
						<ci>x</ci>
						<interval closure="open-closed">
							<cn>0</cn>
							<cn type="rational">1<sep />2</cn>
						</interval>
					</apply>
				</piece>
				<piece>
					<apply><plus />
						<cn>1</cn>
						<apply><times />
							<ci>q</ci>
							<apply>
								<ci>G</ci>
								<apply><minus />
									<apply><times />
										<cn>2</cn>
										<ci>x</ci>
									</apply>
									<cn>1</cn>
								</apply>
							</apply>
						</apply>
					</apply>
					<apply><in />
						<ci>x</ci>
						<interval closure="closed-open">
							<cn type="rational">1<sep />2</cn>
							<cn>1</cn>
						</interval>
					</apply>
				</piece>
			</piecewise>
		</apply>
	</math>
	</li>
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>G</ci>
				<cn>0</cn>
			</apply>
			<cn>0</cn>
		</apply>
		<mtext>,&nbsp;</mtext>
		<apply><eq />
			<apply>
				<ci>G</ci>
				<cn>1</cn>
			</apply>
			<cn>0</cn>
		</apply>
	</math>
	</li>
</ol>
</div>

<p>Note, interestingly, that the functional equation is not satisfied at
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<ci>x</ci>
		<cn>0</cn>
	</apply>
</math>
or
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<ci>x</ci>
		<cn>1</cn>
	</apply>
</math>.
As before, we can give an alternate analysis using the binary representation of an initial fortune
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>x</ci>
		<interval closure="open">
			<cn>0</cn>
			<cn>1</cn>
		</interval>
	</apply>
</math>.
</p>

<div class="exercise" title="Mathematical exercise" id="Exericise3.17">
<p><strong>Exercise 3.17.</strong> Suppose that the initial fortune of the gambler is
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>x</ci>
		<interval closure="open">
			<cn>0</cn>
			<cn>1</cn>
		</interval>
	</apply>
</math>.
Show that
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<ci>N</ci>
		<apply><min />
			<bvar><ci>
				<apply><in />
					<ci>k</ci>
					<set>
						<cn>1</cn>
						<cn>2</cn>
						<ci>...</ci>
					</set>
				</apply>
			</ci></bvar>
			<condition>
				<apply><or />
					<ci><apply><eq />
						<apply><selector />
							<ci>I</ci>
							<ci>k</ci>
						</apply>
						<apply><selector />
							<ci>x</ci>
							<ci>k</ci>
						</apply>
					</apply></ci>
					<ci><apply><eq />
						<ci>k</ci>
						<apply>
							<ci>r</ci>
							<ci>x</ci>
						</apply>
					</apply></ci>
				</apply>
			</condition>
		</apply>
	</apply>
</math>.
</p>

<ol class="exercise">
	<li>If <var>x</var> is a binary rational then <var>N</var> takes values in the set
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<set>
			<cn>1</cn>
			<cn>2</cn>
			<ci>...</ci>
			<apply>
				<ci>r</ci>
				<ci>x</ci>
			</apply>
		</set>
	</math>.
	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 <math xmlns="http://www.w3.org/1998/Math/MathML">
	<cn type="rational">1<sep />2</cn>
	</math>,
	the only fortune for which the next game is always final.</li>
	<li>If <var>x</var> is a binary irrational then <var>N</var> takes values in
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<set>
			<cn>1</cn>
			<cn>2</cn>
			<ci>...</ci>
		</set>
	</math>.
	Play continues until a game bit agrees with a corresponding fortune bit.</li>
</ol>
</div>

<p>We can give an explicit formula for the expected number of trials
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply>
		<ci>G</ci>
		<ci>x</ci>
	</apply>
</math>
in terms of the binary representation of <var>x</var>.</p>

<div class="exercise" title="Mathematical exercise" id="Exercise3.18">
<p><strong>Exercise 3.18.</strong> Suppose that
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><in />
		<ci>x</ci>
		<interval closure="open">
			<cn>0</cn>
			<cn>1</cn>
		</interval>
	</apply>
</math>,
and recall our special notation:
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<apply><selector />
			<ci>p</ci>
			<cn>0</cn>
		</apply>
		<ci>p</ci>
	</apply>
</math>,
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<apply><selector />
			<ci>p</ci>
			<cn>1</cn>
		</apply>
		<ci>q</ci>
	</apply>
</math>.
Show that</p>

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
	<apply><eq />
		<apply>
			<ci>G</ci>
			<ci>x</ci>
		</apply>
		<apply><sum />
			<bvar><ci>n</ci></bvar>
			<lowlimit><cn>0</cn></lowlimit>
			<uplimit>
			<apply><minus />
				<apply>
					<ci>r</ci>
					<ci>x</ci>
				</apply>
				<cn>1</cn>
			</apply>
			</uplimit>
			<apply><times />
				<apply><selector />
					<ci>p</ci>
					<apply><selector />
						<ci>x</ci>
						<cn>1</cn>
					</apply>
				</apply>
				<ci>&middot; &middot; &middot;</ci>
				<apply><selector />
					<ci>p</ci>
					<apply><selector />
						<ci>x</ci>
						<ci>n</ci>
					</apply>
				</apply>
			</apply>
		</apply>
	</apply>
</math>

<ol class="exercise">
	<li>Note that the
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<ci>n</ci>
			<cn>0</cn>
		</apply>
	</math>
	term is 1, since the product is empty.</li>
	<li>The sum has a finite number of terms if <var>x</var> is a binary rational.</li>
	<li>The sum has an infinite number of terms if <var>x</var> is a binary irrational.</li>
</ol>
</div>

<div class="exercise" title="Mathematical exercise" id="Exercise3.19">
<p><strong>Exercise 3.19.</strong> Use the result of the <a href="#Exercise3.18" class="internal">Exercise 3.18</a> to verify the following values:</p>

<ol class="exercise">
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>G</ci>
				<cn type="rational">1<sep />8</cn>
			</apply>
			<apply><plus />
				<cn>1</cn>
				<ci>p</ci>
				<apply><power />
					<ci>p</ci>
					<cn>2</cn>
				</apply>
			</apply>
		</apply>
	</math>
	</li>
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>G</ci>
				<cn type="rational">2<sep />8</cn>
			</apply>
			<apply><plus />
				<cn>1</cn>
				<ci>p</ci>
			</apply>
		</apply>
	</math>
	</li>
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>G</ci>
				<cn type="rational">3<sep />8</cn>
			</apply>
			<apply><plus />
				<cn>1</cn>
				<ci>p</ci>
				<apply><times />
					<ci>p</ci>
					<ci>q</ci>
				</apply>
			</apply>
		</apply>
	</math>
	</li>
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>G</ci>
				<cn type="rational">4<sep />8</cn>
			</apply>
			<cn>1</cn>
		</apply>
	</math>
	</li>
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>G</ci>
				<cn type="rational">5<sep />8</cn>
			</apply>
			<apply><plus />
				<cn>1</cn>
				<ci>q</ci>
				<apply><times />
					<ci>p</ci>
					<ci>q</ci>
				</apply>
			</apply>
		</apply>
	</math>
	</li>
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>G</ci>
				<cn type="rational">6<sep />8</cn>
			</apply>
			<apply><plus />
				<cn>1</cn>
				<ci>q</ci>
			</apply>
		</apply>
	</math>
	</li>
	<li>
	<math xmlns="http://www.w3.org/1998/Math/MathML">
		<apply><eq />
			<apply>
				<ci>G</ci>
				<cn type="rational">7<sep />8</cn>
			</apply>
			<apply><plus />
				<cn>1</cn>
				<ci>q</ci>
				<apply><power />
					<ci>q</ci>
					<cn>2</cn>
				</apply>
			</apply>
		</apply>
	</math>
	</li>
</ol>
</div>

<div class="exercise" title="Mathematical exercise" id="Exercise3.20">
<p><strong>Exercise 3.20.</strong> Suppose that
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><eq />
		<ci>p</ci>
		<cn type="rational">1<sep />2</cn>
	</apply>
</math>.
Use <a href="#Exercise3.18" class="internal">Exercise 3.18</a> to show that</p>

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
	<apply><eq />
		<apply>
			<ci>G</ci>
			<ci>x</ci>
		</apply>
		<piecewise>
			<piece>
				<apply><minus />
					<cn>2</cn>
					<apply><divide />
						<cn>1</cn>
						<apply><power />
							<cn>2</cn>
							<ci><apply><minus />
								<apply>
									<ci>r</ci>
									<ci>x</ci>
								</apply>
								<cn>1</cn>
							</apply></ci>
						</apply>
					</apply>
				</apply>
				<ci>
					<ci>x</ci>
					<mtext>&nbsp;is binary rational</mtext>
				</ci>
			</piece>
			<piece>
				<cn>2</cn>
				<ci>
					<ci>x</ci>
					<mtext>&nbsp;is binary irrational</mtext>
				</ci>
			</piece>
		</piecewise>
	</apply>
</math>
</div>

<div class="graphic" id="Figure3.4">
<p class="caption"><strong>Figure 3.4.</strong> The expected number of games in bold play with fair games.</p>

<img src="BoldExpect.png" alt="Expected number of games in bold play" title="Expected number of games in bold play with fair games" />
</div>

<div class="exercise" title="Simulation exercise" id="Exercise3.21">
<p class="sim"><strong>Exercise 3.21.</strong> In the <a href="JavaScript:openWindow('RedBlackExperiment.xml','applet',700,500)" class="ancillary" title="Open applet">red and black experiment</a>, select <em>Bold Play</em>. Vary <var>x</var>, <var>a</var>, and <var>p</var> with the scroll bars and note how the expected number of trials changes. In particular, note that the mean depends only on the ratio
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<apply><divide />
		<ci>x</ci>
		<ci>a</ci>
	</apply>
</math>.
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.</p>
</div>

<div class="exercise" title="Mathematical exercise" id="Exercise3.22">
<p><strong>Exercise 3.22.</strong> For fixed <var>x</var>, show that <var>G</var> is continuous as a function of <var>p</var>.</p>
</div>

<p>However, as a function of the initial fortune <var>x</var>, for fixed <var>p</var>, the function <var>G</var> is very irregular.</p>

<div class="exercise" title="Mathematical exercise" id="Exercise3.23">
<p><strong>Exercise 3.23.</strong> Show that <var>G</var> is discontinuous at the binary rationals in
<math xmlns="http://www.w3.org/1998/Math/MathML">
	<interval closure="closed">
		<cn>0</cn>
		<cn>1</cn>
	</interval>
</math>
and continuous at the binary irrationals.</p>
</div>

<div class="footer">
<p>Return: <a href="index.html" class="internal">Home</a> | Previous: <a href="Timid.xml" class="internal">Timid Play</a> | Next: <a href="Optimal.xml" class="internal">Optimal Strategies</a></p>
</div>

</body>

</html>

