I'm reading this over at the Khan Academy and they use the function f(n)=6n2+100n+300 in their openi

shmilybaby4i

shmilybaby4i

Answered question

2022-06-19

I'm reading this over at the Khan Academy and they use the function f(n)=6n2+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?

Answer & Explanation

Cahokiavv

Cahokiavv

Beginner2022-06-20Added 31 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.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?