Joint distribution pXY(x,y)
Each column is one cell; height is probability mass
Y = 0Y = 1
1. Sum across X: marginal pY
Combine all columns with the same Y value.
pY(0) = 0.27 + 0.10 + 0.04 = 0.41
pY(1) = 0.03 + 0.20 + 0.36 = 0.59
2. Normalize one slice: pY|X=x
Keep the highlighted pair and divide by its total pX(x).
3. Compare conditional with marginal
KL measures how much the highlighted conditional distribution differs from pY.