RandomTools Flavor: variable - Maple Programming Help

Home : Support : Online Help : Programming : Random Objects : RandomTools package : Flavors : RandomTools/flavor/variable

RandomTools Flavor: variable

describe a flavor of a random variable

 Calling Sequence variable variable(alphabet, length=integer)

Parameters

 alphabet - (optional) {string,symbol} restricts the characters that form the name length = integer - (optional) number of characters in the generated name

Description

 • The flavor variable describes a random symbol.  By default variables are single-character lowercase letters from the English alphabet.
 The length and alphabet options match those defined by the StringTools:-Random command.
 • Generated random variables are globally scoped in the Maple environment.  This command does not attempt to avoid returning a variable that matches something in use, possibly with an assigned value.

Examples

 > $\mathrm{with}\left(\mathrm{RandomTools}\right):$
 > $\mathrm{Generate}\left(\mathrm{variable}\right)$
 ${y}$ (1)
 > $\mathrm{Generate}\left(\mathrm{variable}\left("abc"\right)\right)$
 ${c}$ (2)
 > $\mathrm{Generate}\left(\mathrm{variable}\left(\mathrm{upper},\mathrm{length}=3\right)\right)$
 ${\mathrm{GKY}}$ (3)

Compatibility

 • The RandomTools Flavor: variable command was introduced in Maple 2018.