[Math] Number of all compositions of a odd number into j(odd number) of odd parts.

combinatoricsdiscrete mathematicsinteger-partitionsrecurrence-relations

Given m,j are odd positive integers. Find a closed form formula for the number of all compositions of m into j odd parts?

Attempt: If m=2+x, then x is odd and we have to find x into odd parts.
If m $\ne$ 2+x, then could we say x is even. I am stuck here.

Also I tried to use Stars and bars, representing 1 with stars, then could I say the bars should always go in the even places.
As you can see I am getting nowhere with both approaches

Best Answer

Rather than write up a sanitized answer, I’m going to show how I actually attacked the problem.

It never hurts to start by gathering some data. The compositions of $1,3,5,7$, and $9$ into odd numbers of odd parts are:

$$\begin{align*} 1&=1\\ 3&=3=1+1+1\\ 5&=5=3+1+1=1+3+1=1+1+3=1+1+1+1+1\\ 7&=7=5+1+1=1+5+1=1+1+5\\ &=3+3+1=3+1+3=1+3+3=3+1+1+1+1\\ &=1+3+1+1+1=1+1+3+1+1=1+1+1+3+1\\ &=1+1+1+1+3=1+1+1+1+1+1+1\\ 9&=9=7+1+1=1+7+1=1+1+7=5+3+1\\ &=5+1+3=3+5+1=3+1+5=1+5+3=1+3+5\\ &=3+3+3=5+1+1+1+1=1+5+1+1+1=\\ &=1+1+5+1+1=1+1+1+5+1=1+1+1+1+5\\ &=3+3+1+1+1=3+1+3+1+1=3+1+1+3+1\\ &=3+1+1+1+3=1+3+3+1+1=1+3+1+3+1\\ &=1+3+1+1+3=1+1+3+3+1=1+1+3+1+3\\ &=1+1+1+3+3=3+1+1+1+1+1+1\\ &=1+3+1+1+1+1+1=1+1+3+1+1+1+1\\ &=1+1+1+3+1+1+1=1+1+1+1+3+1+1\\ &=1+1+1+1+1+3+1=1+1+1+1+1+1+3\\ &=1+1+1+1+1+1+1+1+1 \end{align*}$$

If $a_n$ is the number of compositions of $n$ into an odd number of odd parts, we have the following little table:

$$\begin{array}{rcc} n:&1&3&5&7&9\\ a_n:&1&2&5&13&34 \end{array}$$

We haven’t a lot of data, but it is still noticeable that the numbers $a_n$ so far are all Fibonacci numbers. In fact, they are alternate Fibonacci numbers:

$$0,\color{crimson}1,1,\color{crimson}2,3,\color{crimson}5,8,\color{crimson}{13},21,\color{crimson}{34}$$

That makes me wonder what happens if we count compositions of even numbers into odd parts:

$$\begin{align*} 2&=1+1\\ 4&=3+1=1+3=1+1+1+1\\ 6&=5+1=1+5=3+3\\ &=3+1+1+1=1+3+1+1=1+1+3+1=1+1+1+3\\ &=1+1+1+1+1+1 \end{align*}$$

If we redefine $a_n$ to be simply the number of compositions of $n$ into odd parts, we now have $a_2=1=F_2$, $a_4=3=F_4$, and $a_6=8=F_6$. Moreover, there is no composition of $0$ into odd parts, so $a_0=0=F_0$. The conjecture that $a_n=F_n$ for all $n\in\Bbb N$ is starting to look very good. To prove it, we need only find some argument to show that $a_n=a_{n-1}+a_{n-2}$ for $n\ge 2$, since we already know that $a_0=F_0$ and $a_1=F_1$.

Suppose that $n\ge 2$.

  • Show that there are $a_{n-1}$ compositions of $n$ into odd parts that have $1$ as their last part.
  • Show that there are $a_{n-2}$ compositions of $n$ into odd parts that do not have $1$ as last part.

Added: Sarah has pointed out to me in the comments that I failed to read the question carefully enough: the foregoing answer gives the total number of compositions of an odd number into odd parts, but it doesn’t break that down by the number of parts. Let me remedy that. Since we have the data, let’s take a look at a table showing the number of compositions of $n$ into $k$ odd parts:

$$\begin{array}{c|cc} n\backslash k&1&2&3&4&5&6&7&8&9\\ \hline 1&1\\ 2&0&1\\ 3&1&0&1\\ 4&0&2&0&1\\ 5&1&0&3&0&1\\ 6&0&3&0&4&0&1\\ 7&1&0&6&0&5&0&1\\ 8&0&(4)&0&(10)&0&(6)&0&(1)\\ 9&1&0&10&0&15&0&7&0&1 \end{array}$$

Blank entries are $0$. The four numbers in parentheses weren’t previously calculated; I added them to complete the table through $n=k=9$.

If you get rid of the zero diagonals, the remaining diagonals seem to be just the rows of Pascal’s triangle. If this is actually the case, and we let $a_n(k)$ be the number of compositions of $n$ into $k$ odd parts, then

$$a_n(k)=\binom{\frac12(n+k)-1}{k-1}\;.\tag{1}$$

(To see this, it’s helpful to realize that $n+k$ is constant along each of the diagonals in question.) Since it’s clear that

$$a_n(1)=\begin{cases} 1,&\text{if }n\text{ is odd}\\ 0,&\text{if }n\text{ is even}\\ \end{cases}$$

and $a_n(n)=1$ for all $n\in\Bbb Z^+$, $(1)$ will follow if we can show that

$$a_n(k)=a_{n-1}(k-1)+a_{n-2}(k)$$

holds in general; this is the counterpart of Pascal’s identity. And this recurrence has a fairly simple combinatorial justification. The last part of a composition of $n$ into $k$ odd parts is either $1$ or greater than $1$.

  • In the first case we remove the last part to get a composition of $n-1$ into $k-1$ odd parts and note that every composition of $n-1$ into $k-1$ odd parts can be extended to a composition of $n$ into $k$ odd parts by adding a $1$ part at the end.

  • In the second case we subtract $2$ from the last part to get a composition of $n-2$ into $k$ parts and note that every composition of $n$ into $k$ odd parts with a last part greater than $1$ can be obtained from a composition of $n-2$ into $k$ odd parts by adding $2$ to the last part.

Note that it’s still helpful to consider partitions of even integers into odd parts as well as partitions of odd integers.