I want to compute this sum: $$\sum_{S\,\subseteq\,Q} f\left(S\right)$$ where $Q$ is some finite set with $n$ elements. I think the first step should be: $$\sum_{i=0}^{n}\left(\sum_{S\,\subseteq\,Q\,;\,\vert S\vert\, =\,i}f\left(S\right)\right)$$
which can be useful if $f$ depends on $\vert S\vert$. Can the order of summation be interchanged?? I honestly don't know how to do it (if it can be done). The conditions $i=0,1,2,\dots,n$ and $\vert S\vert=i$ don't seem very "compatible" because there is no natural total order in $\{ \,S\subseteq Q:\vert S\vert=i\,\}$
Thanks in advance
In case the cardinality of the set $Q$ is finite and the function $f$ takes real values, then adding finite real numbers with any order , would always give the same result-sum.