bernoulli_word

std.stats.bernoulli_word · Level L2

The 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.

P(w) = p^#1 (1 − p)^#0

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.

wf64[m]probf64[]1.0Scan·word_stepRSlicelastReduceSumprob_wprob_wf64[]
  • 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 word in 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.
Accuracy in detail
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

Calls
Called by
—
sha256:bf53c3d0c57e3342c8a34983e0696f4257c76a665b46d860bff5bed70d6b9fff

The 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.

ΣEML 2026

Efficient New Language — a high-density semantic overlay for humans and AI agents.

This site’s demos run on the real EML toolchain, in your browser.

© 2026 EveMissLab (一言諾科技有限公司) / Neo.K. All rights reserved.