|
Calling Sequence
|
|
range(n)
range(m, n)
range(m, n, k)
|
|
Parameters
|
|
|
|
Description
|
|
•
|
The range command returns random integers from a range defined with a step size.
|
•
|
The range(n) command, where n>=1, generates a random integer in the range 1, ..., floor(n) (inclusive). There are floor(n) numbers in that range. Hence, it is a selection of one number from a choice of floor(n).
|
•
|
With 2 arguments, range(m,n), where n-m>=0, generates a random integer in the range m, m+1,..., m+q (inclusive) where q is the floor of n-m
|
•
|
With 3 arguments, range(m,n,k), where (n-m)/k=0 generates a random integer in the range m, m+k, ..., m+qk (inclusive) where q is the floor of (n-m)/k. That is, range(n) = range(1,n) = range(1,n,1)
|
•
|
Note: The rint function returns random numbers in the range 0, ..., n-1 (inclusive).
|
|
|
Examples
|
|
>
|
|
>
|
|
>
|
|
>
|
|
>
|
|
| (5) |
>
|
|
| (6) |
|
|
Compatibility
|
|
•
|
The MapleTA[Builtin][range] command was introduced in Maple 18.
|
|
|
|