Professional Documents
Culture Documents
The drunk object, like random, generates positive integer numbers wi thin an
interval that begins at 0. It is possible to t ransform th is int erval into an arbi-
trary interval by using the technique that we examined in Section IA.2 (On t he
Generation of Random Numbers); see in particu lar f igure IA. 16 and the version
of the algori th m within th e subpatch in f igure IA.28 . In f igure IA.38, we see an
adaptation of th is algorithm fo r drunk :
tJ iJ minimum t1J
,---------j
r
maximum
...
J maximum interval between
~
drunk a number and ",ts successor