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.3-29

Exercise 1.2.3-29

not stated yet in Lean solution written

RatingM30
MarkersM (mathematical), recommended
KindK3, find a value: compute a number, a set or a closed form from the written solution
SectionSection 1.2.3 of Volume 1. Companion chapter: Sums and products

The task

(a) Write ∑i=0n∑j=0i∑k=0jaiajak\sum_{i=0}^n \sum_{j=0}^i \sum_{k=0}^j a_i a_j a_k with one sigma sign and several indices. (b) Express it with the power sums S1=∑aiS_1 = \sum a_i, S2=∑ai2S_2 = \sum a_i^2, S3=∑ai3S_3 = \sum a_i^3.

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

For (a), join the three relations 0≤k≤j0 \le k \le j, 0≤j≤i0 \le j \le i and 0≤i≤n0 \le i \le n into one chain.

Hint 2

For (b), mimic Eq. (13). Sort the triples (i,j,k)(i, j, k) by which of the three indices are equal.

Hint 3

Let EE be the sum over the triples with i>j>ki > j > k. Express S13S_1^3 and the wanted sum in terms of EE, S1S2S_1 S_2 and S3S_3, then eliminate EE.

Solution

Show the solution

(a) The three relations give the chain T=∑0≤k≤j≤i≤naiajak.T = \sum_{0 \le k \le j \le i \le n} a_i a_j a_k.

(b) Let E=∑0≤k<j<i≤naiajakE = \sum_{0 \le k < j < i \le n} a_i a_j a_k. Split the triples of TT by equalities among k≤j≤ik \le j \le i:

  • all different: EE;
  • i=j>ki = j > k: ∑k<iai2ak\sum_{k < i} a_i^2 a_k;
  • i>j=ki > j = k: ∑j<iaiaj2\sum_{j < i} a_i a_j^2;
  • i=j=ki = j = k: S3S_3.

The two middle sums together run over all ordered pairs (p,q)(p, q) with p≠qp \ne q of the terms ap2aqa_p^2 a_q (in the first one p=i>q=kp = i > q = k, in the second one p=j<q=ip = j < q = i). That sum is ∑p,qap2aq−∑pap3=S2S1−S3\sum_{p, q} a_p^2 a_q - \sum_p a_p^3 = S_2 S_1 - S_3. Hence T=E+(S1S2−S3)+S3=E+S1S2.T = E + (S_1 S_2 - S_3) + S_3 = E + S_1 S_2.

Now expand S13S_1^3 as a sum over all ordered triples (i,j,k)(i, j, k) in [0,n]3[0, n]^3. A triple with three different values is one of 66 orderings of a set counted in EE. A triple with exactly two equal values has the form (p,p,q)(p, p, q), (p,q,p)(p, q, p) or (q,p,p)(q, p, p) with p≠qp \ne q, which gives 3∑p≠qap2aq=3(S1S2−S3)3\sum_{p \ne q} a_p^2 a_q = 3(S_1 S_2 - S_3). A triple of three equal values gives S3S_3. So S13=6E+3(S1S2−S3)+S3=6E+3S1S2−2S3,E=S13−3S1S2+2S36.S_1^3 = 6E + 3(S_1 S_2 - S_3) + S_3 = 6E + 3 S_1 S_2 - 2 S_3, \qquad E = \frac{S_1^3 - 3 S_1 S_2 + 2 S_3}{6}. Therefore T=S136−S1S22+S33+S1S2=16S13+12S1S2+13S3.T = \frac{S_1^3}{6} - \frac{S_1 S_2}{2} + \frac{S_3}{3} + S_1 S_2 = \frac16 S_1^3 + \frac12 S_1 S_2 + \frac13 S_3.

Check

For n=2n = 2 and a=(1,2,3)a = (1, 2, 3): S1=6S_1 = 6, S2=14S_2 = 14, S3=36S_3 = 36, and the formula gives 36+42+12=9036 + 42 + 12 = 90. The sum of the 1010 products aiajaka_i a_j a_k over k≤j≤ik \le j \le i is 9090 (computed with python3). Also, the coefficients add up as they should for a=(1)a = (1): T=1T = 1 and 16+12+13=1\frac16 + \frac12 + \frac13 = 1.

Remarks

The coefficients 16,12,13\frac16, \frac12, \frac13 are the numbers of the permutations of three objects with 33, 22 and 11 cycles, divided by 3!=63! = 6. Section 1.2.9 gives the general rule. The two-index analog is Eq. (13): 12S12+12S2\frac12 S_1^2 + \frac12 S_2.

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

In Lean

not stated yet The exercise is not stated in Lean yet.

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

Something is wrong? Report it.