Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Can you help with finding the formula for these input and output values?

When $n=1$:
$f\left(1,1\right)= 0.0000000000$

When $n=2$:
$f\left(1,2\right)= 0.0000000000$
$f\left(2,2\right)= 0.0000000000$

When $n=3$:
$f\left(1,3\right)= 0.3333333433$
$f\left(2,3\right)= -0.6666666865$
$f\left(3,3\right)= 0.3333333433$

When $n=4$:
$f\left(1,4\right)= 0.2500000000$
$f\left(2,4\right)= -0.2500000000$
$f\left(3,4\right)= -0.2500000000$
$f\left(4,4\right)= 0.2500000000$

When $n=5$:
$f\left(1,5\right)= 0.1428571492$
$f\left(2,5\right)= -0.0714285746$
$f\left(3,5\right)= -0.1428571492$
$f\left(4,5\right)= -0.0714285746$
$f\left(5,5\right)= 0.1428571492$

When $n=6$:
$f\left(1,6\right)= 0.0892857164$
$f\left(2,6\right)= -0.0178571437$
$f\left(3,6\right)= -0.0714285746$
$f\left(4,6\right)= -0.0714285746$
$f\left(5,6\right)= -0.0178571437$
$f\left(6,6\right)= 0.0892857164$

When $n=7$:
$f\left(1,7\right)= 0.0595238097$
$f\left(2,7\right)= 0.0000000000$
$f\left(3,7\right)= -0.0357142873$
$f\left(4,7\right)= -0.0476190485$
$f\left(5,7\right)= -0.0357142873$
$f\left(6,7\right)= 0.0000000000$
$f\left(7,7\right)= 0.0595238097$

When $n=8$:
$f\left(1,8\right)= 0.0416666679$
$f\left(2,8\right)= 0.0059523811$
$f\left(3,8\right)= -0.0178571437$
$f\left(4,8\right)= -0.0297619049$
$f\left(5,8\right)= -0.0297619049$
$f\left(6,8\right)= -0.0178571437$
$f\left(7,8\right)= 0.0059523811$
$f\left(8,8\right)= 0.0416666679$

When $n=9$:
$f\left(1,9\right)= 0.0303030312$
$f\left(2,9\right)= 0.0075757578$
$f\left(3,9\right)= -0.0086580086$
$f\left(4,9\right)= -0.0183982681$
$f\left(5,9\right)= -0.0216450226$
$f\left(6,9\right)= -0.0183982681$
$f\left(7,9\right)= -0.0086580086$
$f\left(8,9\right)= 0.0075757578$
$f\left(9,9\right)= 0.0303030312$

When $n=10$:
$f\left(1,10\right)= 0.0227272734$
$f\left(2,10\right)= 0.0075757578$
$f\left(3,10\right)= -0.0037878789$
$f\left(4,10\right)= -0.0113636367$
$f\left(5,10\right)= -0.0151515156$
$f\left(6,10\right)= -0.0151515156$
$f\left(7,10\right)= -0.0113636367$
$f\left(8,10\right)= -0.0037878789$
$f\left(9,10\right)= 0.0075757578$
$f\left(10,10\right)= 0.0227272734$

When $n=11$:
$f\left(1,11\right)= 0.0174825173$
$f\left(2,11\right)= 0.0069930069$
$f\left(3,11\right)= -0.0011655012$
$f\left(4,11\right)= -0.0069930069$
$f\left(5,11\right)= -0.0104895104$
$f\left(6,11\right)= -0.0116550112$
$f\left(7,11\right)= -0.0104895104$
$f\left(8,11\right)= -0.0069930069$
$f\left(9,11\right)= -0.0011655012$
$f\left(10,11\right)= 0.0069930069$
$f\left(11,11\right)= 0.0174825173$

When $n=12$:
$f\left(1,12\right)= 0.0137362638$
$f\left(2,12\right)= 0.0062437560$
$f\left(3,12\right)= 0.0002497502$
$f\left(4,12\right)= -0.0042457543$
$f\left(5,12\right)= -0.0072427574$
$f\left(6,12\right)= -0.0087412586$
$f\left(7,12\right)= -0.0087412586$
$f\left(8,12\right)= -0.0072427574$
$f\left(9,12\right)= -0.0042457543$
$f\left(10,12\right)= 0.0002497502$
$f\left(11,12\right)= 0.0062437560$
$f\left(12,12\right)= 0.0137362638$

When $n=13$:
$f\left(1,13\right)= 0.0109890113$
$f\left(2,13\right)= 0.0054945056$
$f\left(3,13\right)= 0.0009990010$
$f\left(4,13\right)= -0.0024975026$
$f\left(5,13\right)= -0.0049950052$
$f\left(6,13\right)= -0.0064935065$
$f\left(7,13\right)= -0.0069930069$
$f\left(8,13\right)= -0.0064935065$
$f\left(9,13\right)= -0.0049950052$
$f\left(10,13\right)= -0.0024975026$
$f\left(11,13\right)= 0.0009990010$
$f\left(12,13\right)= 0.0054945056$
$f\left(13,13\right)= 0.0109890113$

When $n=20$:

I'm not a maths expert hence the need to ask for help. Please make answer simple to understand.
Many thanks in advance for your time and intellect.

share|improve this question

closed as too localized by Steve D, Stefan Hansen, Jim, Asaf Karagila, Andreas Caranti Feb 26 '13 at 10:05

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

There are literally infinitely many formulas that will satisfy your requirements. How did this problem statement arise? Do you only want continuous formulas, or will a giant piecewise function suffice? Why do you want the solution to this problem? –  anorton Feb 15 '13 at 16:23
I have idea. Wait a few minutes. –  zaarcis Feb 15 '13 at 16:25
I agree that question is formed badly but I still like this problem. –  zaarcis Feb 15 '13 at 16:43
Looks like a quadratic parabola in the first argument to the naked eye (quick second difference check). The data are severely insufficient to say anything certain about the dependence of $N$. –  fedja Feb 15 '13 at 18:44
OK, this confirms that the answer you were given is indeed correct. (Both formulas, by zaarcis and fedja, are the same expression, written in different ways). // In fact, the formula is more precise than the data you have now, i.e., not all of your 10 digits are actually correct. For example, $f(1,5)$ is obviously $1/7$, but the precise decimal expansion for $1/7$ is $0.14285714\mathbf{2857}$, not $0.14285714\mathbf{92}$. Same in other places, e.g., "$f(1,9)=0.0303030312$" would be "$f(1,9)=0.0303030303$" if not for roundoff errors. –  user53153 Feb 19 '13 at 17:37

2 Answers 2

Let's name your function $f(k,n)$.

$f(1,3)=\frac{1}{3}$ and $f(1,n)=\frac{30}{n(n+1)(n+2)}$ for $n\geq 4$.
$f(2,n)=\frac{n-7}{n-1}f(1,n)$ for $n\geq 3$.

Now let's simplify (for $n\geq 4$).

$f(k,n)=\frac{(k-n)(k-1)}{n-2}\left(f(1,n)-f(2,n)\right)+f(1,n)=\\ =\left(\frac{(k-n)(k-1)}{n-2}\left(1-\frac{n-7}{n-1}\right)+1\right)f(1,n)=\\ =\left(\frac{(k-n)(k-1)}{n-2}\cdot\frac{6}{n-1}+1\right)f(1,n)=\\$ $$=\left(\frac{6(k-n)(k-1)}{(n-2)(n-1)}+1\right)\frac{30}{n(n+1)(n+2)}$$ Done.

$f(1,1)=0$ because $\sum_{i=1}^n f(i,n)=0$.
The same with $f(1,2)=f(2,2)=0$ (taking also in account that $f(i,n)=f(n-i,n)$.

Also added code in Python for OP: http://ideone.com/jPfyE5

share|improve this answer
In ref to: "There are literally infinitely many formulas that will satisfy your requirements. How did this problem statement arise? Do you only want continuous formulas, or will a giant piecewise function suffice? Why do you want the solution to this problem?" ..... N is variable, the post just examples N set to 10 and 20 ..... The formula is in a compiled dll, which is unaccessable because the programmer has disappeared and never left source. A basic programming language sends these 2 input values in which N is variable to the DLL and the DLL returns the answer. –  user62425 Feb 15 '13 at 17:56
Decompile it. Or kill it with fire! –  zaarcis Feb 15 '13 at 18:11
Anyway, can you give a few more examples (with different N examples)? Just to be sure. –  zaarcis Feb 15 '13 at 18:12
And do you have any (even microscopic) idea, what this dll of formula must be doing, can be doing or similar? –  zaarcis Feb 15 '13 at 18:20
Updated original post with N = 3 to 13, waiting on more data with more decimal places –  user62425 Feb 15 '13 at 21:21

OK, here is a partial answer:

$$ f(k,n)=a_n\left[\left(2\frac{k-1}{n-1}-1\right)^2-\frac{n+1}{3(n-1)}\right] $$

Now, to be frank with you, the dismal precision you have makes recovering the exact formula for $a_n$ (it depends on $n$ only) a headache. I'll try but I do not promise anything.

share|improve this answer
absolutely, i am expecting in the next 12 hours data with 10 digit precision, will upload as soon as i receive it –  user62425 Feb 16 '13 at 1:03
In principle, if zaarcis's guess about $f(1,n)$ is correct (and so far the data do not contradict it, between us two we have an answer: $a_n=\frac{45(n-1)}{(n-2)n(n+1)(n+2)}$ for $n>3$ and the same formula with $30$ instead of $45$ for $n=3$. Why $n=3$ is special beats me. However, to be completely certain, the high precision data would be wonderful. –  fedja Feb 16 '13 at 2:10
Maybe it's bug. –  zaarcis Feb 16 '13 at 3:46
Sorry it took so long, see revised posting with 10 digit precision data –  user62425 Feb 19 '13 at 15:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.