Law of Averages
Be sure that a box has been created and accepted. See Choose
Box. This routine randomly draws tickets from the box, updating the
the running plots of the average and sum of the draws, and the table of
statistics, after each draw. You have to make some choices,
then watch the results.
There are several choices to
make:
-
Are the draws with or without replacement?
Choose "w rep" for drawing with
replacement, and choose "w/o rep" for drawing without replacement.
-
How quickly should the tickets be drawn?
The choices are
-
Fast: Which may not be very fast, depending on the environment
-
Slow: Which is useful for seeing each draw and its effect
-
Batch: This is the fastest. The draws are performed without updating
the graphics after each draw, but just after all draws have been made.
-
How many draws to perform? The
choices are 1, 10, 25, 100, and 1000. Click on the button that you wish.
You can click on the buttons more than once to request more draws. For
example, if you wish to have 250 draws, click on "100" twice and
"25" twice. (Don't click on them too quickly or they won't all register.)
Right below the numbered buttons, there is a number showing how many draws
have been requested so far.
-
How many more draws to perform? Even
after the draws have been completed, you can ask for more draws by clicking
on the numbered buttons again.
-
Start Over: This
button sets everything back to 0. You can then make your choices again.
-
Pause: This
button stops the drawing. You can restart the drawing from where it left
off by pressing "Resume" (which is the same button), or you can
hit "Start Over" to start over.
There are several results to
watch:
-
The running averages:
In the middle, there is a graph named "Average." After each draw,
the average of the draws is calculated (see the statistics
table), and this average is plotted on the graph, where the horizontal
axis gives which draw it is, and the vertical axis gives the average. The
light blue line on the graph indicates the average in the box.
-
The running sums:
At the botton, there is a graph named "Sum - Expected Value." After
each draw, the sum of the draws, the expected value of the sum of the draws,
and the difference between the sum and the expected value of the sum (the
error in the statistics table) are calculated, and this
error is plotted on the graph, where the horizontal axis gives which draw
it is, and the vertical axis gives the error. The light blue line on the
graph indicates 0.
-
A record of the draws:
At the lower right, the draws are recorded as they are being made.
-
Histograms:
In the middle of the screen, there are two histograms. The one on the left
is the histogram for the tickets in the box. It remains the same as the
tickets are being drawn. The histogram on the right is that for the tickets
that have been drawn so far.
-
The statistics:
At the upper right, some basic statistics, about the box and about the
draws, are collected. The columns:
-
Numbers: The "Draws" entry is the number of
tickets drawn so far. The "Box" entry is the number of tickets in the box.
-
Average: The "Draws"
entry gives the average of the draws so far, and the "Box" entry has the
average of the tickets in the box.
The "Error" entry is the difference between the
average of the draws and average of the box.
The "SE" entry is the standard error of the average
of the draws, which gives an idea of the magnitude of the "Error".
-
Sum: The "Draws" entry gives
the sum of the draws so far, while the "Box" entry gives the Expected
Value of the sum of the draws so far, which is (# of Draws)x(Average
of Box).
The "Error" entry is the difference between the
sum of the draws and the expected value of the sum of the draws.
The "SE" entry is the standard error of the sum
of the draws, which gives an idea of the magnitude of the "Error".
-
SD: The "Draws" entry is the standard
deviation of the draws so far, and the "Box" entry is the standard deviation
of the tickets in the box.