1
edit
m (Text replacement - "</source>" to "</syntaxhighlight>") Tags: Mobile edit Mobile web edit |
(fixed typo) |
||
Line 1: | Line 1: | ||
{{Built-in|Deal|?}} is a [[dyadic]] [[primitive function]] which returns a random [[wikipedia:permutation#k-permutations of n|partial permutation]]. The name ''Deal'' comes from the analogy of [[wikipedia:card game# | {{Built-in|Deal|?}} is a [[dyadic]] [[primitive function]] which returns a random [[wikipedia:permutation#k-permutations of n|partial permutation]]. The name ''Deal'' comes from the analogy of [[wikipedia:card game#Deal|dealing cards]] in a card game such as Poker. Both [[argument|arguments]] of <syntaxhighlight lang=apl inline>k?n</syntaxhighlight> must be non-negative integer [[scalar|scalars]] with <syntaxhighlight lang=apl inline>k≤n</syntaxhighlight>, and Deal generates a random k-permutation by selecting <syntaxhighlight lang=apl inline>k</syntaxhighlight> numbers from the first <syntaxhighlight lang=apl inline>n</syntaxhighlight> [[Index|indices]] without replacement. Deal shares the [[glyph]] <syntaxhighlight lang=apl inline>?</syntaxhighlight> with the monadic scalar function [[Roll]]. | ||
== Examples == | == Examples == |
edit