in reply to Manipulating Arrays

webchalkboard,
Ok, you speak of combinations and of permutations. They are not the same thing. In a nutshell, a combination doesn't not consider a group of elements different if the only thing that changes is the position while a permutation does. So do you want combinations or permutations?

Additionally, it looks like you want both a fixed size (you mention 2 word phrases and then 4 word long phrases) and a fixed total (50). Do you have unspoken requirements - if so what are they.

I have code (and so do other monks and CPAN) that does combinations, permutations, fixed size groupings, etc. I need more information before I can recommend one of them.

Cheers - L~R

Update: I did have a double negative pointed out by AM below. The correction is to strike one of them as order doesn't matter in combinations. The attempted correction by AM is incorrect.

Replies are listed 'Best First'.
Re^2: Manipulating Arrays
by Anonymous Monk on Aug 11, 2005 at 15:45 UTC
    a combination doesn't not consider a group of elements different if the only thing that changes is the position while a permutation does

    Confusion alert! Confusion alert! That sentence is extremely hard to understand, even though I know what you're trying to say. I think one of the most egregious problems is the double negative, doesn't not. For the sake of others, I'll try to translate:

    The ordering of the elements matters for a combination, but doesn't matter for a permutation.