Determine if there is a subset of S that sums to floor(N/2) floor. Given S = {3,1,1,2,2,1}, a valid solution to the partition problem is the two sets S1 = {1,1,1,2} and S2 = {2,3}.

Let: p(i, j) be True if a subset of {x1, ..., xj} sums to i and False otherwise.

p(i, j) is True if { p(i, j − 1) is True -------(i) p(i − xj, j − 1) is True --------(ii) }

my understanding for (i) equation is: subset of { x1, ..., xj } that doesn't sum up to i but previous j-1 elements may sum up to i my understanding for (i) equation is: subset of { x1, ..., xj } that does use xj and that sums to i − xj (since xj + that subset's sum = i).

However my understanding doesn't work for the (ii) equation (j-1) part.

Why can't we have p(i − xj, j) only?