Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

Combinations to find a given sum

$
0
0

I have a range of values ( 5 - 19), and each value occurs a different number of times (eg 5 - 2x, 6 - 2x, 7 - 5x, etc.).

I've found various combination calculators on the web, but they are limited in certain ways. Either they don't find a given sum and just list all possible combinations, or they list all combinations for a given sum but don't allow specifying each value's occurrence.

Any tips/suggestions?

Thanks, Pat

Edit: I would also like to specify that the "sample size" equals 3, eg these combinations of 3 values equals 40.

Edit 2: After further reflection, I think I can refine my question a bit more.

I have 80 objects in total, and each is assigned a value ranging from 5 - 19. I have multiple objects of each value. I would like to know the combinations of these 80 objects to equal 40, limiting each combination to 3 or 4 objects, and limiting the combinations by the occurrence of each value.


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>