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.

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

Partition problem is well known ( ).

Let's add an additional condition: sizes of both sets should be equal. Is there a pseudo-polynomial solution to that problem?

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

Yes. Given a list $S$ of positive integers, add $\max(S)\cdot \mathrm{length}(S)$ to each element, and denote the resulting list by $S'$. Run the algorithm for the partition problem on $S'$, and accept if and only if it accepts. This is correct because partitions $S'=S'_1\cup S'_2$ are equivalent to partitions $S=S_1\cup S_2$ where $|S_1|=|S_2|$.

share|cite|improve this answer
My kudos for a nice method! I suppose that $\sum(S)$ instead of $\max(S)\cdot \mathrm{length}(S)$ is also satisfies the solution, right? – alexander.myltsev Oct 19 '12 at 14:25
Yep. Another reduction would be to send $s\in S$ to $1+s\cdot \mathrm{length}(S)$. – Colin McQuillan Oct 19 '12 at 14:43

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.