Splitting Up a Number
Question
Given some
Solution
Consider some valid partition
And let:
Note that all natural numbers > 1 can be written as a sum of 2s and 3s exclusively, ie
What we will now show is that taking all the elements in the partition and breaking
them up into 2s and 3s, will give a better partition.
Lemma 1: The product of some sequence of 2s and 3s is always greater or equal to the corresponding sum with equality holding iff the sequence is (2, 2), (2,) or (3,). Proof:
Hence if:
Then
With equality holding iff
This implies that there will be no more than two lots of 2s in the optimal partition.
If
For 1) we can choose from (1, 3 k times) or (2, 2, 3 (k - 1)) times. Given 2 * 2 > 3 * 1
we can identify the latter case as optimal.
For 2) the only option containing no ones or less than three 2s is (2, 3 k times).
Question Extension
What if
Extension Solution
Unlike the previous solution we will use some calculus. Consider:
Where
Note the two tuples have the same sum but:
From this it is apparent that all elements of the optimal partition must be the same
number. Let this number be
For some constant
Rewrite
We find the stationary point by differentiating and equating to 0:
Hence the sole stationary point of the function occurs at
Then we can identify the stationary point as a global maximum of the function, and
reason that our desired kn lies somewhere around