Roll: Difference between revisions
Jump to navigation
Jump to search
Miraheze>Marshall No edit summary |
Miraheze>Adám Brudzewsky m (→Description) |
||
Line 16: | Line 16: | ||
Each [[scalar]] in the argument to Roll must be a non-negative integer. | Each [[scalar]] in the argument to Roll must be a non-negative integer. | ||
The result of Roll on each number < | The result of Roll on each number <source lang=apl inline>n</source> is either | ||
* A real number chosen uniformly at random from between 0 and 1, if n is 0; or | * A real number chosen uniformly at random from between 0 and 1, if n is 0; or | ||
* One of the elements of < | * One of the elements of <source lang=apl inline>⍳n</source> chosen uniformly at random, otherwise. | ||
Because [[Iota]] depends on [[index origin]], Roll depends on index origin unless every number in the argument is 0. | Because [[Iota]] depends on [[index origin]], Roll depends on index origin unless every number in the argument is 0. | ||
The choices made by Roll do not have to be truly random: they may be pseudorandom (generated by a deterministic but difficult to predict algorithm) or taken from the operating system. They way random numbers are generated is controlled by the [[random link]] <source | The choices made by Roll do not have to be truly random: they may be pseudorandom (generated by a deterministic but difficult to predict algorithm) or taken from the operating system. They way random numbers are generated is controlled by the [[random link]] <source lang=apl inline>⎕RL</source>. | ||
== External links == | == External links == |