Objects/Documentation
pondere24.py
I recompute the depletion, survival and bit-cost examples.
Download ↓"""Independent spot checks of the depletion, moment and coding examples."""
import json
from math import comb, exp, expm1, log, log1p, log2, prod, sqrt
from fractions import Fraction as F
def late_profile(n):
# The elementary early prefix can have far more steps than a loop can visit.
step = n ** -3
count = round((-log(n) / 4) / log1p(-step))
q0 = exp(count * log1p(-step))
late = int(8 * sqrt(n))
b = .5 / n
weight = comb(n, 2) * q0 ** 2 * b ** 2 * expm1(2 * late * log1p(-b)) / expm1(2 * log1p(-b))
return dict(N=n, q0=round(q0, 12), late_mass=round(weight, 12),
canonical_late_affinity=round(exp(-weight / 2), 12))