← Back to archive

Bayes from Counting

Partial quotients, GCD decomposition, and the symmetric learning function on E = I × O

E = I×O
Joint event space
factorization
GCD
Separates common from
differential evidence
rI/rO
GCD bridge forces
Bayes' theorem
Q = λ
Luck = marginal
× conditional

1. The E → N → Q Chain

Every joint event follows a three-step map: identify it, count it, compute the quotient (luck).

E
Joint Event
(i, o) ∈ I × O
N
Count
c(i, o) ∈ N
Q
Quotient (Luck)
λ = N / c(i,o)

At the N level: Counting

StepObjectMeaning
E(i, o)What happened
Nc(i, o)How often
QN/c(i,o) = λHow surprising

At the Q level: Luck Decomposition

ComponentFormula
Qjoint(i,o)N / c(i,o)
QI(i)N / c(i)
Q(o|i)RI(i) / rI(i,o)
gI(i)gcdo c(i,o)
rI(i,o)c(i,o) / gI(i)
Key idea: The partial quotient divides E by a single atomic event i0 (not all of I), yielding a conditional distribution over O scaled by an equivalence class of size c(i0). The reconstruction identity: c(i0, o) = P(o|i0) · c(i0).

2. Interactive Joint Count Table

Edit the counts below and watch the GCD decomposition, partial quotients, conditionals, and Bayes verification update in real time.

Joint Count Table c(i, o)

Click any count to change it. All derived quantities update automatically.

o = x o = y c(i) gI(i) RI(i)
i = a
i = b
c(o)
gO(o)
SO(o)

Row-Reduced Counts rI(i, o) = c(i,o) / gI(i)

o = xo = ygcd check
i = a
i = b

Column-Reduced Counts rO(i, o) = c(i,o) / gO(o)

o = xo = y
i = a
i = b
gcd check

3. GCD Decomposition

Each joint count c(i,o) decomposes two ways: by row GCD and by column GCD. The common evidence (GCD) separates from the differential evidence (reduced counts).

Row Decomposition: c(i,o) = gI(i) × rI(i,o)

Column Decomposition: c(i,o) = gO(o) × rO(i,o)

In log-support: s(i,o) = log2 gI(i) + log2 rI(i,o) = log2 gO(o) + log2 rO(i,o)
Common vs differential evidence: The GCD gI(i) is the part of the log-support shared by ALL outputs given input i -- it tells us about the prevalence of i without distinguishing which output accompanied it. The reduced count rI(i,o) is the irreducible evidence for this specific joint event.

4. Conditionals (GCD-Free)

The conditional probability depends ONLY on reduced counts. The GCD cancels completely:

Proposition: GCD cancels from the conditional
P(o|i) = c(i,o) / c(i) = [gI(i) · rI(i,o)] / [gI(i) · RI(i)] = rI(i,o) / RI(i)

Conditional Probabilities (computed from your counts)

I-side: P(o|i)

P(x|i)P(y|i)
i = a
i = b

O-side: P(i|o)

P(a|o)P(b|o)
o = x
o = y

Marginals

P(a)P(b)P(x)P(y)

5. Bayes as GCD Consistency

The same joint count admits two GCD decompositions. Their consistency IS Bayes' theorem.

GCD Bridge Equation
rI(i,o) / rO(i,o) = gO(o) / gI(i)

GCD Bridge Verification (for each cell)

Bayes' Theorem falls out
P(o|i) / P(i|o) = [rI(i,o)/RI(i)] / [rO(i,o)/SO(o)] = [gO(o)/gI(i)] · [SO(o)/RI(i)] = c(o)/c(i) = P(o)/P(i)

Bayes Verification (for each cell)

What the proof says: Bayes' theorem is the consistency condition between the two partial quotients of E = I × O. Dividing by I = i and dividing by O = o must give compatible conditionals, because they decompose the same joint count. The GCD mediates: the ratio gO(o)/gI(i) converts between the two reduced-count representations.

6. Log-Support Decomposition

The log-support form reveals the symmetry: s(i,o) = log2 gI + log2 rI = log2 gO + log2 rO.

(i,o) s(i,o) log2 gI log2 rI log2 gO log2 rO Bridge check
(a,x)
(a,y)
(b,x)
(b,y)
Log-Bayes Corollary: The asymmetry of the conditionals equals the asymmetry of the priors
s(o|i) - s(i|o) = sO(o) - sI(i)

Log-Support Bar Chart

Each bar shows s(i,o) = log2 c(i,o). The GCD decomposition splits each into common (gold) and differential (green) evidence.

7. Luck Decomposition: Q = Qmarginal × Qconditional

The joint luck λ(i,o) = 1/P(i,o) decomposes into marginal luck and conditional luck. The conditional luck depends only on the reduced counts -- the GCD cancels.

Luck Table

(i,o) Qjoint = N/c(i,o) QI(i) = N/c(i) Q(o|i) = RI/rI QO(o) = N/c(o) Q(i|o) = SO/rO

Luck Ratio Check: Q(o|i)/Q(i|o) = P(i)/P(o) = c(i)/c(o)

Luck is relative: The same event has different luck from different conditioning directions, balanced by the priors. Q(o|i)/Q(i|o) = P(i)/P(o). An event that is "lucky" from one direction is "ordinary" from the other.

8. Why Correlation Captures Causation

The log contingency table Mio = log2 c(i,o) is a single matrix that encodes BOTH directions. The same counts encode the causal direction (I → O) and the evidential direction (O → I). No additional data is needed to reverse the direction.

Pointwise Mutual Information (PMI)

PMI(i,o) = log2[c(i,o)·N / (c(i)·c(o))]. Positive = more association than independence predicts. PMI is symmetric in its role: it measures correlation that encodes both causal and evidential directions.

The Symmetric Matrix

The log contingency table encodes:

Causal: I → O

Fix row i, read off log supports for each o.

P(o|i) = 2s(i,o) / Σo' 2s(i,o')

Evidential: O → I

Fix column o, read off log supports for each i.

P(i|o) = 2s(i,o) / Σi' 2s(i',o)

CMP's claim justified: "Learning takes the directed causal arrow from rain to wet ground into a bidirectional one; we may infer that it has rained from the ground being wet just as well." The GCD structure guarantees that the causal and evidential readings are consistent via Bayes.

9. The Tropical Approximation

The UM's standard update uses the (max, min) tropical semiring. The tropical GCD (= min) upper bounds the integer GCD. When min divides all entries, the UM is exact.

Integer GCD vs Tropical GCD (= min)

Row/ColInteger GCDTropical GCD (min)Gap (log2(min/gcd))Exact?
When the gap is zero, the UM's tropical computation is exact Bayesian inference.
Tropical GCD approximation: min(ti, pij) in the UM is the tropical version of the integer GCD. For integer counts where the smallest count divides all others (common in generative processes), the gap is zero and the UM is exact.

Navigation