MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Combinations

  • To: mathgroup at
  • Subject: [mg49697] Re: [mg49672] Combinations
  • From: János <janos.lobb at>
  • Date: Thu, 29 Jul 2004 07:43:06 -0400 (EDT)
  • References: <>
  • Sender: owner-wri-mathgroup at

With Outer you need a function as the first parameter.  Being a newbie 
I would go with:

Flatten[Outer[List, {a, b, c}, {a, b, c}, {a, b, c}], 2]


P.S.  Look back on the list for any postings to "All combinations" from 
April this year.  Here is what I got back from Andrzej Kozlowski


pretty comprehensive and deep.

On Jul 27, 2004, at 7:00 AM, Gregory Lypny wrote:

> Hello everyone,
> Does Mathematica have a built-in function that will generate a simple
> list all possible combinations of a list of strings?  For example,
> {a,b,c}, where the elements are strings, should give 3x3=27 triplets of
> "aaa", "aba", etc.
> I tried
> In[4]:=Outer[{a,b,c},{a,b,c},{a,b,c}]
> but I get
> {{{a, b, c}[a, a], {a, b, c}[a, b], {
>      a, b, c}[a, c]}, {{a, b, c}[b, a], {a, b, c}[b, b], {a, b,
>        c}[b, c]}, {{a, b, c}[c, a], {a, b, c}[c, b], {a, b, c}[c, c]}}
> which is going to be difficult to match with my data using BinCounts
> and the like.
> 	Regards,
> 		Greg
"..because Annushka has already bought sunflower oil, and not only 
bought it, but spilled it too."
Bulgakov:  Master and Margarita

  • References:
    • Combinations
      • From: Gregory Lypny <>
  • Prev by Date: Re: Using "Sum" (i = 1 ... N) in a function definition
  • Next by Date: Re: Re: DeleteCases : several at once, conditions
  • Previous by thread: Re: Combinations
  • Next by thread: Re: Combinations