That depends on what you mean by pairs of numbers. If the only numbers you have are 1 and 2, then the only pairs are (1,1), (2,2), (1,2) and (2,1). That would certainly not be maximized. The left number is greater than the right number only once.
Hello,
Basically I have to construct a sequence that maximises the number of times such that given any pair of numbers, the left-hand one will be greater than the right-hand one. The sum of the positive integer sequence must be 2014.
An example is 7,4,1,3,2
We can select (7,4) ; (7,1) ; (7,3) ; (7,2) ; (4,1) ; (4,3) ; (4,2) ; (3,2) such that the number occurring first is greater than the number occurring last (i.e. LH number > RH number)
So far I figure it will be {2,2......,2,2} (504 2s) and then {1,1,.....,1,1} (1006 1s). \
The two reasons for this are that we should keep a maximum difference at one between numbers otherwise we are unnecessarily adding numbers. The second is that the use of only 2s and 1s will assist in keeping the sum small.
Is this correct and is there a formal way of writing what I have said if it is correct?
Thank you
That depends on what you mean by pairs of numbers. If the only numbers you have are 1 and 2, then the only pairs are (1,1), (2,2), (1,2) and (2,1). That would certainly not be maximized. The left number is greater than the right number only once.
I mean if you have a sequence such as 2,2,2,2,1,1,1,1 then the first two can be paired with all of the four ones because it is greater than all of them. The same can be said for the second, third and fourth 2s. The pairs need not be distinct pairs either. So we can have (2,1) repeated 16 times - thus 16 pairs with the earlier number being greater than the later number.
Suppose you have 1's, 2's, 3's, etc.
Then . Let's count the pairs where the left number is bigger than the right. There are pairs with . So, there are total pairs of the form you want. Try solving for one variable, plugging it into the formula, taking partial derivatives with respect to one variable, setting it equal to zero and solving for that variable. Plugging it back into the formula, etc.
You could also say that 2014 = a + 2x and you are trying to maximize y = ax (where y is the number of pairs where the left number is bigger than the right, a is the number of 1's, x is the number of 2's). Solving for a, you get a = 2014-2x. So, you are trying to maximize y = (2014-2x)x = 2014x-2x^x. If x is a real number, this is a parabola, so it rises, then falls. Since x=503 and x=504 give the same value for y, it reaches its maximum between those two points. So, using only integers, either is valid.