This class models the red and black experiment. A player bets on a sequence of Bernoulli trials at even stakes. The player starts with an initial fortune and must quit when she is either ruined or reaches a target fortune. The initial and target fortunes can be varied as well as the probability of success. Either of two classical strategies can be chosen: bold play or timid play. A screen shot is shown below; click on the graphic to view the live applet and for a more detailed mathematical description.
To add the applet to your web page, first download objects.jar. Next, insert the following in your HTML file, at the point where you want the applet to appear:
<applet code="edu.uah.math.experiments.RedBlackExperiment.class" archive="address/objects.jar" width="500" height="450"></applet>
where address is the URL address of the JAR file. For example, if the JAR file and the HTML file are in the same folder, the archive property is simply archive="objects.jar". The 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.
The text area below gives the code for this object, so that you can browse the constructors, methods, and properties of the object. Of course, this source file is part of objects.zip, which contains the source and resource files for all objects in all three packages.