With 435 zeroes and 343 ones, you'll never live long enough to see it finish, regardless of the method used to generate the sequence. A simple way to figure out how many permutations a list will generate is with
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");'
A list with 453 zeros and 343 ones will have roughly 1.962e230 different permutations -- are you
sure you need all of them?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.