Finding how many times an integer appears in all compositions

160 Views Asked by At

Suppose $n \geq 4$, show that in a list of all compositions of $n$, the integer $3$ appears exactly $n(2^{n-5})$ times.

To show an example of this in action take all the compositions of $4$:

$(4), (\textbf{3},1) , (1,\textbf{3}) , (2,2) , (1,1,2) , (1,2,1) , (2,1,1) , (1,1,1,1)$

We can clearly see $3$ appears $2$ times. Now the statement holds true as $4(2^{4-5}) = 4\cdot0.5 = 2$

The way I'm going around thinking about this is a method of 'drawing dots'. So for example if i wanted to find the number of times $3$ appeared in compositions of $5$ I would draw $5$ dots:

$\cdot\cdot\cdot\cdot\cdot$ And put lines in the spaces to show how many combinations there are:

$(\cdot\cdot|\cdot\cdot\cdot)$ , $(\cdot\cdot\cdot|\cdot\cdot)$ So when you input $1$ line then there are $3$ compositions where 3 appears.

$(\cdot|\cdot|\cdot\cdot\cdot)$ , $(\cdot|\cdot\cdot\cdot|\cdot)$ $(\cdot\cdot\cdot|\cdot|\cdot)$ When you input $2$ lines then there are now $3$ compositions where $3$ appears. So $5$ compositions in total. Now to check this:

$5(2^{5-5}) = 5\cdot1 = 5$ so the method works. The problem I'm having is having no idea how to begin generalising this method to all values of $n\geq4$.

1

There are 1 best solutions below

0
On

Each $3$ in a composition of $n$ can be deleted to get a composition of $n-3$, and if this happens, we may mark the position that the $3$ becomes. This can happen at either end of the composition, or it can happen in the middle, leaving a bar between our parts. So we have a bijection between $3's$ in $n$, and the sum of $\text{#}bars + 2$ over all compositions of $n-3$. But $\text{#}bars + 2=\text{#}parts+1$.

The sum of the parts in the compositions of $k$ is $(k+1)2^{k-2}$, which can be seen by grouping each composition with its conjugate(flipping bars/gaps), and there are $2^{k-1}$ compositions of $k$.

So letting $k=n-3$, this gives $(n-2)2^{n-5}+2^{n-4}=n2^{n-5}$, as desired.