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

It's possible that this question is trivial and I've overlooked something.

Let us impose the following constraint on the well-known PARTITION problem: in all inputs of a new problem the number of elements is fixed and equals $k$?

Does such constraint make PARTITION polynomially solvable?

P.S. There is pseudopolynomial algorithm for it with running time $\mathcal{O}(nA)$, where $A$ is the sum of the numbers in the given input. However, fixing $n$ doesn't seem to make it polynomial in $\log A$. Or am I missing something?

share|cite|improve this question
up vote 2 down vote accepted

Yes. The problem becomes in $P$. The reason is that there would be a fixed number of partitions bounded by $O(2^k)$ which is a constant. You do not need the $O(nA)$ dynamic programming algorithm.

share|cite|improve this answer
Of course, you're right. Thanks. – Oleksandr Bondarenko Feb 5 '11 at 1:06

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.