Objets/Documentation
pertes11.py
Je fournis cette pièce pour reproduire ou examiner AT.V5.
Télécharger ↓"""Exact common mass under one/two deleted residue classes; product model checks."""
from collections import Counter
from fractions import Fraction as F
from itertools import combinations,product
from math import prod
import json
def kernels(xs,p,h,anchors):
domain=set(range(p))-{a%p for a in anchors}
subsets=list(combinations(sorted(domain),h))
wheel=Counter()
for blocked in subsets:wheel[tuple(x%p not in blocked for x in xs)]+=F(1,len(subsets))
independent={m:prod(1-F(h,p) if v else F(h,p) for v in m) for m in product((False,True),repeat=len(xs))}
return wheel,independent
def variation(a,b):