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?
-
1Look into curve fitting or regression. It is kind of a large topic in general but the basics are not that bad. – Ian Sep 05 '17 at 21:16
-
Nice question - I had the same problem when I read the post in KA. Notice this. – Antoni Parellada Sep 05 '17 at 21:28
1 Answers
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.

- 149,520
- 20
- 88
- 149
-
Regression is a huge topic... Can you provide some reader's digest explanation as to how it is applied to calculating algorithm times, if this is indeed the case? – Antoni Parellada Sep 05 '17 at 21:37
-
-
-
^_^ Welcome. Remember who introduced you to it when I ask a question $\ddot \smile$ – Git Gud Sep 05 '17 at 21:51
-
@AntoniParellada Goh is actually registered at Cross Validated, even though it doesn't seem like he goes there much. Plus, I assume, perhaps wrongly, that anything ML-related is better suited for DS SE. – Git Gud Sep 05 '17 at 23:34