Mathematica 9 is now available

Random

Usage

Random[ ] gives a uniformly distributed pseudorandom Real in the range 0 to 1.
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}.


Notes

Random[Integer] gives 0 or 1 with probability  .
Random[Complex] gives a pseudorandom complex number in the rectangle with corners  and  .
Random[Complex, { ,  }] 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 0.
Random gives a different sequence of pseudorandom numbers whenever you run Mathematica. You can start Random with a particular seed using SeedRandom.
• Implementation notes: see Section A.9.4.
• See also: $RandomState, FindInstance.
• New in Version 1.


Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.