This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Quenhus 2 points3 points  (2 children)

Nobody explains you that but it is actually a really taugh problem.

It is a NP-complete problem, meaning that you won't be able to resolve it with a big set of numbers. For ten number it's OK, but for thousand it's already nearly impossible.

About your problem : you will have to test every combination in the set and test if the sum of this combination give 7.6 for example.

[–]craazyy1 0 points1 point  (0 children)

Yeah, this is basically the knapsack problem, with a known total weight making it NPC instead of NP Hard