### The Red and Black Experiment

#### Description

In the red and black experiment, a player starts with an initial fortune \(x_0\) and bets (at even stakes) on independent trials for which the probability of winning is \(p\). Play continues until the player is either ruined or reaches a fixed target fortune \(a\).

Either of two player strategies can be selected from a list box. With timid play, the player bets 1 on each trial. With bold play, the player bets her entire fortune or what is needed to reach the target (whichever is smaller). Random variable \(J\) indicates the event that the player wins (reaches her target) and variable \(N\) is the number of trials played. These variables are recorded in the data table. The fortune graph shows the space of fortunes \( \{0, 1, \ldots, a\} \), with the initial fortune in blue and the current fortune in red. In single step mode, the outcome of each trial is shown; in run mode, only the final outcome is shown. The probability density function of \(J\) is shown in blue in the distribution graph and recorded in the distribution table. When the experiment runs, the empirical density function of \(J\) is shown in red in the distribution graph and recorded in the distribution table. The parameters \(x_0\) and \(p\) and \( a \) can be varied with input controls.