Combinations and permutations: Difference between revisions

Content deleted Content added
Grondilu (talk | contribs)
→‎{{header|Perl 6}}: rephrasing + not using the Gamma name
Steenslag (talk | contribs)
m →‎{{header|Ruby}}: prevent (2..1) is not a valid range error.
Line 529: Line 529:


def combination(k)
def combination(k)
self.permutation(k) / (2 .. k).inject(1, :*)
self.permutation(k) / (1 .. k).inject(1, :*)
end
end