subsets

subsets(n,j) -- for an integer n, yields a list of those subsets of {0, ..., n-1} which have j elements.
subsets(s,j) -- yields a list of those subsets of the list or set s which have j elements.

In the case where s is a list, the subsets are returned as lists whose elements are in the same order.

     i1 = subsets(set {a,b,c},2)
     
     o1 = {set {a, b},set {a, c},set {b, c}}
     
     o1 : List
     
     i2 = subsets(3,2)
     
     o2 = {{0,1},{0,2},{1,2}}
     
     o2 : List
     

Go to main index.

Go to concepts index.