Atelier des rouesLab FR
Objects/Documentation

fusion16.py

I compute the profiles and the retention fractions attained by the two schedules.

Download ↓
"""Reproduce the Gaussian boundary example. Standard library, Python 3.9+."""
import json
from fractions import Fraction as F
from itertools import product
from math import comb, erf, exp, expm1, fsum, log1p, prod, sqrt


ORDERS = {"like": "HHLL", "mixed": "LHLH"}


def block(steps):
    total = sum(steps, F())
    squares = sum((p * p for p in steps), F())
    survival = prod((1 - p for p in steps), start=F(1))
    return total, squares, survival

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.