Is there any function which can multiply the combination of numbers and then add them?

57 Views Asked by At

Is there any function which can multiply the combination of numbers and then add them?

For example consider the function which I made, $$C_2(5,6,7)=5 × 6+6 × 7+5 × 7=107$$ or $$C_3(1,2,3,4)=1 × 2 × 3+2 × 3 × 4+4 × 1 × 2+3 × 1 × 4=60.$$

Hope you get it.

Is there any formal notation which is used by everyone?

4

There are 4 best solutions below

0
On

What about this one? $$C_3(a,b,c,d)=abcd\left(\frac1a+\frac1b+\frac1c+\frac1d\right)$$

or even more compact:

$$C_{n-1}(x_1,\ldots,x_n)=\prod_{k=1}^nx_k\left(\sum_{k=1}^n\frac 1{x_k}\right)$$

1
On

What you're after is called elementary symmetric polynomials. Those are extremely useful devices to relate the roots and the coefficients of a polynomial.

For instance, if $a$ and $b$ are the roots of a monic polynomial of degree $2$, then its coefficients are (up to sign) $a+b$ and $ab$, namely $C_1(a,b)$ and $C_2(a,b)$:

$$(X-a)(X-b)=X^2-(a+b)X+ab$$

The common notation for your $C_i$ is in fact $e_i$ - you were quite close!

0
On

Denote by $\binom{S}{k}$ the set of $k$-element subsets chosen from $S$. Then your function is

$$ C_m(S) = \frac{1}{2}\sum_{T \subset \binom{S}{m} } \prod_{t \in T} x_t $$

where $S =\{ x_1, x_2, \ldots , x_n\}$.

0
On

How about $$c_x(\{a_1, a_2, ..., a_n\})=\sum_{\substack{I\subset\{a_1, a_2, ..., a_n\};\\|I|=x}} \prod_{i \in I}i \phantom{¯\_(ツ)_/¯}?$$