ProLT · Lecture 15A · 15 of 37
XOR and weighted Hamming distance
In this lecture
- 0:00 · L15A.S01 — From differences to coordinates
- 1:01 · L15A.S02 — Perform the weighted sum
- 2:08 · L15A.S03 — Why the metric-like rules hold
- 2:55 · L15A.S04 — Zero distance can hide a state difference
- 3:43 · L15A.S05 — The quotient set gets a genuine metric
- 4:23 · L15A.S06 — Compute and explain a new pair
Complete transcript
Show transcript
X means dot and Y means stripe on the original four cards: A has only a dot, B both, C only a stripe, and D neither. A selected signature records the chosen formula answers in their displayed order. For a pair of bits, XOR is one when they differ and zero when they agree.
Keep the four valuations and select X and Y in that order. Give the X coordinate weight one and the Y coordinate weight three. All selected weights in our construction are strictly positive. These weights describe a chosen measurement; they are not probabilities, truth values or costs of acquiring tests.
A and C disagree on X and on Y. Their coordinatewise XOR has a one at each disagreement. XOR tells us where the profiles differ; the weights tell us how much each differing coordinate contributes.
At the first coordinate the bits differ, so include the first weight, one. If they agreed, this coordinate would contribute zero. The indicator on screen is one when the bits differ and zero when they agree. Multiplying that indicator by the weight includes the weight exactly when the condition holds.
At the second coordinate the bits also differ, so include weight three. We have kept the two contributions visible separately.
Adding the two contributions gives weighted disagreement four between A and C. Retain both labelled contributions beside the result so that the total can be checked.
The general formula sums the weight times the absolute difference of the bits at each selected coordinate. For zero and one, that absolute difference is one when they differ and zero when they agree. Reversing the endpoints changes no contribution.
Nonnegative weights give nonnegative contributions. Comparing a profile with itself gives no disagreement. Reversing a comparison leaves the disagreement set unchanged. These observations explain self-distance and symmetry without relying on the picture's geometry.
If a coordinate differs between v and u, the intermediate bit at w must disagree with at least one endpoint. Its weight is therefore counted on at least one leg. Sum over coordinates: the direct weighted disagreement cannot exceed the total disagreement along the two-leg detour. That is the triangle inequality.
A metric allows zero distance only between identical points. A pseudometric may give distinct points zero distance.
Now explicitly replace the selected tuple by X alone while retaining all four valuations. A and B both have the one-entry true signature. Their measured disagreement is zero even though they differ on the unobserved variable Y.
Strictly positive weights ensure that a sum can vanish only when every selected bit agrees. Thus zero distance means equal signatures, not necessarily equal valuations. This is a pseudometric on the original carrier.
Replace each equal-signature class by one point. The distance is well-defined between classes because changing representatives changes no selected bit. Distinct classes have distinct signatures and therefore positive distance, giving a metric on that class set.
This statement concerns a metric on an underlying quotient set. It does not yet claim that its metric topology equals the topological quotient of the original observation space. The next lecture isolates that important distinction.
With the original two-observation menu and weights one and three, compute the symmetric distance between A and B. Which coordinate contributes, and would reversing the endpoints change the answer?
A and B agree on X and disagree on Y. Only the second weight contributes, so the distance is three in either direction. A different positive weight choice changes this number without changing the selected truth regions.
Weighted Hamming distance measures disagreement between complete selected profiles. Its zero classes are qualitative signature classes, but its positive values depend on the chosen indexed coordinates and weights. They cannot be read from the topology alone.

