algorithm - Is it possible to prove that f(n) + g(n) = theta(n^2) for f(n) = theta(n^2) & g(n) = O(n^2) -
is there way prove
f(n) + g(n) = theta(n^2) or impossible? assuming f(n) = theta(n^2) & g(n) = o(n^2)
i tried following: f(n) = o(n^2) & g(n) = o(n^2). proved
0 <= f(n) <= c1*n^2 0 <= f(n) <= c2*n^2 c1 > 1 & c2 > 1
yes, can prove it.
f(n)intheta(n^2), there exists constantsc1,c2,n, suchn>n1f(n) bounded:c1*n^2 <= f(n) <= c2*n^2(by definiton)g(n)ino(n^2), there exist constantsc3,n2suchn>n2, g(n) bounded:g(n) <= c3*n^2(by definition)
now, have @ f(n)+g(n) n>max{n1,n2}:
f(n) + g(n) <= c2*n^2 + c3*n^2 = (c2+c3)*n^2 also,assuming f(n) non-negative, c1*n^2 <= f(n) <= f(n) + g(n), again n>max{n1,n2}>=n1.
we got n=max{n1,n2}, there exists constants c=c1, c'=(c2+c3), such n>n
c*n^2 <= f(n) + g(n) <= c'*n^2 by definition of big theta, means f(n)+g(n) in theta(n^2)
Comments
Post a Comment