fibonacci numbers
the fibonacci numbers are defined by the following recurrence:
F[0]=0;
F[1]=1;
F[i]=F[i-1]+F[i-2]; for i >= 2;
this definition is known as before,but,there is another tricky way to compute fibonacci number F[i],which is nicer than it's original definiton;
this method is related to the golden ratio x and its conjugate !x,which are given by the following formula:
x = (1+5^(1/2))/2 = 1.61803;
!x = (1-5^(1/2))/2 = -0.61803;
with help of these two formulas, we can redefine the fibonacci number in a much more direct and useful way as the following formula:
F[i] = (x^i-!x^i)/5^(1/2);
of courese,it's not the precise value of fibonacci number,since it may be a real number but integer expected.but,it's useful still,since the exact result is the nearest integer of the real number computed by above formula.
after simple consideration,it's not easy to compute the value of x^i,since x itself is a complex expression to represent in computer.maybe it's useless.
F[0]=0;
F[1]=1;
F[i]=F[i-1]+F[i-2]; for i >= 2;
this definition is known as before,but,there is another tricky way to compute fibonacci number F[i],which is nicer than it's original definiton;
this method is related to the golden ratio x and its conjugate !x,which are given by the following formula:
x = (1+5^(1/2))/2 = 1.61803;
!x = (1-5^(1/2))/2 = -0.61803;
with help of these two formulas, we can redefine the fibonacci number in a much more direct and useful way as the following formula:
F[i] = (x^i-!x^i)/5^(1/2);
of courese,it's not the precise value of fibonacci number,since it may be a real number but integer expected.but,it's useful still,since the exact result is the nearest integer of the real number computed by above formula.
after simple consideration,it's not easy to compute the value of x^i,since x itself is a complex expression to represent in computer.maybe it's useless.
0 Comments:
Post a Comment
<< Home