413 Value at Risk
•
Finally, pick the fi rst fi ve numbers from the fi rst column (in this example,
1, 16, 7, 17, 9). You could, of course, equally well pick the last fi ve, the
middle fi ve, or any other fi ve numbers from the column.
The Probabilistic Model
What we’re doing here is just like picking random numbers out of an urn
without replacement. This model, standard in all introductory probability
books, imagines an urn fi lled with balls. Each ball has a different
number—in our case, there are 17 balls with numbers between 1 and 17.
The urn is shaken to mix up the balls, and then fi ve balls are drawn out.
Each ball, once drawn, is not placed back in the urn.
This model is somewhat different from the standard random-number
generators, which pick random numbers with replacement (i.e., once the
ball’s number is recorded, it is placed back in the urn, so that it could
possibly be drawn again).
4
Writing a VBA Program
The next obvious step was to write a program in VBA to automate the
procedure. Here is the spreadsheet:
4. Excel has a function Randbetween(low,high) which lets you create random integers
between low and high. Thus, to create fi ve numbers between 1 and 17, you just copy
=Randbetween(1,17) into fi ve adjacent cells. However, this is like drawing numbers
from the urn with replacement and hence can give you multiple draws of the same
number—a bingo no-no!