- #1
Wentu
- 14
- 2
Hello
I have N couples of real numbers higher than 1.
Let's call them like (a0,b0), (a1,b1),...,(aN,bN)
I have a number R <= N.
I need the sum of all the possible products of N elements, chosing one from each couple but exactly R times the "b" element and N-R times the "a" element.
Which is the best way to do it?
As an example:
(2,3), (5,7), (11,13)
N = 3, R = 2
I need 2x7x13 + 3x5x13 + 3x7x11
Thank you!
I have N couples of real numbers higher than 1.
Let's call them like (a0,b0), (a1,b1),...,(aN,bN)
I have a number R <= N.
I need the sum of all the possible products of N elements, chosing one from each couple but exactly R times the "b" element and N-R times the "a" element.
Which is the best way to do it?
As an example:
(2,3), (5,7), (11,13)
N = 3, R = 2
I need 2x7x13 + 3x5x13 + 3x7x11
Thank you!