taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.2.6-38

Exercise 1.2.6-38

stated in Lean solution written

RatingHM30
MarkersHM (needs higher mathematics)
KindK1, prove: show that a stated fact is true from the written solution
SectionSection 1.2.6 of Volume 1. Companion chapter: Binomial coefficients

The task

Prove Ramus' formula for the sum of the entries (ns)\binom{n}{s} over all s≡k(modm)s \equiv k \pmod m.

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

Pick out the indices s≡k(modm)s \equiv k \pmod m with the mmth roots of unity.

Hint 2

Sum the binomial theorem over those roots.

Hint 3

Write 1+ω=2cos⁡θ eiθ1 + \omega = 2\cos\theta\,e^{i\theta} for ω=e2iθ\omega = e^{2i\theta}, and keep the real part.

Solution

Show the solution

Plan: a filter with roots of unity turns the sum into a sum of mm binomial expansions. Then each term is put in polar form.

Let ω=e2πi/m\omega = e^{2\pi i/m}. For an integer aa, ∑j=0m−1ωja=m\sum_{j=0}^{m-1}\omega^{ja} = m if m∣am \mid a, and 00 otherwise. This is a geometric sum with the ratio ωa\omega^a. If ωa≠1\omega^a \ne 1, the sum is (ωma−1)/(ωa−1)=0(\omega^{ma} - 1)/(\omega^a - 1) = 0. So S=∑s≡k (m)(ns)=1m∑j=0m−1∑s(ns)ωj(s−k)=1m∑j=0m−1ω−jk(1+ωj)n.S = \sum_{s \equiv k\ (m)}\binom{n}{s} = \frac{1}{m}\sum_{j=0}^{m-1}\sum_{s}\binom{n}{s}\omega^{j(s-k)} = \frac{1}{m}\sum_{j=0}^{m-1}\omega^{-jk}(1+\omega^j)^n. The last step uses the binomial theorem, ∑s(ns)(ωj)s=(1+ωj)n\sum_s\binom{n}{s}(\omega^j)^s = (1+\omega^j)^n.

Put θj=πj/m\theta_j = \pi j/m. Then ωj=e2iθj\omega^j = e^{2i\theta_j} and 1+e2iθj=eiθj(e−iθj+eiθj)=2cos⁡θj eiθj1 + e^{2i\theta_j} = e^{i\theta_j}(e^{-i\theta_j} + e^{i\theta_j}) = 2\cos\theta_j\,e^{i\theta_j}. Also ω−jk=e−2ikθj\omega^{-jk} = e^{-2ik\theta_j}. So the jjth term is (2cos⁡θj)neiθj(n−2k)=(2cos⁡θj)n(cos⁡(θj(n−2k))+isin⁡(θj(n−2k))).(2\cos\theta_j)^n e^{i\theta_j(n-2k)} = (2\cos\theta_j)^n\bigl(\cos(\theta_j(n-2k)) + i\sin(\theta_j(n-2k))\bigr). The number SS is real, so it equals the real part of the sum: S=1m∑0≤j<m(2cos⁡jπm)ncos⁡j(n−2k)πm.S = \frac{1}{m}\sum_{0\le j<m}\Bigl(2\cos\frac{j\pi}{m}\Bigr)^n\cos\frac{j(n-2k)\pi}{m}. For 0≤k<m0 \le k < m the terms (nk+tm)\binom{n}{k+tm} with t<0t < 0 have a negative lower index and are zero, so SS is the sum (nk)+(nm+k)+⋯\binom{n}{k} + \binom{n}{m+k} + \cdots.

Check

For n=7n = 7, m=3m = 3, k=1k = 1 the entries (71)+(74)+(77)=7+35+1=43\binom{7}{1} + \binom{7}{4} + \binom{7}{7} = 7 + 35 + 1 = 43, and the right side evaluates to 4343. For n=10n = 10, m=4m = 4, k=2k = 2 the sum is 45+210+1=25645 + 210 + 1 = 256, and the right side gives 256256. For m=2m = 2 and k=0k = 0 it gives 12(2n+0n)\frac12(2^n + 0^n), the result of Exercise 1.2.6-37.

Remarks

The same filter gives ∑s≡k(ns)xs\sum_{s \equiv k}\binom{n}{s}x^s for any xx. For m=3m = 3 and k=0k = 0 the sum is (2n+2cos⁡(nπ/3))/3(2^n + 2\cos(n\pi/3))/3.

This solution is drafted, and a person has not reviewed it yet. The source.

In Lean

stated The statement is in Lean and it builds. The proof is not in Lean yet.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.