Godtone
Joined 17 December 2020
m →My Python 3 code: corrections |
m →My Python 3 code: added powerset function |
||
| Line 645: | Line 645: | ||
else: # 1/1 is in all subgroups | else: # 1/1 is in all subgroups | ||
return True | return True | ||
def powerset(s): | |||
pset = set() | |||
for i in range(1 << len(s)): | |||
pset |= {frozenset([ s[j] for j in range(len(s)) if (i & (1<<j)) ])} | |||
return pset | |||
# how to make a list of inconsistently-mapped intervals from ivs | # how to make a list of inconsistently-mapped intervals from ivs | ||
# according to a val map v where "inconsistent" is usually defined as | # according to a val map v where "inconsistent" is usually defined as | ||