MathGroup Archive 2004

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

Search the Archive

Re: Combinations

  • To: mathgroup at
  • Subject: [mg49731] Re: Combinations
  • From: "Steve Luttrell" <steve_usenet at>
  • Date: Thu, 29 Jul 2004 07:45:36 -0400 (EDT)
  • References: <ce5dk5$b87$>
  • Sender: owner-wri-mathgroup at

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


Steve Luttrell

"Gregory Lypny" <gregory.lypny at> wrote in message
news:ce5dk5$b87$1 at
> 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

  • Prev by Date: RE: Combinations
  • Next by Date: Re: Q: extract all k-tuple from a list of n elements
  • Previous by thread: RE: Combinations
  • Next by thread: Re: RE: Combinations