3.1-1 Let f(n) and g(n) be asymptotically non-negative functions. Using the basic definition of Θ-notation, prove that max(f(n),g(n))=Θ(f(n)+g(n)).
Solution:
To prove this, we have to show that there exists constants c1,c2,n0>0 such that 0≤c1(f(n)+g(n))≤max(f(n),g(n))≤c2(f(n)+g(n)) for all n≥n0. As the functions are asymptotically non-negative, we can assume that for some n0>0,f(n)≥0 and g(n)≥0.
So Far
n≥n0 , f(n)+g(n)≥max(f(n),g(n))
Also note that,
f(n)≤max(f(n),g(n))
and g(n)≤max(f(n),g(n))∴f(n)+g(n)≤2max(f(n),g(n))⇒12(f(n)+g(n))≤max(f(n),g(n))
Therefore, we can combine the above two inequalities as follows:
0≤12(f(n)+g(n))≤max(f(n),g(n))≤(f(n)+g(n)) for n≥n0
So, max(f(n),g(n))=Θ(f(n)+g(n)) because there exists c1=12 and c2=1
Solution:
To prove this, we have to show that there exists constants c1,c2,n0>0 such that 0≤c1(f(n)+g(n))≤max(f(n),g(n))≤c2(f(n)+g(n)) for all n≥n0. As the functions are asymptotically non-negative, we can assume that for some n0>0,f(n)≥0 and g(n)≥0.
So Far
n≥n0 , f(n)+g(n)≥max(f(n),g(n))
Also note that,
f(n)≤max(f(n),g(n))
and g(n)≤max(f(n),g(n))∴f(n)+g(n)≤2max(f(n),g(n))⇒12(f(n)+g(n))≤max(f(n),g(n))
Therefore, we can combine the above two inequalities as follows:
0≤12(f(n)+g(n))≤max(f(n),g(n))≤(f(n)+g(n)) for n≥n0
So, max(f(n),g(n))=Θ(f(n)+g(n)) because there exists c1=12 and c2=1