|
SOLUTIONS
|
Mathematica
>
Data Manipulation
>
Statistical Data Analysis
>
Random Number Generation
>
RandomInteger
BUILT-IN MATHEMATICA SYMBOL
RandomInteger
RandomInteger[{imin, imax}]
gives a pseudorandom integer in the range
.
RandomInteger[imax]
gives a pseudorandom integer in the range
.
RandomInteger[]
pseudorandomly gives 0 or 1.
RandomInteger[range, n]
gives a list of n pseudorandom integers.
RandomInteger[range, {n1, n2, ...}]
gives an
×
×... array of pseudorandom integers.
DetailsDetails
- RandomInteger[{imin, imax}] chooses integers in the range
with equal probability. - RandomInteger[] 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.
New in 6
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
