Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^4: Obtaining terms in an expansionby pKai (Priest) |
on Jan 06, 2006 at 19:34 UTC ( [id://521606]=note: print w/replies, xml ) | Need Help?? |
Thank you, for pointing me to the "factorial" Also, would you be able to give example code for the subset iteration with Math::Combinatorics? If there is an easy way to do so, it has escaped me. The closest I saw in the docs was that example to generate: Now Morse signals of length 3 are surely one-to-one and onto the subsets of a 3 element set (set elements = pos in signal; element not/contained = dot/dash) The given iteration using next_multiset and next_string is like computing 2**n as sumk=0..n nCk At least this is not trivial application of the modules methods.
In Section
Seekers of Perl Wisdom
|
|