Does anyone have any code for doing combinations in VB.net or visual
basic ? I'd like to
be able to get an array of combinations (not permutations) of words from a
base group of words while specifying the number of unique words to be used
in the result set.
For instance if I have the set {cat dog fish snake} I'd like to be able
to get back a result array of all possible combinations (not permutations)
of X number of words from my base set. For example, all possible
combinations of any 3 words from the base set above would be :
{cat dog fish}
{cat dog snake}
{cat fish snake}
{dog fish snake}
Ideally, I would like to be able to get a result array back with Y known
words in it. For example, if I wanted all possible combinations of any 3
words from the base set above again, but this time I only wanted resulting
arrays that contained the words cat and snake the resulting array should
look like:
{cat dog snake}
{cat fish snake}
Anybody seen this code or at least the mathematical formulas needed to
implement it?
Thanks!
basic ? I'd like to
be able to get an array of combinations (not permutations) of words from a
base group of words while specifying the number of unique words to be used
in the result set.
For instance if I have the set {cat dog fish snake} I'd like to be able
to get back a result array of all possible combinations (not permutations)
of X number of words from my base set. For example, all possible
combinations of any 3 words from the base set above would be :
{cat dog fish}
{cat dog snake}
{cat fish snake}
{dog fish snake}
Ideally, I would like to be able to get a result array back with Y known
words in it. For example, if I wanted all possible combinations of any 3
words from the base set above again, but this time I only wanted resulting
arrays that contained the words cat and snake the resulting array should
look like:
{cat dog snake}
{cat fish snake}
Anybody seen this code or at least the mathematical formulas needed to
implement it?
Thanks!
Comment