CEMC Banner

Problem of the Month
Solution to Problem 3: Three-sign sums

December 2024

    1. We have f3=μ({1})+μ({2})+μ({3})+μ({1,2})+μ({1,3})+μ({2,3})+μ({1,2,3})=1+2+3+(1+2)+(1+3)+(2+3)+(1+23)=18. For f4, we will organise ourselves a little differently to make computing f5 a little easier. Notice that if a sublist of {1,2,3,4} does not contain 4, then it is a sublist of {1,2,3}. Therefore we have f4=f3+μ({4})+μ({1,4})+μ({2,4})+μ({3,4})+μ({1,2,4})+μ({1,3,4})+μ({2,3,4})+μ({1,2,3,4})=18+4+(1+4)+(2+4)+(3+4)+(1+24)+(1+34)+(2+34)+(1+23+4)=44. When computing f4, notice that if we ignore all the 4s that showed up in the sum, what is left over is again a copy of f3. With this in mind, for f5 we have f5=f4+5+(1+5)+(2+5)+(3+5)+(4+5)+(1+25)+(1+35)+(1+45)+(2+35)+(2+45)+(3+45)+(1+23+5)+(1+24+5)+(1+34+5)+(2+34+5)+(1+23+4+5)=f4+f4+(5)+(5+5+5+5)(5+5+5+5+5+5)+(5+5+5+5)+(5)=44+44+5(1+46+4+1)=108. The 5s in the third-last line are grouped by whether they come from computing μ(L) for a list L of length 1, 2, 3, 4, or 5.

    2. We have (40)=(44)=1, (41)=(43)=4, and (42)=6. Then 2f4+5((40)+(41)(42)+(43)+(44))=2(44)+5(1+46+4+1)=108 which is the value we obtained for f5.

  1. Our computation of f5 in Problem 1(a) above gives us some hints as to how to prove this result. Let’s pay close attention to this situation first before embarking on the general proof.

    In the solution to 1(a) we arrived at the expression f5=2f4+(5)+(5+5+5+5)(5+5+5+5+5+5)+(5+5+5+5)+(5). The number of 5s in the first set of parentheses is the number of sublists of {1,2,3,4,5} of length 1 that contain 5. There is only one such list, namely {5}.

    The number of 5s in the second set of parentheses is the number of sublists of {1,2,3,4,5} of length 2 that contain 5. Every such list is of the form {k,5}, where 1a4. There are 4=(41) ways to choose an element a from {1,2,3,4}, so there are four sublists of length 2 that contain 5.

    There are six 5s in the third set of parentheses. This is the number of sublists of {1,2,3,4,5} of length 3 that contain 5. Every such sublist is of the form {a,b,5} where a<b and a and b belong to the set {1,2,3,4}. The number of ways we can choose two distinct elements a and b from {1,2,3,4} is precisely the binomial coefficient (42)=6.

    Similarly, there are four 5s in the fourth set of parentheses because there are (43)=4 ways to select three elements a,b,c from {1,2,3,4} to create a sublist {a,b,c,5} of length 4.

    Finally there is (44)=1 way to choose four elements from {1,2,3,4} to create a list of length 5 containing 5, which is the list {1,2,3,4,5}.

    Notice that the third set of parentheses is negated, and all the others are left as they are. Let’s look at this a little more closely. Here is what the 3-sign sum of lists containing a 5 look like, for lists of length 1, 2, 3, 4, and 5 respectively: μ({5})=5μ({a,5})=a+5μ({a,b,5})=a+b5μ({a,b,c,5})=a+bc+5μ({a,b,c,d,5})=a+bc+d+5. The only time the 5 appears negated is when computing the 3-sign sum of a list of length 3.

    Great! Let’s look at the general case now. We wish to relate fn+1 to fn. We can split up the computation of fn+1 into summing up the 3-sign sums of sublists of {1,,n+1} that contain n+1, and those that do not contain n+1.

    The sum of all the μ(L) where n+1 is not in L is simply summing up μ(L) for L a sublist of {1,,n}, which is precisely fn. Therefore we can write fn+1=fn+S where S is the sum of all 3-sign sums of sublists that contain n+1. Let’s look at an arbitrary term from the sum S. For what follows, we must allow the empty list to be a sublist of {1,,n} to be a sublist, and we define μ()=0.

    A sublist of length k that contains n+1 is of the form {a1,a2,,ak1,n+1} where {a1,a2,,ak1} is a sublist of {1,,n}. So μ({a1,a2,,ak1,n+1})={μ({a1,a2,,ak1})(n+1)if k is a multiple of 3,μ({a1,a2,,ak1})+(n+1)if k is not a multiple of 3. Observe that μ({a1,a2,,ak1}) is the 3-sign sum of a sublist of {1,,n}.

    Every sublist of {1,,n+1} that contains n+1 gives rise to a sublist of {1,,n} by removing n+1 from the list. Furthermore, every sublist of {1,,n} gives rise to a sublist of {1,,n+1} containing n+1 by simply appending n+1 on to the end of the list. Therefore, when computing the sum of all 3-sign sums of sublists of {1,,n+1} containing n+1, we are left with the sum of all 3-sign sums of sublists of {1,,n} plus some number of (n+1)s. More formally we have S=fn+M(n+1) for some integer M. To figure out the value of M, we must pay attention to the length of each sublist. Sublists of {1,,n+1} containing n+1 with length a multiple of three contribute 1 to the value of M, and sublists of {1,,n+1} containing n+1 whose length is not a multiple of three contribute +1. So, in order to figure out what M is, we must count the number of sublists containing n+1 of each length.

    The number of sublists of {1,,n+1} of length k containing n+1 is equal to the number of sublists of {1,,n} of length k1. The number of sublists of {1,,n} of length k1 is the binomial coefficient (nk1). To write down an expression for M, we must first introduce the integer bt. Let t be an integer and define bt={1if t+1 is not a multiple of 31if t+1 is a multiple of 3. Let Ck be the number of sublists of {1,,n+1} of length k that contain n+1. Then M=b0C1+b1C2++bnCn+1. But from our discussion above we have Ck=(nk1). Therefore, M=b0(n0)+b1(n1)++bn(nn). Putting all of this together we have fn+1=fn+fn+M(n+1)=2fn+(n+1)(b0(n0)+b1(n1)++bn(nn)) completing the proof.

    1. We have α3=(α2)α=(1α)α=αα2=1.

    2. Using the fact that α3=1 we have α8+α4+α9=(α3)(α3)(α2)+(α3)(α)+(α3)3=α2+α+1=1+1=0.

    3. We have (1+α)(1+α)2=(1+α)(α2)2=(1+α)(α4)=1+ααsince α3=1=1.

    1. Using the binomial theorem we have gn(1)=(n0)+(n1)++(nn)gn(α)=(n0)+(n1)α+(n2)α2++(nn)αngn(α2)=(n0)+(n1)α2+(n2)α4++(nn)α2n. Since α3=1 we can rewrite the second and third expressions as gn(α)=(n0)+(n1)α+(n2)α2+(n3)+(n4)α+(n5)α2+(n6)+gn(α2)=(n0)+(n1)α2+(n2)α+(n3)+(n4)α2+(n5)α+(n6)+. It is tempting to just take the sum of these two expressions. This would give every third term a coefficient of 2, and every other term a coefficient of α2+α=1. A promising development! After all, we want a sum of binomial coefficients where every third term is different from the other two. However, if we simply sum gn(α) and gn(α2), the (approximately) one-third of terms that are different from the rest are in the wrong spot! To remedy this, let’s shift where the α and α2 appear by multiplying each equation by an appropriate power of α. We have αgn(α)=(n0)α+(n1)α2+(n2)+(n3)α+(n4)α2+(n5)+(n6)α+α2gn(α2)=(n0)α2+(n1)α+(n2)+(n3)α2+(n4)α+(n5)+(n6)α2+. Much better! Taking the sum we get αgn(α)+α2gn(α2)=(n0)(α+α2)+(n1)(α2+α)+2(n2)+(n3)(α+α2)+(n4)(α2+α)+2(n5)+=(n0)(n1)+2(n2)(n3)(n4)+2(n5)+. Adding gn(1) to this gives gn(1)+αgn(α)+α2gn(α2)=3(n2)+3(n5)+3(n8)+. We can now start with gn(1) and subtract an appropriate multiple of gn(1)+αgn(α)+α2gn(α2) to get what we want. gn(1)23(gn(1)+αgn(α)+α2gn(α2))=(n0)+(n1)++(nn)2((n2)+(n5)+(n8)+)=(n0)+(n1)(n2)+(n3)+(n4)(n5)+(n6)+=b0(n0)+b1(n1)++bn(nn). We can now finally conclude that A=13B=23αC=23α2.

    2. We have dn=13gn(1)23αgn(α)23α2gn(α2)=13(2n)23α(1+α)n23α2(1+α2)nsince gn(x)=(1+x)n=13(2n)23α(α2)n23α2(α)n=13(2n+2α2n+1(1)n+1+2α2+n(1)n+1)=23(2n1+(1)n+1(α2n+1+α2+n)). Let rn=(1)n+1(α2n+1+α2+n). The behaviour of (1)n+1 depends on the remainder of n when divided by 2. The behaviour of powers of α depends on the remainder of the power when divided by 3. With this in mind, let’s analyse the behaviour of rn for different remainders of n when divided by 2×3=6.

      When n=6k for some integer k we have r6k=(1)6k+1(α12k+1+α6k+2)=(α+α2)=1. When n=6k+1 we have r6k+1=(1)6k+2(α12k+3+α6k+3)=2. For n=6k+2, r6k+2=(1)6k+3(α12k+5+α6k+4)=(α2+α)=1. The remaining cases are given by r6k+3=(1)6k+4(α12k+7+α6k+5)=α+α2=1r6k+4=(1)6k+5(α12k+9+α6k+6)=(1+1)=2r6k+5=(1)6k+6(α12k+11+α6k+7)=α2+α=1. So, dn=23(2n1+rn), where rn is given by the following table:

      n rn
      6k 1
      6k+1 2
      6k+2 1
      6k+3 1
      6k+4 2
      6k+5 1
  2. Putting all the parts together we have the recursive formula fn+1=2fn+2(n+1)3(2n1+rn) where rn is given by the table above. From 1(a) we know f5=108. Applying the recursive formula repeatedly gives f6=2f5+2(6)3(24+r5)=2(108)+2(6)3(24+(1))=276.f7=2f6+2(7)3(25+r6)=2(276)+2(7)3(25+1)=706.f8=2f7+2(8)3(26+r7)=2(706)+2(8)3(26+2)=1764.f9=2f8+2(9)3(27+r8)=2(1764)+2(9)3(27+1)=4302.f10=2f9+2(10)3(28+r9)=2(4302)+2(10)3(28+(1))=10304.f11=2f10+2(11)3(29+r10)=2(10304)+2(11)3(29+(2))=24348.f12=2f11+2(12)3(210+r11)=2(24348)+2(12)3(210+(1))=56880. If you were to compute f12 directly from the definition, you would have had to compute the 3-sign sum of 4096 lists. What we have done in this Problem of the Month is much less work, especially if you wanted to compute something larger like f30. If you were to compute f30 directly from the definition, you would need to compute over 1 billion 3-sign sums! That’s a lot of sums.