I have a set of integers $\{8, 8, 6\}$. I want to know if It is possible to get $21$ by adding a subset of them. I would like to know how is the problem called so that I can google it.
Tell me more
×
Mathematics Stack Exchange is a question and answer site for
people studying math at any level and professionals in related fields. It's 100% free, no registration required.
|
This is the Subset Sum Problem. |
||||
|
|
|
This "set" is an example of what is sometimes called a "multiset": it allows one member (in this case 8) to have multiple memberships in it rather than only one. You can't get an odd number such as 21 by adding even numbers. |
|||
|
|
|
Your question is slightly flawed: $\{8,8,6\}$ is not a set of integers, because it contains a repetition. (Or rather, it is a set of integers, but it only contains the two elements $8$ and $6$.) If you really did mean "set of integers", then rattle's answer is correct. If you meant "sequence of integers", as suggested by your example, then this is the Knapsack Problem. The Subset Sum Problem is a special case of the Knapsack Problem. |
|||
|
|