in reply to Re^4: One Zero variants_without_repetition
in thread One Zero variants_without_repetition
A list with 453 zeros and 343 ones will have roughly 1.962e230 different permutations -- are you sure you need all of them?my $num_zeros = 3; my $num_ones = 2; use Math::BigInt; sub fac { my $result = Math::BigInt->new("1"); my $n = Math::BigInt->new(shift()); while($n){ $result *= $n--; } return $result; } my $num_permutations = fac($num_ones + $num_zeros ) / (fac($num_ones) +* fac($num_zeros)); print("Number of permutations of a ($num_zeros, $num_ones) list is $nu +m_permutations\n");'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: One Zero variants_without_repetition (logue)
by tye (Sage) on Aug 08, 2007 at 05:58 UTC |