Combinations and permutations: Difference between revisions
Content deleted Content added
→{{header|Perl 6}}: rephrasing + not using the Gamma name |
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) / ( |
self.permutation(k) / (1 .. k).inject(1, :*) |
||
end |
end |
||