This is a versatile applet which plays a simple game --- each time the game is played, the player either loses a certain amount of money or wins a certain amount of money. The applet keeps track of the number of games played, cumulative and average winnings. An optional graphic plots the average winnings vs. # of games played. You can play one game at a time, or play several times at once by clicking another button.

Parameters:

<param name = probwin value = "0.026315789"> - the probability of winning each time (default: 0.2).
<param name = winamount value = "35"> - the amount won each time (default: 3.0).
<param name = loseamount value = "-1"> - the amount lost each time (default: -1.0). Note that this should be a negative number
<param name = showgraph value = "false"> - whether to display the graph in the applet (default: true).
<param name = multipleplays value = "150"> - the number of plays done at once when the user clicks on the "Play X times" button (default: 10)
<param name = limitplays value = "false"> - whether there is an upper bound on the number of times the user can play before the "play" buttons are deactivated (i.e., if there is a graphic (which only displays the first 100 plays) (default: true)
<param name = limit value = "100"> - if the number of plays are limited, the number of times the user can play before the "play" buttons are deactivated. (default: 100)
<param name= pausestring value="Flipping!" > - string to be spelled out when an action is taken by the user. The default is "Playing!".
<param name= letterwait value="30" > - time in milliseconds between displaying letters when the user takes action. The default is 30.
<param name= singlewait value="200" > - time between when the pause string is displayed and results are updated. The default is 200.
<param name = multiplewait value = "0"> - the time to wait between displaying results when the user clicks on the "Play X Times" button (default: 50)
<param name = skipindiv value = "true"> - whether to skip displaying the individual play results at all (this should be true when doing a large number at a time (default: false)

Here are applet versions of most (all?) of the related JavaScript simulations in Bob's expected value unit, along with the HTML tags.


Heckard's Lottery Applet I

How it works: Lose $1 with probability 0.2, win $3 with probability 0.8.

<center>
<table border="2" width="523" cellspacing="0" cellpadding="10">
  <tr>
    <td width="100%"><p align="center"><strong><big><font face="Arial">Heckard's Lottery Applet I </font></big></strong>
<APPLET code="ExpValue.class" width = 350 height = 350> 
</APPLET>
<p align="left"><strong>How it works: </strong>
Lose $1 with probability 0.2, win $3 with probability 0.8.
</td>
  </tr>
</table>
</center>

Heckard's Lottery Applet II

How it works: Same game, but play 150 times at once!

<center>
<table border="2" width="523" cellspacing="0" cellpadding="10">
  <tr>
    <td width="100%"><p align="center"><strong><big><font face="Arial">
        Heckard's Lottery Applet II</font></big></strong>
<APPLET code="ExpValue.class" width = 310 height = 150>
<PARAM name = limitplays value = "false">
<PARAM name = multipleplays value = "150">
<PARAM name = showgraph value = "false">
<PARAM name = multiplewait value = "0">
</APPLET>
<p align="left"><strong>How it works: </strong>
Same game, but play 150 times at once!
</td>
  </tr>
</table>
</center>

Heckard's Lottery Applet III

How it works: Same game, but play 1500 times at once (no waiting)!

<center>
<table border="2" width="523" cellspacing="0" cellpadding="10">
  <tr>
    <td width="100%"><p align="center"><strong><big><font face="Arial">
        Heckard's Lottery Applet III</font></big></strong>
<APPLET code="ExpValue.class" width = 310 height = 150>
<PARAM name = limitplays value = "false">
<PARAM name = multipleplays value = "1500">
<PARAM name = showgraph value = "false">
<PARAM name = skipindiv value = "true">
</APPLET>
<p align="left"><strong>How it works: </strong>
Same game, but play 1500 times at once (no waiting)!
</td>
  </tr>
</table>
</center>

Roulette Number Bet Applet

How it works: Number bet on a Roulette table

<center>
<table border="2" width="523" cellspacing="0" cellpadding="10">
  <tr>
    <td width="100%"><p align="center"><strong><big><font face="Arial">
        Roulette Number Bet Applet</font></big></strong>
<APPLET code="ExpValue.class" width = 310 height = 150>
<PARAM name = showgraph value = "false">
<PARAM name = limit value = "100">
<PARAM name = probwin value = "0.026315789">
<PARAM name = winamount value = "35">
<PARAM name = loseamount value = "-1">
</APPLET>
<p align="left"><strong>How it works: </strong>
Number bet on a Roulette table
</td>
  </tr>
</table>
</center>

Roulette Color Bet Applet

How it works: Color bet on a Roulette table

<center>
<table border="2" width="523" cellspacing="0" cellpadding="10">
  <tr>
    <td width="100%"><p align="center"><strong><big><font face="Arial">
        Roulette Color Bet Applet</font></big></strong>
<APPLET code="ExpValue.class" width = 310 height = 150>
<PARAM name = showgraph value = "false">
<PARAM name = limit value = "100">
<PARAM name = probwin value = "0.47368421">
<PARAM name = winamount value = "1">
<PARAM name = loseamount value = "-1">
</APPLET>
<p align="left"><strong>How it works: </strong>
Color bet on a Roulette table
</td>
  </tr>
</table>
</center>
west@stat.sc.edu.