Re: Matrix of possible combinations of N elements

*To*: mathgroup at smc.vnet.net*Subject*: [mg31895] Re: Matrix of possible combinations of N elements*From*: atelesforos at hotmail.com (Orestis Vantzos)*Date*: Mon, 10 Dec 2001 06:14:35 -0500 (EST)*References*: <200112051151.GAA06760@smc.vnet.net> <9uq9pd$afj$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

It does pay to be more specific (and true to mathematical notation), when asking mathematical questions. Anyway, if what you realy want is the 'combinations of the set {A,B,C,D}', here they are: In[29]:= 4 Module[{indices = IntegerDigits[Range[0, 4 ], 4]}, combinations = Union[Union /@ indices] + 1; ({A, B, C, D}[[#1]] & ) /@ combinations] Out[29]= {{A}, {B}, {C}, {D}, {A, B}, {A, C}, {A, D}, {B, C}, {B, D}, {C, D}, {A, B, C}, {A, B, D}, {A, C, D}, {B, C, D}, {A, B, C, D}} Combinations of a set are all the ways in which someone can take some elements and drop others, whereas Permutations are all the ways in which someone can 'shuffle' a given set, changing the order of its elements. Orestis

**References**:**Matrix of possible combinations of N elements***From:*"Per Schjetne" <per.schjetne@dmhuset.no>