binomial_quantile
std.stats.binomial_quantile · Level L5The binomial distribution's quantile for n trials with success probability π: the smallest k in [0, n] with P(K ≤ k) ≥ p. A bisection on whole numbers (a While over binomial_quantile_step) from [0, n].
Signature
binomial_quantile(p: f64[n], trials: i64[], prob: f64[]) → i64[n]
Structure
The function as NOVA stores it: one box per input, operation and output, and arrows that carry values. A double border marks another library function this one runs — called once, or by Scan once per element; select it to open that function.
- input
- operation
- constant
- call
- output
Verification
- Signature proven by NOVA’s shape solver, for every size.
- Agrees with the reference
k = 0; while Σ_{j≤k} C(n, j)·πʲ·(1 − π)ⁿ⁻ʲ < p: k += 1to 80 digits (100-digit arithmetic), on all 40 test cases. - All 143 int64 results are exact: the error is zero.
- Interpreter and NumPy backend return bit-identical results.
- correctly rounded (the int64 nearest the exact value)
- 100%
- bit-equal to the NumPy formula in int64
- 100%
- largest error, in units in the last place
- 0
Note
The reference adds the binomial probabilities one by one until they reach p, so neither the incomplete beta function nor the bisection checks itself. The answer is exact unless p lies within the CDF's own error of F(k); the verification bounds that case.
Identity
sha256:23310666340a513d3b59e2ab41fd21430bdac438b2c3cd2b77484ed12747eef7The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.
Control handle
- Symbol
- Ω:std.stats.binomial_quantile · Ω:binomial_quantile
- Pins
sha256:7369e82749175a2c3897694d32d69fa9e07205ecf18194ec572f81fda7198d8fthis graph and the 2 it reaches through calls- Evidence
sha256:bec27c88434f73d9737e3d782f0b41bb6b8139f6410a5b627ed1e7e3aefe8e38the hash of its verification record- Needs
- no capability: a pure function
Through NOVA’s control layer, the symbol launches this function only while the program still matches what it pins: a change to this graph, or to any graph it reaches, needs a migration first.