Vandermonde's identity

Problem: V(m,n,r) = Σₖ C(m,k)·C(n, r−k)

Give non‑negative integers m, n, r with 0 ≤ r ≤ m+n. This page evaluates the Vandermonde convolution, explains why it equals C(m+n, r), and verifies it with a built‑in test harness.

Input

Constraints: m,n,r ∈ ℕ with 0 ≤ r ≤ m+n. All arithmetic uses exact BigInt.

Output

Answer
Closed form
C(m+n, r)
k‑range
# terms

Reason Why

Algebraic (coefficient extraction). The product expands as (1+x)^m (1+x)^n = (1+x)^{m+n}. The coefficient of x^r on the left is Σₖ C(m,k) C(n, r−k) (choose k from the first factor and r−k from the second), while on the right it is C(m+n, r). Hence the two are equal.
Combinatorial. To choose r elements from a disjoint union of an m-set and an n-set, first decide that exactly k come from the first set (there are C(m,k) ways) and the remaining r−k from the second (there are C(n,r−k) ways). Summing over all admissible k counts each r-subset exactly once, giving C(m+n,r).
Bounds of summation. Nonzero terms occur only when 0≤k≤m and 0≤r−k≤n, that is max(0, r−n) ≤ k ≤ min(r, m).
Show terms Σ C(m,k)·C(n,r−k)

Check (harness)

Preloaded Checks (harness)

Each block recomputes the Vandermonde sum and asserts equality with C(m+n,r). One case is intentionally invalid.