Take the 2-minute tour ×
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.

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.

share|improve this question

3 Answers 3

up vote 8 down vote accepted

This is the Subset Sum Problem.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.