Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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|cite|improve this question
up vote 9 down vote accepted

This is the Subset Sum Problem.

share|cite|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|cite|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|cite|improve this answer

Your Answer


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.