Random

As of Version 6.0, has been superseded by the functions RandomReal and RandomInteger.


gives a uniformly distributed pseudorandom Real in the range 0 to 1.


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 explicitly; a range specification of max is equivalent to .

DetailsDetails

  • Random[Integer] gives or with probability .
  • Random[Complex] gives a pseudorandom complex number in the rectangle with corners and 1+i.
  • Random[Complex, {zmin, zmax}] uses the rectangle defined by and .
  • Random[Real, range, n] generates a pseudorandom real number with n-digit precision. Both leading and trailing digits may be chosen as .
  • gives a different sequence of pseudorandom numbers whenever you run Mathematica. You can start with a particular seed using SeedRandom.
New in 1
New to Mathematica? Find your learning path »
Have a question? Ask support »