solvers.ZeroFailureModel
solvers.ZeroFailureModel()Upper bound on the per-trial failure rate after a failure-free campaign.
Poisson (rule of three): p_upper = -ln(1 - C) / n
exact binomial: p_upper = 1 - (1 - C)^(1/n)
With target_rate, also the clean trials that bound the rate at the target: ceil(ln(1 - C) / ln(1 - target)), and its rule-of-three estimate -ln(1 - C) / target (exact form and target added 2026-10-20).
Methods
| Name | Description |
|---|---|
| solve | Upper bound on the per-trial failure rate after a failure-free campaign. |
solve
solvers.ZeroFailureModel.solve(trials, confidence, target_rate=None)Upper bound on the per-trial failure rate after a failure-free campaign.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| trials | int | Positive number of independent failure-free trials. | required |
| confidence | float | One-sided confidence level in (0, 1). | required |
| target_rate | Optional[float] | Optional target per-trial failure probability in (0, 1). | None |
Returns
| Name | Type | Description |
|---|---|---|
| ZeroFailureResult | Dimensionless approximate/exact failure bounds and trial counts; optional target counts are None when no target is supplied. |
Notes
Equation: For n trials and confidence C, approximate upper failure probability is -ln(1-C)/n; exact upper probability is 1-(1-C)^(1/n). A target p requires ceil(ln(1-C)/ln(1-p)) failure-free trials.
Assumptions: Independent identically distributed Bernoulli trials; approximate rate uses the zero-event Poisson bound.
Excludes: Nonstationarity, correlated failures, and proof of absence of failures.
References
Derivation: For independent Bernoulli trials, the probability of zero failures is (1-p)^n. Invert this probability at tail mass 1-C to obtain the exact one-sided bound. Replacing ln(1-p) by -p yields the Poisson approximation; see mlsysim.physics.robotics.assurance.calc_zero_failure_sample_size.
Examples
>>> from mlsysim.core.units import Q_ as Q
>>> ZeroFailureModel().solve(100, 0.95).rate_upper_exact < 1
True