bernoulli_word
std.stats.bernoulli_word · Level L2The probability that an IID Bernoulli(p) sequence begins with a given finite 0/1 word: p^(number of 1s)·(1 − p)^(number of 0s), the cylinder probability of the product law. A finite prefix defines a finite IID family; it does not by itself establish an infinite IID sequence.
Signature
bernoulli_word(w: f64[m], prob: f64[]) → f64[]
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.
- Equal to the reference
the product of p and 1 − p over the wordin exact rational arithmetic, on all 40 test cases. - All 40 float64 results inside the running error bound; the closest uses 72% of it.
- Interpreter and NumPy backend return bit-identical results.
- At float32 too: the 40 test cases rounded to float32, and 40 of them inside the running error bound at u = 2⁻²⁴; the closest uses 70% of it.
- correctly rounded (the float64 nearest the exact value)
- 75%
- bit-equal to the NumPy formula in float64
- 100%
- largest error, in units in the last place
- 1.47
Identity
sha256:bf53c3d0c57e3342c8a34983e0696f4257c76a665b46d860bff5bed70d6b9fffThe semantic hash of the graph. It changes when the program changes, and never when only its documentation does.
Control handle
- Symbol
- Ω:std.stats.bernoulli_word · Ω:bernoulli_word
- Pins
sha256:9f70cf5df818a4ddca1572f48ea7e45ac4bc0b38134e3becad788f4ab23d71fethis graph and the 1 it reaches through calls- Evidence
sha256:7444788fa99e9789887ca152d3f0525e10fdd6b20fcbc30f5e749537a8dc056cthe 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.