[GAP Forum] subsets

Stefan Kohl stefan at mcs.st-and.ac.uk
Wed Oct 24 10:39:30 BST 2012


Dear Forum,

Abdulsatar Al-Juburie asked:

> Let X be a finite set and let x be a fixed element of X.
> Is there any function in GAP that generates all subsets of X that contains x.

Provided that the set X is small enough such that the desired list
of subsets fits into the memory of the computer, the following statement
will do what you want:

List(Combinations(Difference(X,[x])),Y->Union(Y,[x]));

Hope this helps,

    Stefan Kohl





More information about the Forum mailing list