## Search found 1 match

- Tue Jun 04, 2019 9:54 am
- Forum: Combinatorics
- Topic: Sum of products of n-tuples
- Replies:
**3** - Views:
**3470**

### Re: Sum of products of n-tuples

Let's say I have an array of numbers {a,b,c,d,e} and want to calculate the sum of product of all triples abc+abd+...+cde. I can calculate it very fast without generating all triples using this formula F(n,k)= v[k]*F(n-1, k-1)+ F(n-1, k) with two loops int[] values={a, b, c, d, e...}; int k = 3; int...