Deal: Difference between revisions

Jump to navigation Jump to search
71 bytes removed ,  09:50, 4 June 2020
No edit summary
Line 44: Line 44:
Deal depends on [[index origin]]. In particular, it picks k numbers from [[Index Generator|1 to n]] if <source lang=apl inline>⎕IO←1</source>, and from 0 to n-1 if <source lang=apl inline>⎕IO←0</source>.
Deal depends on [[index origin]]. In particular, it picks k numbers from [[Index Generator|1 to n]] if <source lang=apl inline>⎕IO←1</source>, and from 0 to n-1 if <source lang=apl inline>⎕IO←0</source>.


The choices made by Deal do not have to be truly random: they may be [[wikipedia:pseudorandom|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>. Note that using pseudorandom numbers for Deal may not be ideal for generating large permutations, since the possible number of permutations generated is bounded by the cycle length of the [[wikipedia:random number generator|random number generator]] used. Traditionally, APL uses the [[wikipedia:Lehmer random number generator|Lehmer random number generator]], but [[Dyalog APL]] defaults to the allow choosing a different random number generator and defaults to the [[wikipedia:Mersenne Twister|Mersenne Twister]].
The choices made by Deal do not have to be truly random: they may be [[wikipedia:pseudorandom|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>. Note that using pseudorandom numbers for Deal may not be ideal for generating large permutations, since the possible number of permutations generated is bounded by the cycle length of the [[wikipedia:random number generator|random number generator]] used. Traditionally, APL uses the [[wikipedia:Lehmer random number generator|Lehmer random number generator]], but [[Dyalog APL]] defaults to the [[wikipedia:Mersenne Twister|Mersenne Twister]].


== External links ==
== External links ==
trusted
183

edits

Navigation menu