0

I am not sure which level cure it will be, what I have is domain and range for it which are as follows.

f(0) = 0
f(1) = 1
f(2) = 1
f(3) = 3
f(4) = 5
f(5) = 8
f(6) = 13
f(7) = 21
f(8) = 34
f(9) = 55
f(10) = 89

It's programmaticly tough to find out the values beyond f(10) hence is there any way i can figure it out mathematically.

As a wild guess I think is will repeat after some interval so must be a curve but any lead is appreciated !

CMouse
  • 103
  • 2

1 Answers1

1

Put the data in a Mathematica list:

data = {{0, 0}, {1, 1}, {2, 1}, {3, 3}, {4, 5}, {6, 13}, {7, 21}, {8, 34}, {9, 55}, {10, 89}}

Plot it:

ListPlot[data]

enter image description here

Looks exponential. Try a fit:

fit = NonlinearModelFit[data, a Exp[b x] + c, {a, b, c}, x]

We get a FittedModel object in return. The fit is very good:

fit["RSquared"]

0.999952

The best fitting model is

fit["BestFit"]

-0.490631 + 0.774275 E^(0.474907 x)

Marius Ladegård Meyer
  • 6,805
  • 1
  • 17
  • 26
  • I skipped some inputs, although i got your answer, just wanted to notify that the question was changed, Thanks ! – CMouse Jun 02 '17 at 09:40
  • I do not understand, can you give links to how you did it ? and how do i get the equation of line is it -1.74487 + 1.33712 E^(0.468692 x) ? – CMouse Jun 02 '17 at 09:51
  • Yes, that is the function that best fits the points. The commands I've written in my answer is the way I did it: the code should be clear enough, if you read the documentation for NonlinearModelFit. You do realize this is the SE for the software Mathematica by Wolfram, right...? You don't mention it in your OP. – Marius Ladegård Meyer Jun 02 '17 at 09:54
  • Then you have posted on the wrong StackExchange site. – Marius Ladegård Meyer Jun 02 '17 at 10:01
  • Can you please correct your answer according to the corrected inputs, so that I can accept the answer as correct ? – CMouse Jun 02 '17 at 10:11
  • Done :) Notice that the best fit function has changed a little now, of course – Marius Ladegård Meyer Jun 02 '17 at 10:24
  • Of course, I tried it myself, thanks for introducing me to Mathematica !! – CMouse Jun 02 '17 at 11:32