1

Find an explicit formula for the number of compositions of $2n$ with the largest part exactly $n$.

I am trying to solve this problem for my combinatorics class. Here's what I've tried so far:

Let $n$ be in the integer composition. Then, we need to partition the remaining number n, since $n+n = 2n$ and we have already partitioned for $n$. Let $IC(n,k)$ be the number of remaining partitions. Since the number of elements in the partition is $k+1$, we have $k+1$ spaces to put the number $n$ in the composition. Then,

$\sum_{k=1}^{n} IC(n, k)n(k+1)$

I am very lost. This is nowhere close to the answer. The answer is:

$(n+3)2^{n-2}-1$

Zek
  • 309
  • 1
    Can you write out your process for say $n=3$? EG Do you get $1+1+1+3, 1+2+3, 2+1+3, 3+3, 1+1+3+1, 2+3+1, 1+3+1+1, 1+3+2, 3+1+1+1, 3+1+2, 3+2+1$? – Calvin Lin Oct 26 '23 at 23:28
  • 1
    I think what you've written so far is a good approach! I think the expression you should get is $\sum_{k = 1}^n \mathit{IC}(n, k) \cdot (k + 1)$ - I'm not sure why you're multiplying by $n$. It's possible to crunch your way through this sum by sheer algebra and willpower! You can use the fact that $\mathit{IC}(n, k)$ is given by a binomial coefficient, and then use this type of trick to evaluate the sum. Lastly, realise that there is one composition that you have double-counted.. – Izaak van Dongen Oct 26 '23 at 23:43

1 Answers1

2

As I said in the comments, you can do this by pure algebra, but it's not entirely straightforward and a bit yucky. I think your sum should be $-1 + \sum_{k = 1}^n \operatorname{IC}(n, k) \cdot (k + 1)$, because for each $k$, for each composition of $n$ with $k$ parts, you have $k + 1$ positions to insert the $n$-part, and this double-counts $n + n$. This sum is equal to $-1 + \sum_{k = 1}^n \binom{n - 1}{k - 1}(k + 1)$, and you can evaluate this by using standard tricks/identities for sums of binomial coefficients. I will go into more detail than that for now - at the end of this answer.

Here is what I think is quite a nice combinatorial "bijective" viewpoint:

In general a nice way to get a combinatorial foothold with compositions is to use the fact that the compositions of $n$ correspond to the subsets of $\{1, \dotsc, n - 1\}$, by identifying a composition $n_1 + \dotsb + n_k$ with the set $X$ of its partial sums, excluding $0$ and $n$: $X = \{n_1, n_1 + n_2, \dotsc, n_1 + \dotsb + n_{k - 1}\}$.

This identification is not new - it's used, for instance in the nicer bijective way to prove that the number of compositions of $n$ is $2^{n - 1}$. It's a slightly more formal formulation of a "stars-and-bars" argument. This has been discussed before on this site, for example here. I have a mild personal preference for using concrete sets of naturals for proofs like this because I feel like it helps me avoid off-by-one errors. If you prefer the more typical combinatorial type of proof, you can easily translate the following discussion into triangles and squares, or stars and bars, or goats and pigs, or whatever type of objects you like! Anyway, on with the answer...

We'll count separately "the compositions of $2n$ with first or last part $n$" and "the compositions of $2n$ with largest part $n$, but it's not the first or last part".

Under the above identification, compositions of $2n$ with maximum part $n$, which is not the first or last part, correspond to subsets $X$ of $\{1, \dotsc, 2n - 1\}$, where there is some $1 \le k \le n - 1$ such that $k, k + n \in X$ and $k + t \notin X$ for all $1 \le t \le n - 1$. The value of $k$ for such a set $X$ is unique (because there is only one part of size $n$). So we can count the number of such $X$ by first choosing a $k$ and then choosing all suitable $X$ for that $k$.

There are $n - 1$ possible choices for $k$, and given $k$, there are $2^{2n - 1 - (n + 1)} = 2^{n - 2}$ choices for $X$ (since we've already determined whether $k, \dotsc, k + n$ belong to $X$, and we may freely choose for the remainder of the elements). So there are $(n - 1)2^{n - 2}$ such compositions.

Compositions of $2n$ with first part $n$ of course correspond to compositions of $n$. (As do compositions with last part $n$). This double-counts the composition $n + n$, so the total number of remaining compositions is $2^{n - 1} + 2^{n - 1} - 1$.

Hence, in total, the number of such compositions is $(n - 1)2^{n - 2} + 2^n - 1 = (n + 3)2^{n - 2} - 1$.


More on the summation approach. I'm taking it for granted that you know that $\mathrm{IC}(n, k) = \binom{n - 1}{k - 1}$. (In fact this follows from the bijective viewpoint - a $k$-composition corresponds to a subset of size $k - 1$.)

We'll also need the fact that $\sum_{r = 0}^m r\binom mr = m \cdot 2^{m - 1}$. There's a cute proof given here (essentially by integrating the generating function). There is also a nice bijective way to see it here. In that thread there are many other approaches too, including this nice elementary approach.

This lets us work out the sum. First change variables to $r = k - 1$: \begin{align*} \sum_{k = 1}^n \binom{n - 1}{k - 1}(k + 1) &= \sum_{r = 0}^{n - 1} \binom{n - 1}r(r + 2) \\ &= \sum_{r = 0}^{n - 1} r\binom{n - 1}r + 2\sum_{r = 0}^{n - 1} \binom{n - 1}r \\ &= (n - 1)2^{n - 2} + 2 \cdot 2^{n - 1} \end{align*} which gives the correct result after subtracting the $1$.

In this case if you wanted to prove it totally manually, the first approach would lead you to consider $f(x) = \sum_{k = 1}^n \binom{n - 1}{k - 1}(k + 1)x^k$, then find an antiderivative $F(x)$ of $f(x)$, write $F(x)$ in closed form using the binomial theorem, and differentiate to find $f(1)$.

  • Thank you both for the bijection and summation proofs! I would love to see how you would evaluate the summation, since I am a bit stuck. I cannot thank you enough though, this answer is great! – Zek Oct 27 '23 at 14:37
  • 1
    @Zek You're welcome! I've written a bit more about the summation approach. Let me know if that helps. – Izaak van Dongen Oct 27 '23 at 16:38
  • 1
    It helped a lot! Thank you for the detailed answer. – Zek Oct 27 '23 at 23:36