Index Matching: Why the Formula Holds
Index matching is a powerful technique in combinatorics and probability — it's used to simplify sums over complicated index sets by cleverly re-indexing or pairing terms. The core idea is to match indices so that a double sum (or product) collapses into a simpler expression.
Let's build the reasoning step by step.
The Core Formula
The most common index matching identity is:
∑i=1n∑j=1naibj=(∑i=1nai)(∑j=1nbj)
This looks trivial — it's just the distributive law. But the why matters for deeper applications.
Why It Holds: The Distributive Law in Action
Step 1: Expand the outer sum
The left side means: for each fixed i, sum over all j, then sum over i.
∑i=1n(∑j=1naibj)
Step 2: Factor out ai from the inner sum
Since ai does not depend on j, it can be pulled out:
∑i=1n(ai⋅∑j=1nbj)
Step 3: The inner sum is constant with respect to i
Let Sb=∑j=1nbj. Then:
∑i=1nai⋅Sb=Sb⋅∑i=1nai
Step 4: Recognize the product
This is exactly:
(∑i=1nai)(∑j=1nbj)
Key insight: The double sum over all n2 pairs (i,j) is just the product of the two separate sums. This works because the terms factor as aibj — no cross-dependence between i and j.
Why This Matters for Exam Problems
Index matching is used when you have double sums with constraints (like i<j or i=j). The trick:
- Start with the unconstrained double sum (all i,j)
- Subtract the diagonal terms (i=j) or the off-diagonal terms
- Use index matching to simplify
Example: Sum over i<j
We want ∑1≤i<j≤naibj.
Derivation:
∑i=1n∑j=1naibj=∑i=1n∑j=1i−1aibj+∑i=1naibi+∑i=1n∑j=i+1naibj
The first and third terms are symmetric (just swap i and j). So:
(∑ai)(∑bj)=∑i=1naibi+2∑i<jaibj
Thus:
i<j∑aibj=21[(∑ai)(∑bj)−∑aibi]
Why this works: The unconstrained double sum counts each unordered pair (i,j) twice (once as (i,j) and once as (j,i)), except the diagonal which appears once. Index matching lets us express the constrained sum in terms of the product.
The Deeper "Why": Symmetry and Factorization
The real power of index matching comes from symmetry: …