Subset Sum:
Input: {a1,a2,...,am} s.t M={1..m} and ai are non negative integer
and S⊆{1..k} and Σai(i∈S) = t
Partition:
Input: {a1,a2,...,am}
and S⊆ {1,· · ·,m} s.t Σai(i∈S) = Σaj(j∉S)
Partition Np Proof:
if prover provides a partitions(P1,P2) for verifier, verifier can easily calculate the sum of P1 and P2 and check if the result is 0 in linear time.
NP_Hard: SubsetSum ≤p PARTITION
Let x be input of SubsetSum and x=〈a1,a2,...,am,t〉 and Σai(i from 1 to m) = a
Case1: 2t >= a:
Let f(x)=〈a1,a2,...,am,am+1〉 where am+1= 2t−a
We want to show that x∈SubsetSum ⇔ f(x)∈PARTITION
so there exist S⊆ {1,...,m} s.t T = {1..m} - S and Σai(i∈T) = a-t
and Let T' = {1...m,m+1} - S so Σaj(j∈T') = a-t+2t-a = t
which is exactly Σai(i∈S)= t and it shows f(x)∈PARTITION
now We also will show that f(x)∈PARTITION ⇔ x∈SubsetSum
so there exist S⊆ {1,...,m,m+1} s.t T = {1,...,m,m+1} - S and Σai (i∈T)= [a+(2t-a)-t]=t
and it shows Σai(i∈T) = Σaj(j∈S) so m+1∈T and S⊆ {1,· · ·,m} and Σai(i∈S)= t
so x∈SubsetSum
Case 2: 2t =< a :
we can check same but just this time am+1 is a−2t