 MapleTA[Builtin] - Maple Programming Help

Home : Support : Online Help : Connectivity : Maple T.A. : MapleTA Package : Builtin : MapleTA/Builtin/rint

MapleTA[Builtin]

 rint
 return random integers

 Calling Sequence rint(n) rint(m, n) rint(m, n, k)

Parameters

 m, n, k - integer

Description

 • The rint(n) function generates a random integer in the range 0, ..., n-1 (inclusive). There are n numbers in that range. Hence, it is a selection of one number from a choice of n.
 • The rint(m,n) function generates a random integer in the range m, ..., n-1 (inclusive).
 • The rint(m,n,k) function generates a random integer in the range m, m+k, ..., m+qk (inclusive) where q is the largest integer such that m+qk<=n-k. That is, rint(n) = rint(0,n) = rint(0,n,1)

Examples

 > $\mathrm{MapleTA}:-\mathrm{Builtin}:-\mathrm{rint}\left(3\right)$
 ${0}$ (1)
 > $\left\{\mathrm{seq}\left(\mathrm{MapleTA}:-\mathrm{Builtin}:-\mathrm{rint}\left(3\right),i=1..100\right)\right\}$
 $\left\{{0}{,}{1}{,}{2}\right\}$ (2)
 > $\mathrm{MapleTA}:-\mathrm{Builtin}:-\mathrm{rint}\left(1,3\right)$
 ${1}$ (3)
 > $\left\{\mathrm{seq}\left(\mathrm{MapleTA}:-\mathrm{Builtin}:-\mathrm{rint}\left(1,3\right),i=1..100\right)\right\}$
 $\left\{{1}{,}{2}\right\}$ (4)
 > $\mathrm{MapleTA}:-\mathrm{Builtin}:-\mathrm{rint}\left(0,7,3\right)$
 ${3}$ (5)
 > $\left\{\mathrm{seq}\left(\mathrm{MapleTA}:-\mathrm{Builtin}:-\mathrm{rint}\left(0,7,3\right),i=1..100\right)\right\}$
 $\left\{{0}{,}{3}\right\}$ (6)
 > $\left\{\mathrm{seq}\left(\mathrm{MapleTA}:-\mathrm{Builtin}:-\mathrm{rint}\left(0,8,3\right),i=1..100\right)\right\}$
 $\left\{{0}{,}{3}\right\}$ (7)
 > $\left\{\mathrm{seq}\left(\mathrm{MapleTA}:-\mathrm{Builtin}:-\mathrm{rint}\left(0,9,3\right),i=1..100\right)\right\}$
 $\left\{{0}{,}{3}{,}{6}\right\}$ (8)
 > $\left\{\mathrm{seq}\left(\mathrm{MapleTA}:-\mathrm{Builtin}:-\mathrm{rint}\left(1,10,3\right),i=1..100\right)\right\}$
 $\left\{{1}{,}{4}{,}{7}\right\}$ (9)

Compatibility

 • The MapleTA[Builtin][rint] command was introduced in Maple 18.