I have the following function defined, with two inputs $g$ and $h$:
F[g_, h_] := (((-1)^h)/(2^(2*g - 2*h - 3)))*
Sum[((-1)^k)*
Binomial[2*g - 2, k]*((2*k - 2*g + 2)^(2*h + 2*g - 2))/((2*h + 2*g - 2)!),
{k, 0, g - 2}];
Now, what I want to consider mathematically are ordered partitions of an integer n, i.e. decomposing $n$ as a sum of smaller, positive integers such that order does matter. So $4+1$ and $1+4$ are distinct ordered patitions of $5$.
Let $\mathcal{P}_{n}$ denote the collection of ordered partitions of $n$. I want to think about such partitions in the following way: imagine $n$ objects. There will be $n-1$ slots between them. One can imagine possibly placing dividers in these slots. Therefore, one should think of an ordered partition as
$$\pi=\{ \, \pi_{1} \,| \, \pi_{2} \, | \, \cdots \, |\, \pi_{n-1} \, \}$$
where the $\pi_{i}$ are the number of the $n$ objects (possibly 0) lying in the $i$-th compartment. (I'm sorry for not phrasing this terribly well, but I hope it's clear what I mean). Now, using my function in Mathematica defined above, I would like to carry out the following sum over ordered partitions:
$$\sum_{\pi \in \mathcal{P}_{n}}(-1)^{\epsilon_{\pi}} F[g_{1}, \pi_{1}] \cdot F[g_{2}, \pi_{2}] \cdots F[g_{n-1}, \pi_{n-1}]$$
where the $g_{1}$ are really any integers larger or equal to 2, and $\epsilon_{\pi}$ is even if the number of non-zero components of $\pi$ is even, and odd otherwise.
Can someone please help me get Mathematica to compute these numbers? I'm getting better with numerics, but don't even know where to start when it comes to something as abstract as ordered partitions. Oh yeah, and this functions is every tame, so this sum really should just be a number which is very quick to output.
EDIT: I should clarify what I mean by $\pi$ above. So I imagine a set of $n$ objects, with "labeled" barriers between them. Meaning the $i$-th barrier, if it is present, is necessarily between the $i$ and $i+1$-th object. So for example, I want
$$\{ \cdot \,\ \cdot \,\,| \,\,\cdot \,\, | \,\,\cdot \}$$
to correspond to the partition $\pi = \{2 | 0 | 1 | 1\}$ of $4$; the $0$ is because the second barrier is not present.
IntegerPartitions
$\endgroup$PadLeft[{4}, 5]
. To get all of the ordered partitions for a particularn
, you may try this function:orderedPartitions[n_] := Flatten[#, 1] &@(Permutations /@ IntegerPartitions[n, {2, n - 1}]);
. Does this give you what you want? $\endgroup$