Before we begin, lets first state what little-o and Big-Theta notations means:
Little-o notation
Formally, that g(n) = o(f(n))
(or g(n) ∈ o(f(n))
) holds for
sufficiently large n
means that for every positive constant ε
there exists a constant N
such that
|g(n)| ≤ ε*|f(n)|, for all n > N (+)
From https://en.wikipedia.org/wiki/Big_O_notation#Little-o_notation.
Big-Θ notation
h(n) = Θ(f(n))
means there exists positive constants k_1
, k_2
and N
, such that k_1 · |f(n)|
and k_2 · |f(n)|
is an upper bound
and lower bound on on |h(n)|
, respectively, for n > N
, i.e.
k_1 · |f(n)| ≤ |h(n)| ≤ k_2 · |f(n)|, for all n > N (++)
From https://www.khanacademy.org/computing/computer-science/algorithms/asymptotic-notation/a/big-big-theta-notation.
Given: g(n) ∈ o(f(n))
Hence, in our case, for every ε>0
we can find some constant N
such that (+)
, for our functions g(n)
and f(n)
. Hence, for n>N
, we have
|g(n)| ≤ ε*|f(n)|, for some ε>0, for all n>N
Choose a constant ε < 1 (recall, the above holds for all ε > 0),
with accompanied constant N.
Then the following holds for all n>N
ε(|g(n)| + |f(n)|) ≤ 2|f(n)| ≤ 2(|g(n)| + |f(n)|) ≤ 4*|f(n)| (*)
Stripping away the left-most inequality in (*)
and dividing by 2, we have:
|f(n)| ≤ |g(n)| + |f(n)| ≤ 2*|f(n)|, n>N (**)
We see that this is the very definition Big-Θ notation, as presented in (++)
, with constants k_1 = 1
, k_2 = 2
and h(n) = g(n)+f(n)
. Hence
(**) => g(n) + f(n) is in Θ(f(n))
Ans we have shown that g(n) ∈ o(f(n))
implies (g(n) + f(n)) ∈ Θ(f(n))
.