MathGroup Archive 2002

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

Search the Archive

Re: I NEED HELP WITH THIS

  • To: mathgroup at smc.vnet.net
  • Subject: [mg35246] Re: [mg35208] I NEED HELP WITH THIS
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Wed, 3 Jul 2002 05:16:04 -0400 (EDT)
  • References: <200207020612.CAA22319@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

One immediate possibility, though it could be improved, is as follows.
First, I assume that your slashes, as in a1-a2, actually mean some sort of
link, like in {a1, a2}, and not a minus sign. Then, first construct your
elements properly:

In[1]:=
let = ToString /@ {a, b, c, d, e, f, g, h, i, j, k, l,
    m, n, o}
Out[1]=
{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k",
  "l", "m", "n", "o"}

In[2]:=
num = ToString /@ {1, 2}
Out[2]=
{"1", "2"}

In[3]:=
pairs = Outer[StringJoin, let, num]
Out[3]=
{{"a1", "a2"}, {"b1", "b2"}, {"c1", "c2"}, {"d1", "d2"},
  {"e1", "e2"}, {"f1", "f2"}, {"g1", "g2"},
  {"h1", "h2"}, {"i1", "i2"}, {"j1", "j2"},
  {"k1", "k2"}, {"l1", "l2"}, {"m1", "m2"},
  {"n1", "n2"}, {"o1", "o2"}}

In[4]:=
elem = Flatten[pairs]
Out[4]=
{"a1", "a2", "b1", "b2", "c1", "c2", "d1", "d2", "e1",
  "e2", "f1", "f2", "g1", "g2", "h1", "h2", "i1", "i2",
  "j1", "j2", "k1", "k2", "l1", "l2", "m1", "m2", "n1",
  "n2", "o1", "o2"}

Then you get your triplets using

In[5]:=
Select[Partition[Flatten[Outer[List, pairs, elem, 1]],
   3], #1[[1]] != #1[[2]] != #1[[3]] & ]

(output omitted).

Tomas Garza
Mexico City
----- Original Message -----
From: "Said Neder" <neder at dominicanrepublic.com>
To: mathgroup at smc.vnet.net
Subject: [mg35246] [mg35208] I NEED HELP WITH THIS


> Im developing some project and i need advice from
> mathematics experienced dudes... please let me know.  ... this is the
issue:
>
> i have   30 variables connected in pairs.. so i have 15 pairs .. some
thing
> like:
>
> a1-a2 , b1-b2, c1-c2, d1-d2, e1-e2, f1-f2, g1-g2, h1-h2, i1-i2, j1-j2,
> k1-k2, l1-l2,m1-m2,n1-n2,oi-o2
>
> i need to generete as many 3 variables chains posibilities without
repeating
> variables or including variables of
> same pair.
>
> some thing  like
>
> a1-b1-c1
>
>
> any one has any idea?.. i need a formula for that.. i know this might be
> easy for experienced mathematicians
>
>



  • Prev by Date: Re: Question about yet another bug in Sum
  • Next by Date: Re: non integer exponents in ContourPlot[]?
  • Previous by thread: I NEED HELP WITH THIS
  • Next by thread: non integer exponents in ContourPlot[]?