>
|
|
Maple generates a list with two elements: an integer in the range , and a rational in the same range with denominator 13.
>
|
|
In this case, we instruct Maple to generate the unevaluated function , with two arguments; the first is an integer in the range , and the second is a rational in the same range with denominator 17.
>
|
|
In this case, we generate a function call to the function , with as its arguments a range of which the left and right hand sides are randomly generated. The function call is evaluated when it is returned, yielding an actual Array.
>
|
|
For this example, we try to generate the sum of two independent rolls of a six-sided die. You might try to use the flavor but Maple automatically simplifies that to before the RandomTools[Generate] command is run. As a consequence, you get a single die roll, multiplied by two. This is shown here by generating a list of 20 such values; note they are all even.
>
|
|
| (3) |
In such a situation, a better solution is to use inert form operators to specify the flavor, and apply the value command after generating the result to combine the values.
>
|
|
| (4) |