Sum of all possible products when each product has a maximum

Wentu
Messages
14
Reaction score
2
Hello

I have a set of sets of real numbers greater than 1. Each set can have a different quantity of numbers.
Set A1 {a11, a12,...a1m1}
Set A2 {a21, a22, ..., a2m2}
...
Set AN {aN1, aN2, ..., aNmN}

If I want the sum of all possible products that have one element from each set, that's easy: (a11+a12+...+a1m1)x(a21+a22+...+a2m2)x...x(aN1+aN2+...+aNmN).
But what i interested in is the sum of all possible products that have one element from each set BUT if the product is Higher than K, then the product must be included as K, not as its real value.
Short example:
Set A1 (2,3)
Set A2 (7,9)
K = 20
Usual sum = 14 + 21 + 18 + 27
Sum I am interested in: 14 + 20 + 18 + 20

What's the fastest way to calculate it? is it possible to do this with a neat formula or am I forced to cycle over all combinations?
Thankx

Wentu
 
Physics news on Phys.org
I don't see how to calculate this without any loops. You don't have to consider all combinations - as an example, if a1*a2*a3 > K and you have 10 sets, you can calculate m4*m5*...*m10 combinations at once as they all give K.
On the other hand, if a1*a2*a3 * (maximal element of A4) * ... < K, you can ignore the limit and calculate all sums as well. Starting the loops with a clever choice of sets could save some time, but that depends on the numbers.
 
Hi all, I've been a roulette player for more than 10 years (although I took time off here and there) and it's only now that I'm trying to understand the physics of the game. Basically my strategy in roulette is to divide the wheel roughly into two halves (let's call them A and B). My theory is that in roulette there will invariably be variance. In other words, if A comes up 5 times in a row, B will be due to come up soon. However I have been proven wrong many times, and I have seen some...
Thread 'Detail of Diagonalization Lemma'
The following is more or less taken from page 6 of C. Smorynski's "Self-Reference and Modal Logic". (Springer, 1985) (I couldn't get raised brackets to indicate codification (Gödel numbering), so I use a box. The overline is assigning a name. The detail I would like clarification on is in the second step in the last line, where we have an m-overlined, and we substitute the expression for m. Are we saying that the name of a coded term is the same as the coded term? Thanks in advance.

Similar threads

Replies
10
Views
6K
Replies
43
Views
12K
3
Replies
102
Views
10K
2
Replies
93
Views
11K
Replies
20
Views
8K
2
Replies
67
Views
14K
Back
Top