Objets/Documentation
profils19.py
Deux expériences incomparables de mêmes survies · profils19.py
Télécharger ↓"""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)