Atelier des rouesLab FR
Objects/Documentation

profils19.py

Incomparable experiments with matching survival · profils19.py

Download ↓
"""Finite binary experiments with identical one- and two-site survival. Python stdlib."""
from fractions import Fraction as F
from math import comb, prod, isqrt
import json

U=1<<128
ALPHA=(F(1,5),F(2,5),F(7,10))


def calculate(n):
    def poly(z,eps):
        return prod(1-a*z for a in ALPHA)+eps*z*(z-F(1,n))*(z-F(2,n))
    eps=F(1,1000)
    brackets=[1,F(19,10),F(7,2),10]
    assert all(poly(a,eps)*poly(b,eps)<0 for a,b in zip(brackets,brackets[1:]))
    u=poly(F(1,n),0)

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.