2

I'm reading this over at the Khan Academy and they use the function $f(n) = 6n^2 + 100n + 300$ in their opening discussion of asymptotic boundaries of algorithms. My question is not specific to this example, but general, that is, how are such functions determined from (I'm guessing) raw data? I can see a graph of a parabola and I know from my (bad) school math that a parabola-shaped curve usually means some sort of exponential function. But in general, by what methodologies are functions derived from data in the real world? So plotting software spits out plots from functions. Is there software that goes the other way and spits out functions from plots or data sets?

147pm
  • 920

1 Answers1

4

The link discusses about running time of algorithm. When we design an algorithm, usually we are able to analyze the complexity of an algorithm since we know the algorithm. We are able to count the number of operations and hence we are able to come out with a terms that describe the complexity.

In general, given a data set, the task of fitting a function to a data is known as regression.

Edit:

Suppose for some reason, we are given a black box algorithm (i.e. we have no idea what is being implemented, we just know what is being solved.) but we can run the algorithm and we are interested in estimating the running time for a particular $n$. We can run the algorithm using various inputs and various $n$ and try to fit a regression line through the data that we collect.

Siong Thye Goh
  • 149,520
  • 20
  • 88
  • 149