Worked examples: HAVING provenance and probability on a three-occurrence group #
Two fully computed examples on a group with three occurrences.
SUM(a) ≥ 5collapse in𝔹[X]. With attribute valuesa = (3, 2, 2)and annotations the distinct variablesx₁, x₂, x₃, the valid non-empty worlds are{1,2},{1,3}and{1,2,3}, and the possible-world provenance sums their world annotations. Since𝔹[X]is absorptive, this collapses to the⊕-sum over the two minimal valid worlds{1,2}and{1,3}alone (the general statement isHaving.sum_ge_collapse); both sides compute – by kernel evaluation on all2³valuations – tox₁ ∧ (x₂ ∨ x₃).Poisson-binomial
COUNT(*) ≥ 2. With independent contributors of marginalsp₁ = 1/2,p₂ = 1/4,p₃ = 1/3, the point masses computed by the recurrence (HavingProbability.countMass_insert_zero/countMass_insert_succ) areρ₃(2) = 1/4andρ₃(3) = 1/24, and the CDF assembly (HavingProbability.funcProb_count_filter) givesPr[COUNT(*) ≥ 2] = 1/4 + 1/24 = 7/24.
The SUM(a) ≥ 5 collapse in 𝔹[X] #
Attribute values of the three occurrences: a(u₁) = 3, a(u₂) = a(u₃) = 2.
Instances For
Dependency graph
Annotations: the distinct Boolean variables x₁, x₂, x₃ of 𝔹[X].
Equations
Instances For
Dependency graph
Possible-world provenance of SUM(a) ≥ 5: the ⊕-sum of the world
annotations T_U(W) over the valid worlds {1,2}, {1,3}, {1,2,3}
computes to x₁ ∧ (x₂ ∨ x₃).
Dependency graph
Collapse to minimal worlds: the ⊕-sum of the monomials A_V over
the two minimal valid worlds {1,2} and {1,3} computes to the same
x₁ ∧ (x₂ ∨ x₃), as predicted by Having.sum_ge_collapse since 𝔹[X] is
absorptive.
Dependency graph
The Poisson-binomial COUNT(*) ≥ 2 example #
Independent contributor marginals p₁ = 1/2, p₂ = 1/4, p₃ = 1/3.
Equations
- HavingExample.P = { prob := fun (i : Fin 3) => if ↑i = 0 then 1 / 2 else if ↑i = 1 then 1 / 4 else 1 / 3, prob_nonneg := HavingExample.P._proof_1, prob_le_one := HavingExample.P._proof_2 }
Instances For
Dependency graph
Per-contributor variable supports: contributor i depends on xᵢ only.
Equations
- HavingExample.S i = {i}
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Base of the recurrence: over no contributors, the count is 0 with
probability 1.
Dependency graph
Base of the recurrence: over no contributors, a positive count has
probability 0.
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Point mass ρ₃(2) = 1/4: probability that exactly two of the three
contributors are present.
Dependency graph
Point mass ρ₃(3) = 1/24: probability that all three contributors are
present.