MathGroup Archive 2001

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

Search the Archive

Re: Matrix of possible combinations of N elements

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31856] Re: [mg31830] Matrix of possible combinations of N elements
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Fri, 7 Dec 2001 05:56:52 -0500 (EST)
  • References: <200112051151.GAA06760@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Do you mean this?

In[1]:=
Permutations[{a,b,c,d}]
Out[1]=
{{a,b,c,d},{a,b,d,c},{a,c,b,d},{a,c,d,b},{a,d,b,c},{a,d,c,b},{b,a,c,d},{b,a,
d,
    c},{b,c,a,d},{b,c,d,a},{b,d,a,c},{b,d,c,a},{c,a,b,d},{c,a,d,b},{c,b,a,
    d},{c,b,d,a},{c,d,a,b},{c,d,b,a},{d,a,b,c},{d,a,c,b},{d,b,a,c},{d,b,c,
    a},{d,c,a,b},{d,c,b,a}}

Tomas Garza
Mexico City

----- Original Message -----
From: "Per Schjetne" <per.schjetne at dmhuset.no>
To: mathgroup at smc.vnet.net
Subject: [mg31856] [mg31830] Matrix of possible combinations of N elements


> I have N elements and want to make a matrix of all possible combinations.
> Example:
>
> A, B, C, D -> 4 elements
> Combinations with 2 similar characters are not allowed (AAAA, AABB etc)
> So that gives me 4*3*2*1=24 unique combinations
> I have no problem writing all the combinations down, but I find it hard to
> make a general function/algorithm in VB for generating matrix of any
number
> of elements.
>
> I know this is a common problem and instead of using days on this problem
I
> ask you gurus here!
>
> Per :-)
>
>
>
>
>
>
>
>



  • Prev by Date: Trouble with Splice for Java (i.e. there is no JForm)
  • Next by Date: Re: Matrix of possible combinations of N elements
  • Previous by thread: Matrix of possible combinations of N elements
  • Next by thread: Re: Matrix of possible combinations of N elements