I've searched through this site trying to find code to generate all combination arrays (of length n) from some other array (call it the pool array) that the combination arrays are picking from. I've found many that give all combinations equal to the size of the array (i.e. (pool array size)! many of them... that's the factorial of the pool array size)). But this isn't what im looking for. Rather, I want to generate a list of combination arrays of length smaller or equal to that of the pool array. Basically, list the actual combination arrays that yield in number nCr (for you math people) I'd would love any code for this, since i for some reason can't come up with an effective and correct alg. Thanks, Pseudosig

In reply to Combinations... again by pseudosig

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.