I came across a particular problem wherein I think the answer would necessitate me to partition $U=\{1,2,3,...n\}$ into subsets $A$ and $B$ such that the sum of the elements in $A,B$ is at minimum.
To show that it is in minimum, the following should hold:
Let:
$sumA$ be the sum of the elements in $A$
$sumB$ be the sum of the elements in $B$
Then $sumA,sumB$ is at $minimum$ when $|sumA-sumB|$ is at $minimum$.
Possible Cases:
We are actually looking for all subsets of $U$. The number of subsets of $U$ is $2^n$.
Example: Let $U$={1,2,}. Then the number of subsets are $2^2=4$:
$\{1,2\}$,$\{1\}$,$\{2\}$,$\{\}$
We will drop $\{1,2\}$,$\{\}$ since they irrelevant to our task. So there should be $2^n-2$ possible subsets to be paired, in this case $\{1\}$,$\{2\}$.
Let $p$ be the possible subsets, then: $$p=2^n-2$$
The number of ways to arrange these subsets into $2$ sets is $p\cdot\ (p-1)=2^n-2 \cdot\ (2^n-3)$.
Problem: My problem is to figure out what will be the exact combination of subsets $A,B$ such that $sumA$ and $sumB$ is at the minimum. Any help would be very helpful.
Split them into consecutive groups of $4$ starting with the largest ( so the first block is $\{n-3,n-2,n-1,n\}$ ) and in each group $\{a,a+1,a+2,a+3\}$ split them so $a$ and $a+3$ are in $A$ and $a+1$ and $a+2$ are in $B$.
If the number of elements is a multiple of $4$ we are done.
If the remainder is $1$ put $1$ in $A$.
If the remainder is $2$ put $1$ in $A$ and $2$ in $B$.
If the remainder is $3$ put $1$ and $2$ in $A$ and $3$ in $B$.
It is not hard to see this is optimal.