This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.

# RandomInteger

 RandomInteger[{imin, imax}]gives a pseudorandom integer in the range . RandomInteger[imax]gives a pseudorandom integer in the range . pseudorandomly gives or . RandomInteger[range, n]gives a list of n pseudorandom integers. RandomInteger[range, {n1, n2, ...}]gives an array of pseudorandom integers. RandomInteger[dist, ...]samples from the symbolic discrete distribution dist.
• RandomInteger[{imin, imax}] chooses integers in the range with equal probability.
• gives 0 or 1 with probability .
• RandomInteger gives a different sequence of pseudorandom integers whenever you run Mathematica. You can start with a particular seed using SeedRandom.
• A Method option to SeedRandom can be given to specify the pseudorandom generator used.
A random integer in the range 1 through 10:
 Out[1]=

A random integer in the range 0 through 3:
 Out[1]=

A random choice of 0 or 1:
 Out[1]=

20 random integers in the range 0 through 5:
 Out[1]=

A random array of 0s and 1s:
 Out[1]=
 Scope   (1)
 Applications   (4)
New in 6