ruby implementation for finding the powerset of set.