Need help -- math minds required :p

AdmiralAK

Simply Daemonic
OK I have been given a function which I have optimized. It creates a sum of running values.


I have been asked to further optimize it (so I have to create a function out of this :p)


the output for f(x) = y for a few values is:



f(0) = 0
f(1) = 0
f(2) = 1
f(3) = 9
f(4) = 36
f(5) = 100
f(6) = 225

Anyone see a pattern here? I have been playing around with it all weekend long and still no answer :p



Admiral
 
Your data (as I'm sure you already know) is continuously increasing, I pulled this function out of my ass:

f(x)=11.642857142857x^2 + -37.357142857142x + 13.714285714282

lim f(x)=0
x -> inf.

That's a 'best-fit' scenario .. and is actually a quadratic, so it doesn't have limits but maybe it'll help ya. Do you need this to be a more specific model?
 
close but no cigar ;)

I need to put this function that I derive into a C method to be called so it must produce teh same results.


the loop which does the sum is

for(i=0; i<n; i++){
s+= i^3;
}



I prefer graphics representations (which I was able to do :p) -- I just cant derive a function from it lol


Admiral
 
lol I wish ;)
I have never used it :)
anything to help me now would be a savior :p (I am currently answering the question without answering it ;)
 
Try f(x) = x^2 * (x-1)^2 / 4. Every number you listed is a perfect square, that is
f(0) = 0^2
f(1) = 0^2
f(2) = 1^2
f(3) = 3^2
f(4) = 6^2
f(5) = 10^2
f(6) = 15^2
and those numbers are 0, 0, 0+1, 0+1+2, 0+1+2+3, 0+1+2+3+4, 0+1+2+3+4+5... Lastly, the sum 1+2+...+n is known to be n(n+1)/2.
 
Back
Top