Alphabeta Math
ExampleConstruction: AI-generatedVerification: AI-generatedPipeline-generatedprecheck passjudge pass (gpt-6-luna)
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.

Fisher's exact test from two Bernoulli samples

Example

Take two independent Bernoulli samples of sizes n1,n2≥1 and test the one-sided alternative that the first success probability exceeds the second. Under the null, all N=n1+n2 trials have a common success probability p∈[0,1]. Let K be the number of successes in the first sample and S the total number in both samples. For every integer margin s∈{0,…,N}, define the supplied conditional-law kernel Q by Q(s,{k})=(n1k)(n2s−k)(Ns),max⁡(0,s−n2)≤k≤min⁡(n1,s), and set Q(s,{k})=0 outside the displayed range. For each s, these weights sum to one because they count all (Ns) ways to choose the s success positions according to how many lie in the first sample. At margins of positive probability this is the conditional law and it does not depend on p; at endpoint nulls p=0,1, the formula also supplies a version at the other, probability-zero margins. Large values of K support the one-sided alternative that the first sample has a larger success probability. For n1=n2=2 and s=2, the conditional masses at k=0,1,2 are 1/6,4/6,1/6; the inclusive upper-tail p-values are 1,5/6,1/6.

Facts & Assumptions

Given: Positive integers n1,n2, the null product Bernoulli model with common parameter p, the statistic K conditioned on S, the supplied kernel Q defined for every margin in the Example, and an auxiliary U∼Unif⁡[0,1] independent of all trials.

[F1]

A product of finite probability spaces assigns a sequence the product of its coordinate weights. The finite product of finite probability spaces

[F3]

For an event of positive probability, conditional probability is the ratio of the joint event probability to the conditioning-event probability. Conditional probability P(A∣B) for P(B)>0

[F4]

The nonrandomized conditional upper-tail value uses the inclusive tail; the randomized value uses the strict tail plus an independent uniform fraction of the tie mass. Randomized conditional upper-tail p-values

[F5]

For each fixed null value p, under the supplied kernel the randomized upper-tail value is conditionally uniform and the inclusive value is conditionally superuniform. Randomized conditional p-values are uniform

[F6]

A test has unconditional size equal to the supremum of its null rejection expectations; conditional level at most α implies unconditional level at most α. Test size and power, Conditional level implies unconditional level

Verification

1.1F1F2givenalgebra

Write Ω={0,1}N and give each coordinate the two-point Bernoulli(p) law. By [F1], a sequence with s ones has weight ps(1−p)N−s; the product weights sum to (p+(1−p))N=1, and [F2] gives the independent-trial model. For 0<p<1, every sequence with S=s has the same positive weight.

2.1F1F3step 1.1givenconstructalgebra

There are (Ns) sequences with s successes. Exactly (n1k)(n2s−k) of them have K=k: choose k of the first n1 positions and s−k of the other n2. These counts partition all size-s subsets, so the displayed kernel weights sum to one for every s, and when Pp(S=s)>0, dividing by the total count using [F3] gives the conditional mass; the feasible range is precisely where both binomial coefficients are nonzero. At p=0 only S=0 occurs and K=0; at p=1 only S=N occurs and K=n1, so the supplied kernel has the required conditional law on the realized margin. At the other, probability-zero margins the same formula is simply the chosen kernel extension.

3.1F3F4step 2.1givenalgebra

For n1=n2=2 and s=2, the feasible values are k=0,1,2, with counts 1,4,1 among the six two-success sequences. Their probabilities are therefore 1/6,4/6,1/6. Summing the masses at or above each observed value gives inclusive p-values 1,5/6,1/6. The strict-tail-plus-tie formulas are respectively 5/6+U/6, 1/6+2U/3, and U/6; their intervals [5/6,1], [1/6,5/6], and [0,1/6] have lengths matching the three conditional masses.

4.1F3F5F6step 2.1step 3.1given∎

For each margin s with Pp(S=s)>0, [F5] makes the nonrandomized p-value conditionally superuniform and the randomized value conditionally uniform under the null. Rejecting when the nonrandomized value is at most α is therefore a conditional level-α test, so [F6] gives unconditional size at most α. The test function of the randomized rule is φα(x)=PU(pU(x,U)≤α); it is measurable because the sample space is finite. By finite conditioning and independence of U, Ep[φα(X)∣S=s]=Pp(pU≤α∣S=s)=α, so the randomized rule has conditional and unconditional size exactly α. At p=0 and p=1 the only observed margin has a degenerate conditional law; its inclusive value is 1 and its randomized value is U, so the same validity conclusions hold.

Depends on

Used by

Nothing in the library uses this result yet.

Dependency tree · two levels

40 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