This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / Built-in Functions / Mathematical Functions / Random Numbers /


FilledSmallSquare Random[ ] gives a uniformly distributed pseudorandom Real in the range 0 to 1.

FilledSmallSquare Random[type, range] gives a pseudorandom number of the specified type, lying in the specified range. Possible types are: Integer, Real and Complex. The default range is 0 to 1. You can give the range min, max explicitly; a range specification of max is equivalent to 0, max.

FilledSmallSquare Random[Integer] gives 0 or 1 with probability .

FilledSmallSquare Random[Complex] gives a pseudorandom complex number in the rectangle with corners and .

FilledSmallSquare Random[Complex, zmin, zmax] uses the rectangle defined by zmin and zmax.

FilledSmallSquare Random[Real, range, n] generates a pseudorandom real number with n-digit precision. Both leading and trailing digits may be chosen as 0.

FilledSmallSquare Random gives a different sequence of pseudorandom numbers whenever you run Mathematica. You can start Random with a particular seed using SeedRandom.

FilledSmallSquare See Section 1.1.3 and Section 3.2.3.

FilledSmallSquare Implementation Notes: see Section A.9.4.

FilledSmallSquare See also: $RandomState, FindInstance.

FilledSmallSquare Related packages: Statistics`ContinuousDistributions`, Statistics`DiscreteDistributions`.

FilledSmallSquare New in Version 1.

Further Examples