Hello! I need to answer this question asap, but I don't know how exactly to do so. Could you help me, please?
In theory, the execution time T of a program should be a linear function of the size N of one it's inputs. Ideally, we should have T=aN+b, for the real constants a and b. But when the program was tested, the actual values were:
a) Write the function f(a,b) of the sum of the squared erros.
b) Find the values of a*,b* that minimize f.
I didn't understand how should I do the first one. I found out that the actual function of the program is g(N)=5N2/6 - 5N/6 + 5. Ok, this is an one variable function. Then, the squared error should be (g(N) - (aN+b))2.
But this is a three variable function f(a, b, N). This means that it's the function of the error on the point N, right? But I need to find a two variable function... And what does "the sum of the squared errors" mean? The integral? Shouldn't the sum of the erros of this two functions be infinity? It really looks ugly and this just put more doubts in my head. D:
And then, for the b question, should I take this (now imaginary) f and find the partial derivatives and do the Lagrange multipliers? Or there is a better way? (Sorry, I just learned that way till now)
Any guidance is really appreciated!
Thank you in advance. c:
In theory, the execution time T of a program should be a linear function of the size N of one it's inputs. Ideally, we should have T=aN+b, for the real constants a and b. But when the program was tested, the actual values were:
T | N |
5 | 1 |
10 | 3 |
15 | 4 |
a) Write the function f(a,b) of the sum of the squared erros.
b) Find the values of a*,b* that minimize f.
I didn't understand how should I do the first one. I found out that the actual function of the program is g(N)=5N2/6 - 5N/6 + 5. Ok, this is an one variable function. Then, the squared error should be (g(N) - (aN+b))2.
But this is a three variable function f(a, b, N). This means that it's the function of the error on the point N, right? But I need to find a two variable function... And what does "the sum of the squared errors" mean? The integral? Shouldn't the sum of the erros of this two functions be infinity? It really looks ugly and this just put more doubts in my head. D:
And then, for the b question, should I take this (now imaginary) f and find the partial derivatives and do the Lagrange multipliers? Or there is a better way? (Sorry, I just learned that way till now)
Any guidance is really appreciated!
Thank you in advance. c: