Atom - ŒP - Powerset

Characters: Π, P

Tags: miscellaneous , math , array , combinatorics

Arity: monadic

This atom is monadic, which means it takes one argument.


Powerset (all subsets, including the empty subset, of z in increasing order of length and then lexicographical ordering).


The result will be a list of size 2len(z) containing all subsets (not necessarily contiguous) of z. They are first ordered by length and then by lexicographical order, so 3R ŒP returns [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]].