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.9-14

Exercise 1.2.9-14

proved in Lean solution written

RatingHM21
MarkersHM (needs higher mathematics)
KindK1, prove: show that a stated fact is true from the written solution
SectionSection 1.2.9 of Volume 1. Companion chapter: Generating functions

The task

Prove the formula (13) that extracts the terms anzna_nz^n with n mod m=rn\bmod m=r from G(z)G(z) with the mmth roots of unity.

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

Write G(ωkz)=∑nanωknznG(\omega^kz)=\sum_na_n\omega^{kn}z^n and exchange the sum over kk with the sum over nn.

Hint 2

Sum the geometric series in kk. It depends on whether ωn−r=1\omega^{n-r}=1.

Solution

Show the solution

Let ω=e2πi/m\omega=e^{2\pi i/m}. Then ωm=1\omega^m=1, and ωj=1\omega^j=1 exactly when mm divides jj. Insert G(ωkz)=∑nanωknznG(\omega^kz)=\sum_na_n\omega^{kn}z^n:

1m∑k=0m−1ω−krG(ωkz)=∑nanzn⋅1m∑k=0m−1ωk(n−r).\frac1m\sum_{k=0}^{m-1}\omega^{-kr}G(\omega^kz)=\sum_na_nz^n\cdot\frac1m\sum_{k=0}^{m-1}\omega^{k(n-r)}.

The sum over kk is finite, so the exchange of the two sums is valid for every zz at which GG converges (for formal series it needs no argument). Put θ=ωn−r\theta=\omega^{n-r}. If mm divides n−rn-r, then θ=1\theta=1 and ∑kθk=m\sum_k\theta^k=m. Otherwise θ≠1\theta\ne1 and θm=1\theta^m=1, so ∑k=0m−1θk=(θm−1)/(θ−1)=0\sum_{k=0}^{m-1}\theta^k=(\theta^m-1)/(\theta-1)=0. For 0≤r<m0\le r<m the condition "mm divides n−rn-r" is the same as n mod m=rn\bmod m=r. Hence the inner factor is 11 when n mod m=rn\bmod m=r and 00 otherwise, and the right side is ∑n mod m=ranzn\sum_{n\bmod m=r}a_nz^n.

Check

Take G(z)=1/(1−z)G(z)=1/(1-z), m=2m=2, r=1r=1. The formula gives 12(11−z−11+z)=z1−z2=z+z3+⋯\frac12\bigl(\frac1{1-z}-\frac1{1+z}\bigr)=\frac z{1-z^2}=z+z^3+\cdots, the odd terms. For m=3m=3, r=0r=0 and G=ezG=e^z the formula gives 13(ez+eωz+eω2z)=1+z3/6+⋯\frac13(e^z+e^{\omega z}+e^{\omega^2z})=1+z^3/6+\cdots, and the coefficient at z3z^3 is 13!\frac1{3!}.

Remarks

The case m=2m=2 is Eq. (12). Exercise 1.2.9-19 uses the formula for m=qm=q, and Exercise 1.2.9-26 gives it a compact form.

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

In Lean

proved The statement and its proof are in Lean. The kernel accepts the proof, and it uses the standard axioms only.

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

Something is wrong? Report it.