**Date:** Sat, 17 Sep 2005 23:14:13 -0400
**Reply-To:** Richard Ristow <wrristow@mindspring.com>
**Sender:** "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
**From:** Richard Ristow <wrristow@mindspring.com>
**Subject:** Re: all combinations possible
**In-Reply-To:** <6.1.0.6.0.20050917223213.02632840@pop.tiscali.it>
**Content-Type:** text/plain; charset="us-ascii"; format=flowed
This doesn't answer the question, but perhaps will help clarify it.

At 04:40 PM 9/17/2005, Arnaldo Ferrari Nasi wrote:

>I have 8 or more alphanumeric figures, i.e. A B C D E E A F, I want
>all the combinations possible between them.
>
>A B C D E E A F
>B C D E E A F A
>C D E E A F A B

It looks like you're looking for the *permutations*; that is, all
possible orders for the symbols, including all symbols each time. It's
worth saying this, because in this context, "combinations" is a
technical term with a different meaning, and could confuse

>I think is simple... if you know how.

I don't know how simple it is. I think there are a number of standard
algorithms, but the only one I can think of off the top of my head is a
recursive algorithm -- the program calls itself -- and that's very
awkward to simulate in SPSS.

It would occur to me to Google for "permutation algorithm". Or, if
possible, to ask a computer science faculty member for an algorithm, or
references.

You have some repeating elements, so it's not regular permutations,
it's permutations with certain elements indistinguishable. I don't know
how much that complicates the algorithms for enumerating them.