Sum over subsets of $\{1,2,\ldots,n\}$ of terms involving a product over that subset

910 Views Asked by At

I'm attempting to perform a sum, using products, using all possible combinations, in a function.

How would I go about doing this? (I really need to find something that works.)

For example, say I wanted to, for a range of values, say $n = 1$ to $3$, find the sum of

$\dfrac{g(x)}{f(1)f(2)}$ , $\dfrac{g(x)}{f(1)f(3)}$ , $\dfrac{g(x)}{f(2)f(3)}$ , $\dfrac{g(x)}{f(1)f(2)f(3)}$

If I were to use $1$ to $4$, I would be summing:

$\dfrac{g(x)}{f(1)f(2)}$ , $\dfrac{g(x)}{f(1)f(3)}$ , $\dfrac{g(x)}{f(1)f(4)}$ , $\dfrac{g(x)}{f(2)f(3)}$ , $\dfrac{g(x)}{f(2)f(4)}$ , $\dfrac{g(x)}{f(3)f(4)}$ ,

$\dfrac{g(x)}{f(1)f(2)f(3)}$ , $\dfrac{g(x)}{f(1)f(2)f(4)}$ , $\dfrac{g(x)}{f(1)f(3)f(4)}$ , $\dfrac{g(x)}{f(2)f(3)f(4)}$ ,

$\dfrac{g(x)}{f(1)f(2)f(3)f(4)}$

You get the idea. The sum I would need to do for a range of values obviously balloons really fast. Going to $20$ or $100$ would be ludicrous.

Is there any notation for this at all?

I can't see how to do it with any of sigma, pi, or combinatorial notation.

I'm finishing a degree in Computer Science, so I can easily calculate such a thing. I just need it on paper for the sake of some proofs I want to attempt.

What can I do? Thanks!

1

There are 1 best solutions below

0
On BEST ANSWER

To make the answer nicer, let's suppose you are also summing
$$ \frac{g(x)}{1}, \; \frac{g(x)}{f(1)}, \; \frac{g(x)}{f(2)}, \; ... \, , \; \frac{g(x)}{f(n)}$$

If you don't want these terms you can just subtract the following from the answer

$$\begin{array} ( g(x) + \sum \tfrac{g(x)}{f(k)} \end{array}$$


One way to write this is as a sum over the subsets of $[n] = \{1,2,...,n\}$. For example $\tfrac{g(x)}{f(2)f(3)f(4)}$ would correspond to the subset $\{2,3,4\}$. The set of subsets is known as the power set, which is often denoted $2^{[n]}$.

$$ \sum_{p \, \in \, 2^{[n]}} \frac{g(x)}{\prod f(p_i)}$$

This formula does make it clear what you are counting, but it's not particularly useful since there are $2^n$ summands. A better answer is the following

$$ \\ g(x) \prod_{k=1}^n \left(1 + \frac{1}{f(k)} \right) \\ $$

To see how this corresponds to your sum, let's forget about $g(x)$ and take a look at the product

$$ \\ \left(1 + \tfrac{1}{f(1)} \right) \left( 1 + \tfrac{1}{f(2)} \right) \left(1 + \tfrac{1}{f(3)} \right) \; ... \; \left(1 + \tfrac{1}{f(n)} \right) \\$$

When you multiply this out you will get a sum of $2^n$ terms, just like when summing over the subsets. Each term corresponds to selecting either the (1) or $\tfrac{1}{f(i)}$ in each bracket and then multiplying them together. Suppose I wanted the $\tfrac{1}{f(2)f(3)f(4)}$ term. I choose $\tfrac{1}{f(2)},\, \tfrac{1}{f(3)}, \, \tfrac{1}{f(4)}$ from their respective brackets and choose (1) from all the rest.