Alphabeta Math
AlgorithmAlgorithm: Literature-sourcedProof: Not applicablePipeline-generated
How statement and proof provenance work

The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.

  • Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
  • AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
  • AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.

These labels describe origin, not correctness: citations and verification chips remain separate evidence.

Unbiased rational Bernoulli sampling by bit rejection

Definition

Input integers n≥1 and 0≤m≤n, a stream of independent fair bits as in Disjoint streams of independent fair bits produce independent uniform variables, and an optional positive integer attempt cap Mmax⁡ (or Mmax⁡=∞). If m=0, return 0 without reading bits; if m=n, return 1 without reading bits. Otherwise let k be the least nonnegative integer with N=2k≥n. For each attempt, read a fresh non-overlapping block of k bits and interpret it as a uniform integer R∈{0,…,N−1}. If R≥n, reject the block and start another attempt. If R<n, return 1 when R<m and 0 otherwise. If a finite cap is reached before an accepted block, return status inconclusive and no Bernoulli value.

Remarks

The finite-cap branch is not a sample with a substituted default value. Its success law and failure probability are proved separately. The algorithm assumes independent fair-bit blocks; an LCG or keyed deterministic stream does not satisfy that premise by definition.

Depends on

Used by

Dependency tree · two levels

13 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.

Sources