# Adding a function of a subset over all possible subsets

I had asked this question on Math.SE earlier here, but didn't get any response, and I realize that this may be a better fit here:

So the context that I have for this problem comes from what I'm currently working on, but I can reduce the point that I'm stuck at to a more abstract problem. Since it stems from another problem, I can give more details about the nature of relevant terms if it simplifies anything.

Consider some set of positive numbers $X=\{x_1\cdots x_n\}$. Let $S_k$ be a $k$ element subset of $X$. Define $D_{S_k} = \sum_{x\in S_k} x$.

What I'm interested in is expressing $\sum_{S_k} f(D_{s_k})$ in terms of statistics of the set $X$ and the function $f$, where $\sum_{S_k}$ is to be interpreted as a sum over all possible $k$ element subsets of $X$.

Now, for simple functions like $f(x)=x$, I can show that $$\sum_{S_k} D_{s_k} = \sum_{S_k} k\langle X\rangle = \binom{n}{k}k\langle X \rangle$$ and similarly for $f(x)=x^2$ I can show that $\sum_{S_k} D_{s_k}^2 = \binom{n}{k}\times\left((k\langle X \rangle)^2 + k (\langle X^2 \rangle - \langle X \rangle^2)\right)$.

I can similarly solve for $f(x)=x^n$. Now where I'm stuck at, is in getting expressions for when $f(x)=1/x^n$. Of course if someone could tell me how to go about doing this for general $f$ that would be great, but right now just $f$ in this form would be pretty helpful.

If it helps, in my context $x_i\in \mathbb{N}$.

• Math.SE copy: math.stackexchange.com/questions/1972732/… (currently with a bounty) – Martin Sleziak Nov 4 '16 at 6:25
• @MartinSleziak: I've added the link to the Math.SE question in my post above. Thanks. – SarthakC Nov 4 '16 at 14:13
• It's important always to acknowledge at the time of writing, at each site where you cross-post, every other site where you cross-post. Thanks. – Todd Trimble Nov 4 '16 at 14:15
• @ToddTrimble: I'll keep that in mind from next time onwards. – SarthakC Nov 4 '16 at 14:15
• What $\langle X\rangle,\langle X^2\rangle$ mean? – Matemáticos Chibchas Nov 5 '16 at 22:48