Atelier des rouesLab FR
Objects/Documentation

lecteurs21.py

I provide the code for this study. The exact cost of an undated alarm

Download ↓
"""Nested alarms read from the first seeded XXVII system. Exact distributions."""
from fractions import Fraction as F
from math import prod,comb
import json
from deficience21 import certificate,tv,push,bounds


def study():
    n=9;risks=[F(1,10),F(1,45),F(1,15),F(1,10)]
    # Bins: quiet through 3, first death by step 1, first death at step 2 or 3.
    def bins(no1,no3):return [no3,1-no1,no1-no3]
    q=bins((1-risks[0])**n,prod(1-b for b in risks[:3])**n)
    p=bins(1-n*risks[0],prod(1-n*b for b in risks[:3]))
    # Independent forward propagation of the death count and first alarm.
    def forward(exclusive):
        states={(0,0):F(1)}

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.