Math::Combination_out
use Math::Combination_out; # @words - array for combinatorics; $k - length for combinatorics my @words = qw/a1 b2 c3 d4 e5 f6/; my $k = 4; print "---Combinations without repetition---\n\n"; print combinations_without_repetition(\@words, $k), "\n"; print num_rem(combinations_without_repetition(\@words, $k)), "\n"; my @words = qw/a1 b2 c3/; my $k = 3; print "---Combinations with repetition---\n\n"; print combinations_with_repetition(\@words, $k), "\n"; print num_rem(combinations_with_repetition(\@words, $k)), "\n";
Combinations without/with repetition
combinations_without_repetition, combinations_with_repetition, num_rem
Petar Kaleychev <petar.kaleychev@gmail.com>
Report them to the author
Siegfried Koepf, Fast Combinatorial Algorithms in C, http://www.aconnect.de/friends/editions/computer/combinatoricode_e.html
Math::Counting, Math::Subsets::List, Math::Combinatorics, Algorithm::Combinatorics
Copyright (c) 2014 Petar Kaleychev
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
To install Math::Combination_out, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Combination_out
CPAN shell
perl -MCPAN -e shell install Math::Combination_out
For more information on module installation, please visit the detailed CPAN module installation guide.