[GAP Forum] Combination of n objects taken r at a time

Joe Bohanon jbohanon2 at gmail.com
Sat Apr 18 23:43:46 BST 2009


Try:

Combinations(list,n);

Joe

Levie Bicua wrote:
> Dear forum,
> Suppose I have a list of n objects and from this I want to get a new list whose elements are
> the combinations of n objects taken r at a time. How will I be able to use gap for this?
> Specifically, let S:=[(1,2), (1,3),(2,3)]. If I want to get a list of combinations of these 3
> elements taken 2 at a time I must obtain the set T:=[ [(1,2),(1,3)], [(1,3),(2,3)], [(1,2),(2,3)]].
> Of course for a larger set it's not easy to do this. Any help? thanks.
>  
> Levi
>
>
>       
> _______________________________________________
> Forum mailing list
> Forum at mail.gap-system.org
> http://mail.gap-system.org/mailman/listinfo/forum
>
>   



More information about the Forum mailing list