Fred Drake | 295da24 | 1998-08-10 19:42:37 +0000 | [diff] [blame] | 1 | \section{\module{random} --- |
Fred Drake | 048b75b | 1999-04-21 18:14:22 +0000 | [diff] [blame] | 2 | Generate pseudo-random numbers} |
Fred Drake | b91e934 | 1998-07-23 17:59:49 +0000 | [diff] [blame] | 3 | |
Fred Drake | 048b75b | 1999-04-21 18:14:22 +0000 | [diff] [blame] | 4 | \declaremodule{standard}{random} |
Fred Drake | 295da24 | 1998-08-10 19:42:37 +0000 | [diff] [blame] | 5 | \modulesynopsis{Generate pseudo-random numbers with various common |
Fred Drake | 048b75b | 1999-04-21 18:14:22 +0000 | [diff] [blame] | 6 | distributions.} |
Fred Drake | b91e934 | 1998-07-23 17:59:49 +0000 | [diff] [blame] | 7 | |
Guido van Rossum | 571391b | 1997-04-03 22:41:49 +0000 | [diff] [blame] | 8 | |
| 9 | This module implements pseudo-random number generators for various |
Tim Peters | 902446a | 2001-01-24 23:06:53 +0000 | [diff] [blame] | 10 | distributions. |
| 11 | For integers, uniform selection from a range. |
| 12 | For sequences, uniform selection of a random element, and a function to |
| 13 | generate a random permutation of a list in-place. |
| 14 | On the real line, there are functions to compute uniform, normal (Gaussian), |
| 15 | lognormal, negative exponential, gamma, and beta distributions. |
| 16 | For generating distribution of angles, the circular uniform and |
| 17 | von Mises distributions are available. |
Guido van Rossum | 571391b | 1997-04-03 22:41:49 +0000 | [diff] [blame] | 18 | |
Tim Peters | 902446a | 2001-01-24 23:06:53 +0000 | [diff] [blame] | 19 | Almost all module functions depend on the basic function |
| 20 | \function{random()}, which generates a random float uniformly in |
| 21 | the semi-open range [0.0, 1.0). Python uses the standard Wichmann-Hill |
| 22 | generator, combining three pure multiplicative congruential |
| 23 | generators of modulus 30269, 30307 and 30323. Its period (how many |
| 24 | numbers it generates before repeating the sequence exactly) is |
| 25 | 6,953,607,871,644. While of much higher quality than the \function{rand()} |
| 26 | function supplied by most C libraries, the theoretical properties |
| 27 | are much the same as for a single linear congruential generator of |
Tim Peters | 0de88fc | 2001-02-01 04:59:18 +0000 | [diff] [blame] | 28 | large modulus. It is not suitable for all purposes, and is completely |
| 29 | unsuitable for cryptographic purposes. |
Tim Peters | 902446a | 2001-01-24 23:06:53 +0000 | [diff] [blame] | 30 | |
| 31 | The functions in this module are not threadsafe: if you want to call these |
| 32 | functions from multiple threads, you should explicitly serialize the calls. |
| 33 | Else, because no critical sections are implemented internally, calls |
| 34 | from different threads may see the same return values. |
| 35 | |
Tim Peters | d7b5e88 | 2001-01-25 03:36:26 +0000 | [diff] [blame] | 36 | The functions supplied by this module are actually bound methods of a |
Fred Drake | 844bd5b | 2001-02-02 02:42:31 +0000 | [diff] [blame] | 37 | hidden instance of the \class{random.Random} class. You can |
| 38 | instantiate your own instances of \class{Random} to get generators |
| 39 | that don't share state. This is especially useful for multi-threaded |
| 40 | programs, creating a different instance of \class{Random} for each |
| 41 | thread, and using the \method{jumpahead()} method to ensure that the |
| 42 | generated sequences seen by each thread don't overlap (see example |
| 43 | below). |
| 44 | |
| 45 | Class \class{Random} can also be subclassed if you want to use a |
| 46 | different basic generator of your own devising: in that case, override |
| 47 | the \method{random()}, \method{seed()}, \method{getstate()}, |
Tim Peters | d52269b | 2001-01-25 06:23:18 +0000 | [diff] [blame] | 48 | \method{setstate()} and \method{jumpahead()} methods. |
Tim Peters | d7b5e88 | 2001-01-25 03:36:26 +0000 | [diff] [blame] | 49 | |
Tim Peters | e360d95 | 2001-01-26 10:00:39 +0000 | [diff] [blame] | 50 | Here's one way to create threadsafe distinct and non-overlapping generators: |
| 51 | |
| 52 | \begin{verbatim} |
| 53 | def create_generators(num, delta, firstseed=None): |
| 54 | """Return list of num distinct generators. |
| 55 | Each generator has its own unique segment of delta elements |
| 56 | from Random.random()'s full period. |
| 57 | Seed the first generator with optional arg firstseed (default |
| 58 | is None, to seed from current time). |
| 59 | """ |
| 60 | |
| 61 | from random import Random |
| 62 | g = Random(firstseed) |
| 63 | result = [g] |
| 64 | for i in range(num - 1): |
| 65 | laststate = g.getstate() |
| 66 | g = Random() |
| 67 | g.setstate(laststate) |
| 68 | g.jumpahead(delta) |
| 69 | result.append(g) |
| 70 | return result |
| 71 | |
| 72 | gens = create_generators(10, 1000000) |
| 73 | \end{verbatim} |
| 74 | |
Fred Drake | d0946da | 2001-02-01 15:53:24 +0000 | [diff] [blame] | 75 | That creates 10 distinct generators, which can be passed out to 10 |
| 76 | distinct threads. The generators don't share state so can be called |
| 77 | safely in parallel. So long as no thread calls its \code{g.random()} |
| 78 | more than a million times (the second argument to |
| 79 | \function{create_generators()}, the sequences seen by each thread will |
| 80 | not overlap. The period of the underlying Wichmann-Hill generator |
| 81 | limits how far this technique can be pushed. |
Tim Peters | e360d95 | 2001-01-26 10:00:39 +0000 | [diff] [blame] | 82 | |
Fred Drake | d0946da | 2001-02-01 15:53:24 +0000 | [diff] [blame] | 83 | Just for fun, note that since we know the period, \method{jumpahead()} |
| 84 | can also be used to ``move backward in time:'' |
Tim Peters | e360d95 | 2001-01-26 10:00:39 +0000 | [diff] [blame] | 85 | |
| 86 | \begin{verbatim} |
| 87 | >>> g = Random(42) # arbitrary |
| 88 | >>> g.random() |
Tim Peters | 0de88fc | 2001-02-01 04:59:18 +0000 | [diff] [blame] | 89 | 0.25420336316883324 |
Tim Peters | e360d95 | 2001-01-26 10:00:39 +0000 | [diff] [blame] | 90 | >>> g.jumpahead(6953607871644L - 1) # move *back* one |
| 91 | >>> g.random() |
Tim Peters | 0de88fc | 2001-02-01 04:59:18 +0000 | [diff] [blame] | 92 | 0.25420336316883324 |
Tim Peters | e360d95 | 2001-01-26 10:00:39 +0000 | [diff] [blame] | 93 | \end{verbatim} |
| 94 | |
Tim Peters | d7b5e88 | 2001-01-25 03:36:26 +0000 | [diff] [blame] | 95 | |
| 96 | Bookkeeping functions: |
Tim Peters | 902446a | 2001-01-24 23:06:53 +0000 | [diff] [blame] | 97 | |
| 98 | \begin{funcdesc}{seed}{\optional{x}} |
| 99 | Initialize the basic random number generator. |
Tim Peters | 0de88fc | 2001-02-01 04:59:18 +0000 | [diff] [blame] | 100 | Optional argument \var{x} can be any hashable object. |
Fred Drake | 4cacec5 | 2001-04-21 05:56:06 +0000 | [diff] [blame] | 101 | If \var{x} is omitted or \code{None}, current system time is used; |
Tim Peters | 0de88fc | 2001-02-01 04:59:18 +0000 | [diff] [blame] | 102 | current system time is also used to initialize the generator when the |
| 103 | module is first imported. |
Fred Drake | 4cacec5 | 2001-04-21 05:56:06 +0000 | [diff] [blame] | 104 | If \var{x} is not \code{None} or an int or long, |
Fred Drake | d0946da | 2001-02-01 15:53:24 +0000 | [diff] [blame] | 105 | \code{hash(\var{x})} is used instead. |
Tim Peters | 0de88fc | 2001-02-01 04:59:18 +0000 | [diff] [blame] | 106 | If \var{x} is an int or long, \var{x} is used directly. |
| 107 | Distinct values between 0 and 27814431486575L inclusive are guaranteed |
| 108 | to yield distinct internal states (this guarantee is specific to the |
| 109 | default Wichmann-Hill generator, and may not apply to subclasses |
| 110 | supplying their own basic generator). |
| 111 | \end{funcdesc} |
| 112 | |
| 113 | \begin{funcdesc}{whseed}{\optional{x}} |
| 114 | This is obsolete, supplied for bit-level compatibility with versions |
| 115 | of Python prior to 2.1. |
| 116 | See \function{seed} for details. \function{whseed} does not guarantee |
| 117 | that distinct integer arguments yield distinct internal states, and can |
| 118 | yield no more than about 2**24 distinct internal states in all. |
Barry Warsaw | 8312577 | 2001-01-25 00:39:16 +0000 | [diff] [blame] | 119 | \end{funcdesc} |
Guido van Rossum | 571391b | 1997-04-03 22:41:49 +0000 | [diff] [blame] | 120 | |
Tim Peters | d7b5e88 | 2001-01-25 03:36:26 +0000 | [diff] [blame] | 121 | \begin{funcdesc}{getstate}{} |
Fred Drake | 844bd5b | 2001-02-02 02:42:31 +0000 | [diff] [blame] | 122 | Return an object capturing the current internal state of the |
| 123 | generator. This object can be passed to \function{setstate()} to |
| 124 | restore the state. |
Tim Peters | 0de88fc | 2001-02-01 04:59:18 +0000 | [diff] [blame] | 125 | \versionadded{2.1} |
| 126 | \end{funcdesc} |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 127 | |
Tim Peters | d7b5e88 | 2001-01-25 03:36:26 +0000 | [diff] [blame] | 128 | \begin{funcdesc}{setstate}{state} |
| 129 | \var{state} should have been obtained from a previous call to |
Fred Drake | 844bd5b | 2001-02-02 02:42:31 +0000 | [diff] [blame] | 130 | \function{getstate()}, and \function{setstate()} restores the |
| 131 | internal state of the generator to what it was at the time |
| 132 | \function{setstate()} was called. |
Tim Peters | 0de88fc | 2001-02-01 04:59:18 +0000 | [diff] [blame] | 133 | \versionadded{2.1} |
Fred Drake | 844bd5b | 2001-02-02 02:42:31 +0000 | [diff] [blame] | 134 | \end{funcdesc} |
Tim Peters | d7b5e88 | 2001-01-25 03:36:26 +0000 | [diff] [blame] | 135 | |
Tim Peters | d52269b | 2001-01-25 06:23:18 +0000 | [diff] [blame] | 136 | \begin{funcdesc}{jumpahead}{n} |
Fred Drake | 844bd5b | 2001-02-02 02:42:31 +0000 | [diff] [blame] | 137 | Change the internal state to what it would be if \function{random()} |
| 138 | were called \var{n} times, but do so quickly. \var{n} is a |
| 139 | non-negative integer. This is most useful in multi-threaded |
Fred Drake | 4cacec5 | 2001-04-21 05:56:06 +0000 | [diff] [blame] | 140 | programs, in conjuction with multiple instances of the \class{Random} |
Fred Drake | 844bd5b | 2001-02-02 02:42:31 +0000 | [diff] [blame] | 141 | class: \method{setstate()} or \method{seed()} can be used to force |
| 142 | all instances into the same internal state, and then |
| 143 | \method{jumpahead()} can be used to force the instances' states as |
| 144 | far apart as you like (up to the period of the generator). |
Tim Peters | 0de88fc | 2001-02-01 04:59:18 +0000 | [diff] [blame] | 145 | \versionadded{2.1} |
Tim Peters | d52269b | 2001-01-25 06:23:18 +0000 | [diff] [blame] | 146 | \end{funcdesc} |
Tim Peters | d7b5e88 | 2001-01-25 03:36:26 +0000 | [diff] [blame] | 147 | |
| 148 | Functions for integers: |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 149 | |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 150 | \begin{funcdesc}{randrange}{\optional{start,} stop\optional{, step}} |
| 151 | Return a randomly selected element from \code{range(\var{start}, |
| 152 | \var{stop}, \var{step})}. This is equivalent to |
Tim Peters | 902446a | 2001-01-24 23:06:53 +0000 | [diff] [blame] | 153 | \code{choice(range(\var{start}, \var{stop}, \var{step}))}, |
| 154 | but doesn't actually build a range object. |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 155 | \versionadded{1.5.2} |
| 156 | \end{funcdesc} |
| 157 | |
Tim Peters | d7b5e88 | 2001-01-25 03:36:26 +0000 | [diff] [blame] | 158 | \begin{funcdesc}{randint}{a, b} |
Tim Peters | d7b5e88 | 2001-01-25 03:36:26 +0000 | [diff] [blame] | 159 | Return a random integer \var{N} such that |
| 160 | \code{\var{a} <= \var{N} <= \var{b}}. |
| 161 | \end{funcdesc} |
| 162 | |
| 163 | |
| 164 | Functions for sequences: |
| 165 | |
| 166 | \begin{funcdesc}{choice}{seq} |
| 167 | Return a random element from the non-empty sequence \var{seq}. |
| 168 | \end{funcdesc} |
| 169 | |
| 170 | \begin{funcdesc}{shuffle}{x\optional{, random}} |
| 171 | Shuffle the sequence \var{x} in place. |
| 172 | The optional argument \var{random} is a 0-argument function |
| 173 | returning a random float in [0.0, 1.0); by default, this is the |
| 174 | function \function{random()}. |
| 175 | |
| 176 | Note that for even rather small \code{len(\var{x})}, the total |
| 177 | number of permutations of \var{x} is larger than the period of most |
| 178 | random number generators; this implies that most permutations of a |
| 179 | long sequence can never be generated. |
| 180 | \end{funcdesc} |
| 181 | |
Raymond Hettinger | f24eb35 | 2002-11-12 17:41:57 +0000 | [diff] [blame] | 182 | \begin{funcdesc}{sample}{population, k} |
| 183 | Return a \var{k} length list of unique elements chosen from the |
| 184 | population sequence. Used for random sampling without replacement. |
Raymond Hettinger | f24eb35 | 2002-11-12 17:41:57 +0000 | [diff] [blame] | 185 | \versionadded{2.3} |
Raymond Hettinger | 311f419 | 2002-11-18 09:01:24 +0000 | [diff] [blame^] | 186 | |
| 187 | Returns a new list containing elements from the population while |
| 188 | leaving the original population unchanged. The resulting list is |
| 189 | in selection order so that all sub-slices will also be valid random |
| 190 | samples. This allows raffle winners (the sample) to be partitioned |
| 191 | into grand prize and second place winners (the subslices). |
| 192 | |
| 193 | Members of the population need not be hashable or unique. If the |
| 194 | population contains repeats, then each occurrence is a possible |
| 195 | selection in the sample. |
| 196 | |
| 197 | To choose a sample from a range of integers, use \function{xrange} |
| 198 | as an argument. This is especially fast and space efficient for |
| 199 | sampling from a large population: \code{sample(xrange(10000000), 60)}. |
Raymond Hettinger | f24eb35 | 2002-11-12 17:41:57 +0000 | [diff] [blame] | 200 | \end{funcdesc} |
| 201 | |
Tim Peters | d7b5e88 | 2001-01-25 03:36:26 +0000 | [diff] [blame] | 202 | |
| 203 | The following functions generate specific real-valued distributions. |
| 204 | Function parameters are named after the corresponding variables in the |
| 205 | distribution's equation, as used in common mathematical practice; most of |
| 206 | these equations can be found in any statistics text. |
| 207 | |
Tim Peters | 902446a | 2001-01-24 23:06:53 +0000 | [diff] [blame] | 208 | \begin{funcdesc}{random}{} |
| 209 | Return the next random floating point number in the range [0.0, 1.0). |
| 210 | \end{funcdesc} |
| 211 | |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 212 | \begin{funcdesc}{uniform}{a, b} |
Tim Peters | 902446a | 2001-01-24 23:06:53 +0000 | [diff] [blame] | 213 | Return a random real number \var{N} such that |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 214 | \code{\var{a} <= \var{N} < \var{b}}. |
| 215 | \end{funcdesc} |
Fred Drake | 38e5d27 | 2000-04-03 20:13:55 +0000 | [diff] [blame] | 216 | |
Fred Drake | 2eda4ca | 1998-03-08 08:13:53 +0000 | [diff] [blame] | 217 | \begin{funcdesc}{betavariate}{alpha, beta} |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 218 | Beta distribution. Conditions on the parameters are |
| 219 | \code{\var{alpha} > -1} and \code{\var{beta} > -1}. |
| 220 | Returned values range between 0 and 1. |
Guido van Rossum | 571391b | 1997-04-03 22:41:49 +0000 | [diff] [blame] | 221 | \end{funcdesc} |
| 222 | |
Fred Drake | 2eda4ca | 1998-03-08 08:13:53 +0000 | [diff] [blame] | 223 | \begin{funcdesc}{cunifvariate}{mean, arc} |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 224 | Circular uniform distribution. \var{mean} is the mean angle, and |
| 225 | \var{arc} is the range of the distribution, centered around the mean |
| 226 | angle. Both values must be expressed in radians, and can range |
Tim Peters | 902446a | 2001-01-24 23:06:53 +0000 | [diff] [blame] | 227 | between 0 and \emph{pi}. Returned values range between |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 228 | \code{\var{mean} - \var{arc}/2} and \code{\var{mean} + |
Raymond Hettinger | c32f033 | 2002-05-23 19:44:49 +0000 | [diff] [blame] | 229 | \var{arc}/2} and are normalized to between 0 and \emph{pi}. |
| 230 | |
Fred Drake | 92bf9da | 2002-05-23 21:07:19 +0000 | [diff] [blame] | 231 | \deprecated{2.3}{Instead, use \code{(\var{mean} + \var{arc} * |
| 232 | (random.random() - 0.5)) \% math.pi}.} |
Guido van Rossum | 571391b | 1997-04-03 22:41:49 +0000 | [diff] [blame] | 233 | \end{funcdesc} |
| 234 | |
| 235 | \begin{funcdesc}{expovariate}{lambd} |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 236 | Exponential distribution. \var{lambd} is 1.0 divided by the desired |
| 237 | mean. (The parameter would be called ``lambda'', but that is a |
Tim Peters | 902446a | 2001-01-24 23:06:53 +0000 | [diff] [blame] | 238 | reserved word in Python.) Returned values range from 0 to |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 239 | positive infinity. |
Guido van Rossum | 571391b | 1997-04-03 22:41:49 +0000 | [diff] [blame] | 240 | \end{funcdesc} |
| 241 | |
Raymond Hettinger | 5359ad6 | 2002-05-13 22:40:38 +0000 | [diff] [blame] | 242 | \begin{funcdesc}{gammavariate}{alpha, beta} |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 243 | Gamma distribution. (\emph{Not} the gamma function!) Conditions on |
Raymond Hettinger | 576474c | 2002-05-13 23:49:13 +0000 | [diff] [blame] | 244 | the parameters are \code{\var{alpha} > 0} and \code{\var{beta} > 0}. |
Guido van Rossum | 571391b | 1997-04-03 22:41:49 +0000 | [diff] [blame] | 245 | \end{funcdesc} |
| 246 | |
Fred Drake | 2eda4ca | 1998-03-08 08:13:53 +0000 | [diff] [blame] | 247 | \begin{funcdesc}{gauss}{mu, sigma} |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 248 | Gaussian distribution. \var{mu} is the mean, and \var{sigma} is the |
| 249 | standard deviation. This is slightly faster than the |
| 250 | \function{normalvariate()} function defined below. |
Guido van Rossum | 571391b | 1997-04-03 22:41:49 +0000 | [diff] [blame] | 251 | \end{funcdesc} |
| 252 | |
Fred Drake | 2eda4ca | 1998-03-08 08:13:53 +0000 | [diff] [blame] | 253 | \begin{funcdesc}{lognormvariate}{mu, sigma} |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 254 | Log normal distribution. If you take the natural logarithm of this |
| 255 | distribution, you'll get a normal distribution with mean \var{mu} |
| 256 | and standard deviation \var{sigma}. \var{mu} can have any value, |
Tim Peters | 902446a | 2001-01-24 23:06:53 +0000 | [diff] [blame] | 257 | and \var{sigma} must be greater than zero. |
Guido van Rossum | 571391b | 1997-04-03 22:41:49 +0000 | [diff] [blame] | 258 | \end{funcdesc} |
| 259 | |
Fred Drake | 2eda4ca | 1998-03-08 08:13:53 +0000 | [diff] [blame] | 260 | \begin{funcdesc}{normalvariate}{mu, sigma} |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 261 | Normal distribution. \var{mu} is the mean, and \var{sigma} is the |
| 262 | standard deviation. |
Guido van Rossum | 571391b | 1997-04-03 22:41:49 +0000 | [diff] [blame] | 263 | \end{funcdesc} |
| 264 | |
Fred Drake | 2eda4ca | 1998-03-08 08:13:53 +0000 | [diff] [blame] | 265 | \begin{funcdesc}{vonmisesvariate}{mu, kappa} |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 266 | \var{mu} is the mean angle, expressed in radians between 0 and |
| 267 | 2*\emph{pi}, and \var{kappa} is the concentration parameter, which |
| 268 | must be greater than or equal to zero. If \var{kappa} is equal to |
| 269 | zero, this distribution reduces to a uniform random angle over the |
| 270 | range 0 to 2*\emph{pi}. |
Guido van Rossum | 571391b | 1997-04-03 22:41:49 +0000 | [diff] [blame] | 271 | \end{funcdesc} |
Guido van Rossum | e47da0a | 1997-07-17 16:34:52 +0000 | [diff] [blame] | 272 | |
Guido van Rossum | 4f80b65 | 1997-12-30 17:38:05 +0000 | [diff] [blame] | 273 | \begin{funcdesc}{paretovariate}{alpha} |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 274 | Pareto distribution. \var{alpha} is the shape parameter. |
Guido van Rossum | 4f80b65 | 1997-12-30 17:38:05 +0000 | [diff] [blame] | 275 | \end{funcdesc} |
| 276 | |
| 277 | \begin{funcdesc}{weibullvariate}{alpha, beta} |
Fred Drake | 5f0decf | 2001-01-22 18:18:30 +0000 | [diff] [blame] | 278 | Weibull distribution. \var{alpha} is the scale parameter and |
| 279 | \var{beta} is the shape parameter. |
Guido van Rossum | 4f80b65 | 1997-12-30 17:38:05 +0000 | [diff] [blame] | 280 | \end{funcdesc} |
Guido van Rossum | e47da0a | 1997-07-17 16:34:52 +0000 | [diff] [blame] | 281 | |
Fred Drake | 065cba1 | 2000-12-15 19:07:17 +0000 | [diff] [blame] | 282 | |
Guido van Rossum | e47da0a | 1997-07-17 16:34:52 +0000 | [diff] [blame] | 283 | \begin{seealso} |
Tim Peters | 902446a | 2001-01-24 23:06:53 +0000 | [diff] [blame] | 284 | \seetext{Wichmann, B. A. \& Hill, I. D., ``Algorithm AS 183: |
| 285 | An efficient and portable pseudo-random number generator'', |
| 286 | \citetitle{Applied Statistics} 31 (1982) 188-190.} |
Guido van Rossum | e47da0a | 1997-07-17 16:34:52 +0000 | [diff] [blame] | 287 | \end{seealso} |