On 2011-11-16, at 00:32 , Lisette Brillemans wrote: > Hello everybody! > > Is there a function in GAP that returns all possible pairs of disjoint > combinations of a (subset of a) list?
There isn't a single function, but you can easily build one. Essentially two nested for-loops. A short way to do this is s := [1..5]; Concatenation (List (Combinations (s), t -> List (Combinations(Difference (s,t)), u -> [t, u]))); or, if you don't want to allow the empty set, Concatenation (List (Filtered (Combinations (s), t -> not IsEmpty(t)), t -> List (Filtered (Combinations(Difference (s,t)), u -> not IsEmpty(u)), u -> [t, u]))); Cheers Burkhard. _______________________________________________ Forum mailing list Forum@mail.gap-system.org http://mail.gap-system.org/mailman/listinfo/forum