Atelier des rouesLab FR
Objects/Documentation

commun23.py

Three-law decisions · commun23.py

Download ↓
"""Three-law reconstruction with an exactly simulable anchor pair."""
from fractions import Fraction as F
from itertools import combinations
from random import Random
import json
from cellules22 import experiment
from deficience21 import certificate, tv, push
from verifier21 import check


def hockey(q,p,w):
    return sum(max(F(0),x-w*y) for x,y in zip(q,p))


def knots(*pairs):
    return sorted({F(0)}|{x/y for law,ref in pairs for x,y in zip(law,ref) if y})

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.