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.

Finite categorical sampling by inverse CDF and binary search

Definition

Input a nonempty finite list of outcomes 1,…,r (r≥1) with probabilities pi≥0 and ∑i=1rpi=1, and either an ideal bit-stream uniform U∈[0,1] as in Disjoint streams of independent fair bits produce independent uniform variables or a b-bit midpoint Ub∈(0,1) as in Midpoint bit discretization has bounded coupling and CDF error. Write v for the supplied input. Let C0=0 and Ci=∑j=1ipj.

  1. If v=0, return outcome 1. This assigns the ideal uniform's null zero-endpoint event an explicit value.
  2. Otherwise initialize integer bounds L=1, H=r. While L<H, set j=⌊(L+H)/2⌋. If v≤Cj, set H=j; otherwise set L=j+1.
  3. When L=H, return outcome L.

Thus on positive inputs the intended output is the least index with v≤Ci, including equality at a cumulative threshold. For 0<U<1, this is the generalized inverse of the step CDF F(i)=Ci by Generalized inverse sublevel identity for a CDF. At v=1, the same least-index rule specifies the endpoint extension min⁡{i:Ci=1}; this set contains r. The midpoint and ideal-input law and binary-search properties are proved separately.

Remarks

With ideal U, this is exact finite categorical inversion. Midpoint input has a discrete law; its threshold counts, rather than total-variation closeness to a continuous uniform law, control its categorical error.

Depends on

Used by

Dependency tree · two levels

19 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