Number of $n$-permutations with repetition where $k$ occurs an odd number of times.

114 Views Asked by At

It's exactly like this question, but I don't understand what is $\textbf{1}_{2|j}$ in that answer and why does it expand to that. Here's what it says:

We can choose an even number $j$ of the $n$ places in which $k$ occurs and then choose the remaining elements in $(k−1)^{n−j}$ ways. Thus

\begin{align} b_n(k)&=\sum_{j=0}^n\binom nj(k-1)^{n-j}\mathbf1_{2\mid j}\\ &=\sum_{j=0}^n\binom nj(k-1)^{n-j}\frac12\left(1+(-1)^j\right)\\ &=\frac12\left(\sum_{j=0}^n\binom nj(k-1)^{n-j}1^j+\sum_{j=0}^n\binom nj(k-1)^{n-j}(-1)^j\right)\\ &=\frac12\left(k^n+(k-2)^n\right)\;. \end{align}

And in that answer, $b_n$ is the same number as this question, but with $k$ occuring an even number of times.
Also, I tried to solve this with exponential generating functions, but nothing came of it. I noticed that the exponential generating function for this would be $e^{t(k-1)}\frac{e^t-e^{-t}}2$, but multiplying them yielded $\frac12(e^{(x+1)(k-1)}-e^{(x-1)(k-1)})$, which doesn't look like anything to me.

1

There are 1 best solutions below

0
On BEST ANSWER

In the original answer, $1_{2|j}$ means $1$ if $2|j$ and $0$ otherwise, so it is equal to $\frac{1 + (-1)^j}{2}.$

The solution using a generating function is also not very difficult. Every element from $1$ to $k-1$ can occur any number of times in the permutation, and $k$ can occur only odd number of times. If some element occurs $t$ times, then we want to count it with the weight $\frac{1}{t!}$. Finally we take the coefficient next to $x^n$ multiplied by $n!$.

$$\begin{aligned} A(k)(x) = \left(1+x+\frac{x^2}{2!}+\dots\right)^{k-1} \cdot \left(x+\frac{x^3}{3!}+\dots\right) = e^{x(k-1)}\cdot\frac{e^x-e^{-x}}{2} =\\ = \frac{e^{xk}-e^{x(k-2)}}{2} = \sum_{n} \frac{k^n-(k-2)^n}{2} \cdot \frac{x^n}{n!} \end{aligned}$$