Wolfram ResearchPRODUCTSPURCHASEFOR USERSCOMPANYOUR SITES
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.

Random

Usage
Notes
Further Examples

Here is a pseudorandom real number in the range from  to  .

In[1]:=  

Out[1]=

If you need repeatable results, you can reseed the random number generator.

In[2]:=  

In[3]:=  

Out[3]=

In[4]:=  

In[5]:=  

Out[5]=

Here is a pseudorandom integer in the range from  to  .

In[6]:=  

Out[6]=

Here is a pseudorandom real number in the range from  to  .

In[7]:=  

Out[7]=

This generates a pseudorandom real number in the range from  to  with  digits of precision.

In[8]:=  

Out[8]=

In[9]:=  

Out[9]=

Here is a pseudorandom complex number in the rectangle with corners   and   .

In[10]:=  

Out[10]=

To use a different distribution to generate pseudorandom numbers, first load the package ContinuousDistributions.

In[11]:=  

This defines the function RandomNormal which generates pseudorandom numbers with a normal distribution.

In[12]:=  

This generates a pseudorandom number from a normal distribution with mean  and standard deviation  .

In[13]:=  

Out[13]=

The defined function RandomRelist gives a list with the same members as the input list, but in a random reordering.

In[14]:=  

In[15]:=  

Out[15]=


Any questions about topics on this page? Click here to get an individual response.Buy NowFree TrialMore Information



 © 2009 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: