Hmm. Interesting. What is the value of the function on those permutations?
Hmm. Well, I've written my own little program in Mathematica to find the minimizing permutation. The winner I found was your sixth permutation. The function's value at that permutation is smaller, by a very small amount, than the function's value at the first permutation. It also beats out the second permutation, by a very little bit. I wonder if your integer arithmetic is hiding some numerical errors in computation such as round-off error. Mathematica has arbitrary-precision arithmetic, so I'm thinking that you might want to increase the precision of your computations.
The sixth permutation that you found does do this alternating about the mean, to some extent. The first two values are actually both higher than the mean; after that, they alternate. However, I can't see any discernible pattern in the order of the numbers above or below the mean.
I've attached my Mathematica code, and a few plots, for you to see.
yeah, you're wright, looks like i have a bug somewhere. however, there are still 4 permutations with the same result. there must be a pattern but it looks like it's really complicated...
i'm giving up on this one. this is for a collage project, so i'll just tell my mentor that i can't do it...
anyway, it's getting late here in croatia, tnx for your efforts...
Interesting thread. The problem reminds me of this one on Project Euler (I hide the link because the site is pseudo-competitive and this post could be considered a hint at how to solve it):
although the resemblance might only be superficial. The fastest solver of that problem used a random-restart hill climbing algorithm, which might be usable here. Of course a closed-form solution if one exists would be nice. I'll be looking into this as time allows and hopefully can report back before too many hours pass (and hopefully with something to contribute).Spoiler:
I asked my father about this problem, and he had some very helpful ideas. Let's take the original function f:
We can multiply this function by a positive constant, and not change the minimums. We wish to multiply by
Define as the mean. Then
Define Then we have to minimize the function
Note that the sum of the 's from 1 to 50 will give exactly zero. This means that the above can be rewritten as:
Examination of this last expression will show that if 1 is exchanged with 50, 2 with 49, etc., that the formula will remain unchanged. (This corresponds to a complete mirror image switch.)
Writing out the equation longhand will reveal a strategy for selection of placement of the resistors:
Note that the delta for 26 is missing. As one can see, the lower numbers and the higher numbers both should have small deltas, because they appear the most frequently. Also, it would seem that alternate signs of the deltas would be good in cancelling out at least some of the quantities in the parentheses. Therefore, it would seem to be a good strategy to go from ends to middle using smaller alternating deltas until the resistors in the center of the array have the largest departure from the mean.
Based on the analysis in post # 22, you want to start at both endpoints and work your way to the center. The endpoints themselves need to be the two resistors that are closest to the mean. As you work your way in, you want to alternate values that are above and below the mean. (This corresponds to delta values that are positive and negative.) Also, you will generally want to pick more and more oscillatory values - that is, ones that are farther and farther away from the mean. If I were to plot the envelope of the resistances, it would look something like this. Think of the x-axis here as the mean of the resistance values.
Make sense? That is generally what the solutions we've found look like, with some small possible exceptions. The point is, you can find a permutation that gets your function quite small, even if it isn't the global minimum.