MathGroup Archive 2001

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

Search the Archive

Matrix of possible combinations of N elements

I have N elements and want to make a matrix of all possible combinations.

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: ComplexExpand & ExpIntegralEi
  • Next by Date: Fit[]: how to obtain the parameter values?
  • Previous by thread: Re: ComplexExpand & ExpIntegralEi
  • Next by thread: Re: Matrix of possible combinations of N elements