Object Library > Applets > Red Black Game

Red Black Game


Description and Use

In the game of red and black, a player starts with an initial fortune x and bets (at even stakes) on independent trials for which the probability of winning is p. The player must continue until she is either ruined or reaches a fixed target fortune a.

The first graph shows the initial, current, and target fortunes at each stage. The first table shows the sequence of trial outcomes and fortunes. Variable J indicates the event that the player wins the game (reaches her target) and N gives the number of trials. These variables are recorded in the second table. The relative frequency function of J is shown in the second graph and recorded in the third table. The average value of N is given in the last table. The parameters x, and p can be varied with scroll bars and various values of a can be selected with the list box. The bet on each trial can be varied with a scroll bar.

This applet illustrates the topics and concepts in the list below. Click on the links to learn more about the mathematical theory.

Instructions for Downloading and Installing

Click on the link below to download the Java archive file:

To add the applet to your web page, insert the following in the html file, at the point where you want the applet to appear:

<applet code="edu.uah.math.experiments.RedBlackGame.class" archive="RedBlackGame.jar" width="600" height="350"></applet>

The jar file and the html file must be in the same folder.

This width and height dimensions are simply suggestions and can be varied. Generally, components such as graphs and tables expand and contract proportionally, while components such as buttons, scrollbars, dice, and coins are fixed in size.


Metadata

Type

Keywords

Version

Browser Requirements

Authors

Copyright

Copyright © 2001 Kyle Siegrist, Dawn Duehring

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.

Related Resources

If you are interested in the Java source code or the Java documentation and object model for this applet, please visit RedBlackGame in the Object section of the Library.