 positive - Maple Help

RandomTools Flavor: positive

describe a flavor of a random positive rational number Calling Sequence positive positive(opts) Parameters

 opts - equation(s) of the form option = value where option is one of range, character, or denominator; specify options for the random positive rational number Description

 • The flavor positive describes a random positive rational number in a particular range.
 To describe a flavor of a random positive rational number, use either positive or positive(opts) (where opts is described following) as the argument to RandomTools[Generate] or as part of a structured flavor.
 • By default, the flavor positive describes a random rational number in the range $0..1$ (excluding $0$) with a denominator of $999999999989$, or the integer $1$.
 • You can modify the properties of a random rational number by using the rational(opts) form of this flavor. The opts argument can contain one or more of the following equations.
 range = b
 This option describes the right endpoint of the range from which the random rational number is chosen. The right endpoint must be of type rational and positive and it describes a random rational number in the interval $0..b$, where $0$ is excluded and the inclusiveness of b is determined by the character option.
 character = open or closed
 This option specifies whether to include the right endpoint of the range from which the random rational number is chosen. The default value for this option is closed.
 denominator = posint
 This option specifies the positive integer to use as the denominator for the random rational number that is generated. Note: The return value may be an integer, or a fraction with a denominator that is a factor of the specified integer.
 The default denominator is $999999999989$.
 In the case of the closed interval $0..1$, the denominator is prime. Therefore, a result of $\frac{1}{3}$ cannot occur. Instead, you can specify a denominator that is highly composite. For example, $720720$. Examples

 > $\mathrm{with}\left(\mathrm{RandomTools}\right):$
 > $\mathrm{Generate}\left(\mathrm{positive}\right)$
 $\frac{{395718860535}}{{999999999989}}$ (1)
 > $\mathrm{Generate}\left(\mathrm{positive}\left(\mathrm{range}=5\right)\right)$
 $\frac{{3224811806586}}{{999999999989}}$ (2)
 > $\mathrm{Generate}\left(\mathrm{positive}\left(\mathrm{range}=\frac{1}{2},\mathrm{denominator}=720720\right)\right)$
 $\frac{{28937}}{{144144}}$ (3)
 > $\mathrm{Generate}\left(\mathrm{positive}\left(\mathrm{denominator}=10\right)\right)$
 $\frac{{3}}{{5}}$ (4)
 > $\mathrm{sort}\left(\left[\mathrm{seq}\left(\mathrm{Generate}\left(\mathrm{positive}\left(\mathrm{denominator}=6,\mathrm{character}=\mathrm{closed}\right)\right),i=1..10\right)\right],'\mathrm{numeric}'\right)$
 $\left[\frac{{1}}{{6}}{,}\frac{{1}}{{3}}{,}\frac{{1}}{{3}}{,}\frac{{1}}{{2}}{,}\frac{{1}}{{2}}{,}\frac{{2}}{{3}}{,}\frac{{2}}{{3}}{,}\frac{{5}}{{6}}{,}\frac{{5}}{{6}}{,}{1}\right]$ (5)
 > $\mathrm{Generate}\left(\mathrm{list}\left(\mathrm{positive}\left(\mathrm{range}=\frac{13}{2}\right),10\right)\right)$
 $\left[\frac{{3273442022562}}{{999999999989}}{,}\frac{{5574741247156}}{{999999999989}}{,}\frac{{1339845829803}}{{999999999989}}{,}\frac{{2584712523357}}{{999999999989}}{,}\frac{{6104959978546}}{{999999999989}}{,}\frac{{1627430692015}}{{999999999989}}{,}\frac{{33467275626}}{{999999999989}}{,}\frac{{5145196841900}}{{999999999989}}{,}\frac{{1686443564877}}{{999999999989}}{,}\frac{{5197063808656}}{{999999999989}}\right]$ (6)
 > $\mathrm{seq}\left(\mathrm{Generate}\left(\mathrm{positive}\left(\mathrm{range}=7,\mathrm{denominator}=720720\right)\right),i=1..10\right)$
 $\frac{{4238413}}{{720720}}{,}\frac{{857911}}{{360360}}{,}\frac{{1074583}}{{180180}}{,}\frac{{430957}}{{240240}}{,}\frac{{886631}}{{360360}}{,}\frac{{579803}}{{102960}}{,}\frac{{91609}}{{102960}}{,}\frac{{913459}}{{720720}}{,}\frac{{39779}}{{180180}}{,}\frac{{972275}}{{144144}}$ (7)
 > $\mathrm{Matrix}\left(3,3,\mathrm{Generate}\left(\mathrm{positive}\left(\mathrm{denominator}=24\right)\mathrm{identical}\left(x\right)+\mathrm{positive}\left(\mathrm{denominator}=16\right),\mathrm{makeproc}=\mathrm{true}\right)\right)$
 $\left[\begin{array}{ccc}\frac{{x}}{{3}}{+}\frac{{5}}{{8}}& \frac{{x}}{{8}}{+}\frac{{1}}{{16}}& \frac{{17}{}{x}}{{24}}{+}\frac{{3}}{{16}}\\ \frac{{5}{}{x}}{{24}}{+}\frac{{5}}{{16}}& \frac{{5}{}{x}}{{12}}{+}\frac{{5}}{{8}}& \frac{{5}{}{x}}{{12}}{+}\frac{{11}}{{16}}\\ \frac{{x}}{{12}}{+}\frac{{1}}{{2}}& \frac{{5}{}{x}}{{6}}{+}\frac{{15}}{{16}}& \frac{{x}}{{12}}{+}\frac{{9}}{{16}}\end{array}\right]$ (8)