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-23

Exercise 1.2.9-23

stated in Lean solution written

RatingM33
MarkersM (mathematical)
KindK3, find a value: compute a number, a set or a closed form from the written solution
SectionSection 1.2.9 of Volume 1. Companion chapter: Generating functions

The task

Prove that the chain sum of Carlitz is a product of powers fmn−rgmrf_m^{n-r}g_m^r of two polynomials, find a closed form for the cyclic sum Sn(z1,…,zm)S_n(z_1,\ldots,z_m), and simplify it for equal variables.

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

In (a), sum over kmk_m first. The binomial theorem turns the last factor into a power of 1+1/zm1+1/z_m, and so removes one variable.

Hint 2

This gives a recurrence for fmf_m and gmg_m that is linear in the new variable. The recurrence is fm=zmfm−1+zm−1fm−2f_m=z_mf_{m-1}+z_{m-1}f_{m-2}, and the same for gmg_m.

Hint 3

For (b) the cyclic sum closes the chain with r=kmr=k_m. Take the term with km=rk_m=r out of (a), sum over nn and apply Lagrange's formula for the diagonal.

Hint 4

For (c) let ρ,σ\rho,\sigma be the roots of x2−zx−zx^2-zx-z, so ρ+σ=z\rho+\sigma=z and ρσ=−z\rho\sigma=-z. Show that hm=ρm+σmh_m=\rho^m+\sigma^m.

Solution

Show the solution

Plan. Part (a) is an induction on mm. Part (b) uses (a) and the generating function in ww. Part (c) is a recurrence of the traces.

Notation. Put z0=1z_0=1, f−1=0f_{-1}=0 and f0=g−1=g0=1f_0=g_{-1}=g_0=1, and for m≥1m\ge1

fm=zmfm−1+zm−1fm−2,gm=zmgm−1+zm−1gm−2,f_m=z_mf_{m-1}+z_{m-1}f_{m-2},\qquad g_m=z_mg_{m-1}+z_{m-1}g_{m-2},

where fj,gjf_j,g_j depend on z1,…,zjz_1,\ldots,z_j. So f1=z1f_1=z_1, g1=z1+1g_1=z_1+1, f2=z1(z2+1)f_2=z_1(z_2+1). Each fm,gmf_m,g_m is a polynomial, of degree 11 in zmz_m. Let Tm(n,r)T_m(n,r) be the sum of the exercise in (a), with k0=rk_0=r. Terms with ki>nk_i>n vanish. So the sums are finite.

(a) Claim: Tm(n,r)=fmn−rgmrT_m(n,r)=f_m^{n-r}g_m^r for 0≤r≤n0\le r\le n. Sum over kmk_m first. The last factor is (km−1n−km)\binom{k_{m-1}}{n-k_m}, and with j=n−kmj=n-k_m (0≤j≤km−1≤n0\le j\le k_{m-1}\le n),

∑km(km−1n−km)zmkm=zmn∑j(km−1j)zm−j=zmn(1+1zm)km−1.\sum_{k_m}\binom{k_{m-1}}{n-k_m}z_m^{k_m}=z_m^n\sum_j\binom{k_{m-1}}jz_m^{-j}=z_m^n\Bigl(1+\frac1{z_m}\Bigr)^{k_{m-1}}.

The other factors do not depend on kmk_m. Moving (1+1/zm)km−1(1+1/z_m)^{k_{m-1}} next to zm−1km−1z_{m-1}^{k_{m-1}} gives

Tm(n,r;z1,…,zm)=zmn Tm−1(n,r;z1,…,zm−2, zm−1(1+1/zm)).T_m(n,r;z_1,\ldots,z_m)=z_m^n\,T_{m-1}\bigl(n,r;z_1,\ldots,z_{m-2},\,z_{m-1}(1+1/z_m)\bigr).

For m=1m=1 the same step gives T1=z1n(1+1/z1)r=z1n−r(z1+1)r=f1n−rg1rT_1=z_1^n(1+1/z_1)^r=z_1^{n-r}(z_1+1)^r=f_1^{n-r}g_1^r. For m≥2m\ge2 assume Tm−1=fm−1n−rgm−1rT_{m-1}=f_{m-1}^{n-r}g_{m-1}^r. The polynomial fm−1f_{m-1} is linear in its last variable y=zm−1y=z_{m-1}, namely fm−1=yfm−2+zm−2fm−3f_{m-1}=yf_{m-2}+z_{m-2}f_{m-3}. Put y=zm−1(zm+1)/zmy=z_{m-1}(z_m+1)/z_m:

zmfm−1∣y=zm−1(zm+1)fm−2+zmzm−2fm−3=zmfm−1+zm−1fm−2=fm.z_mf_{m-1}\bigl|_{y}=z_{m-1}(z_m+1)f_{m-2}+z_mz_{m-2}f_{m-3}=z_mf_{m-1}+z_{m-1}f_{m-2}=f_m.

The same computation holds for gg. Since zmn=zmn−rzmrz_m^n=z_m^{n-r}z_m^r, we get Tm=fmn−rgmrT_m=f_m^{n-r}g_m^r.

(b) Rename the index in (b) so that the closing factor (kmn−k1)\binom{k_m}{n-k_1} is the first factor (rn−k1)\binom r{n-k_1} of (a) with r=kmr=k_m. So SnS_n is the sum over rr of the terms of Tm(n,r)T_m(n,r) with km=rk_m=r. As zmz_m occurs in TmT_m only through zmkmz_m^{k_m}, these are the terms of degree rr in zmz_m of fmn−rgmrf_m^{n-r}g_m^r. Write fm=ax+bf_m=ax+b, gm=cx+dg_m=cx+d with x=zmx=z_m and

a=fm−1,b=zm−1fm−2,c=gm−1,d=zm−1gm−2,a=f_{m-1},\quad b=z_{m-1}f_{m-2},\quad c=g_{m-1},\quad d=z_{m-1}g_{m-2},

which do not contain xx. Let Z=zmZ=z_m. Then

Sn=∑r=0nZr[xr] (ax+b)n−r(cx+d)r.S_n=\sum_{r=0}^nZ^r[x^r]\,(ax+b)^{n-r}(cx+d)^r.

Multiply by wnw^n and sum, with j=n−rj=n-r:

∑nSnwn=∑r[xr](Zw(cx+d))r1−w(ax+b).\sum_nS_nw^n=\sum_r[x^r]\frac{\bigl(Zw(cx+d)\bigr)^r}{1-w(ax+b)}.

Lagrange's formula ∑r[xr]F(x)φ(x)r=F(x0)/(1−φ′(x0))\sum_r[x^r]F(x)\varphi(x)^r=F(x_0)/(1-\varphi'(x_0)) with x0=φ(x0)x_0=\varphi(x_0) holds for formal series when φ\varphi is a multiple of ww (it is the residue of F(x)/(x−φ(x))F(x)/(x-\varphi(x)) at x0x_0). Here φ=Zw(cx+d)\varphi=Zw(cx+d), x0=Zwd/(1−Zwc)x_0=Zwd/(1-Zwc) and φ′=Zwc\varphi'=Zwc. So

∑nSnwn=1(1−Zwc)(1−wb−wax0)=11−w(b+Zc)+Zw2(bc−ad).\sum_nS_nw^n=\frac1{(1-Zwc)\bigl(1-wb-wax_0\bigr)}=\frac1{1-w(b+Zc)+Zw^2(bc-ad)}.

Now b+Zc=hm:=zmgm−1+zm−1fm−2b+Zc=h_m:=z_mg_{m-1}+z_{m-1}f_{m-2} and ad−bc=zm−1Em−1ad-bc=z_{m-1}E_{m-1} with Ej=fjgj−1−fj−1gjE_j=f_jg_{j-1}-f_{j-1}g_j. The recurrences give Ej=−zj−1Ej−1E_j=-z_{j-1}E_{j-1}, and E0=1E_0=1. So Ej=(−1)jz1⋯zj−1E_j=(-1)^jz_1\cdots z_{j-1} and ad−bc=(−1)m−1z1⋯zm−1ad-bc=(-1)^{m-1}z_1\cdots z_{m-1}. Therefore

∑nSnwn=11−hmw+(−1)mz1⋯zm w2.\sum_nS_nw^n=\frac1{1-h_mw+(-1)^mz_1\cdots z_m\,w^2}.

Let ρ,σ\rho,\sigma be the roots of x2−hmx+(−1)mz1⋯zmx^2-h_mx+(-1)^mz_1\cdots z_m. Then ∑Snwn=1/((1−ρw)(1−σw))\sum S_nw^n=1/((1-\rho w)(1-\sigma w)) and

Sn(z1,…,zm)=ρn+1−σn+1ρ−σ,or (n+1)ρn if ρ=σ.S_n(z_1,\ldots,z_m)=\frac{\rho^{n+1}-\sigma^{n+1}}{\rho-\sigma},\qquad\text{or }(n+1)\rho^n\text{ if }\rho=\sigma.

(c) Let zi=zz_i=z for all ii, and let ρ1,σ1\rho_1,\sigma_1 be the roots of x2=zx+zx^2=zx+z, so ρ1+σ1=z\rho_1+\sigma_1=z and ρ1σ1=−z\rho_1\sigma_1=-z. For m≥2m\ge2 the recurrences read fm=z(fm−1+fm−2)f_m=z(f_{m-1}+f_{m-2}) and gm=z(gm−1+gm−2)g_m=z(g_{m-1}+g_{m-2}), and hm=zgm−1+zfm−2h_m=zg_{m-1}+zf_{m-2}. Apply the recurrences to gm−1g_{m-1} and fm−2f_{m-2}. For m≥4m\ge4 this gives hm=z(hm−1+hm−2)h_m=z(h_{m-1}+h_{m-2}). The values h1=zh_1=z, h2=z2+2zh_2=z^2+2z, h3=z3+3z2h_3=z^3+3z^2 equal ρ1m+σ1m\rho_1^m+\sigma_1^m, since ρ12+σ12=z2+2z\rho_1^2+\sigma_1^2=z^2+2z and ρ13+σ13=z3+3z2\rho_1^3+\sigma_1^3=z^3+3z^2. Both sequences satisfy sm=z(sm−1+sm−2)s_m=z(s_{m-1}+s_{m-2}) for m≥4m\ge4 and agree for m=1,2,3m=1,2,3, so hm=ρ1m+σ1mh_m=\rho_1^m+\sigma_1^m. Also (−1)mzm=(ρ1σ1)m(-1)^mz^m=(\rho_1\sigma_1)^m. So the roots in (b) are ρ=ρ1m\rho=\rho_1^m, σ=σ1m\sigma=\sigma_1^m, and

Sn(z,…,z)=ρ1m(n+1)−σ1m(n+1)ρ1m−σ1m.S_n(z,\ldots,z)=\frac{\rho_1^{m(n+1)}-\sigma_1^{m(n+1)}}{\rho_1^m-\sigma_1^m}.

Let UN(z)=∑k(kN−k)zkU_N(z)=\sum_k\binom k{N-k}z^k. Pascal's rule gives UN=zUN−1+zUN−2U_N=zU_{N-1}+zU_{N-2} with U0=1U_0=1, U1=zU_1=z, so UN=(ρ1N+1−σ1N+1)/(ρ1−σ1)U_N=(\rho_1^{N+1}-\sigma_1^{N+1})/(\rho_1-\sigma_1). Therefore

Sn(z,…,z)=Um(n+1)−1(z)Um−1(z),that isUm−1(z) Sn(z,…,z)=Um(n+1)−1(z).S_n(z,\ldots,z)=\frac{U_{m(n+1)-1}(z)}{U_{m-1}(z)},\qquad\text{that is}\qquad U_{m-1}(z)\,S_n(z,\ldots,z)=U_{m(n+1)-1}(z).

The last form has no division and holds for all zz.

Check

For m=2m=2, n=1n=1 and z1=z2=zz_1=z_2=z the sum has the terms (k1,k2)=(1,0),(0,1),(1,1)(k_1,k_2)=(1,0),(0,1),(1,1) with the values z,z,z2z,z,z^2, so S1=2z+z2S_1=2z+z^2. The formula gives U3/U1=(2z2+z3)/z=2z+z2U_3/U_1=(2z^2+z^3)/z=2z+z^2. For m=1m=1, n=2n=2: S2=z+z2S_2=z+z^2 and ρ2+ρσ+σ2=z2+z\rho^2+\rho\sigma+\sigma^2=z^2+z. Python checks the closed form of (b) for m≤3m\le3, n≤3n\le3 with distinct values zi=2,3,5z_i=2,3,5, and (c) for m≤4m\le4, n≤3n\le3.

Remarks

The matrix form is Sn=tr⁡(M1⋯Mm)S_n=\operatorname{tr}(M_1\cdots M_m) with (Mi)a,b=zia(an−b)(M_i)_{a,b}=z_i^a\binom a{n-b}, and the sum (b) is a trace of a product. For m=1m=1 the sum is Un(z)=znGn(1/z)U_n(z)=z^nG_n(1/z), with GnG_n of Exercise 1.2.9-15.

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.