| Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
| Version 1.9 Build 1556 |
|
| Package | utility | |
| Module | mathematics | |
| Tool | randomnumbers |
The probability must be a number between zero and one. The result
will be integers in the range
0
x
N. The shape can be
either an integer or a vector of integers where all the values are
greater than zero. The default value of one will produce a scalar
output.
| probability | in | probability | |
| Allowed: | double | ||
| Default: | 0.5 | ||
| shape | in | Shape of the output array | |
| Allowed: | integer or a vector of integers | ||
| Default: | 1 | ||
include 'randomnumbers.g'
rand := randomnumbers();
print rand.geometric();
rand.done()
This example will a random numbers from the geometric distribution
that has a probability of 0.5.