Asymtotic NotationAsymtot is a barier blockage which stop the ...Asymtotic notation are used to categorise the function on the basis of their growth.There are 3
Ashutosh KumarAuthor
#481
mesprit
Asymtotic Notation
Asymtot is a barier blockage which stop the ...
Asymtotic notation are used to categorise the function on the basis of their growth.
There are 3 main category of Asymtotic notation
Big O Notation
Let t(n) and g(n) are two positive functions then
t(n) is said to be in O{g(n)} if:
t(n) is bounded above by some positive constant multiple of g(n) for large values of n
t(n)≤C⋅g(n) whenever n≥n0
let t(n) = 100n + 6
100n + 6 <= 100n + n, (n >= 6)
100n + 6 <= 101n (n >= 6)
101n <= 101 (whenever n >= 1)
100n + 6 <= 101 (whenever n >= 6)
why did we take n >= 1
100n + 6 <= 101 whenever n >= 6
100n + 6 O()
100n + 6 <= 101n whenever n>=6
100n <= 101 whenever n >= 1
Big Notation
let t(n) and g(n) are two positive function
then:
t(n) is said to be in if t(n) is bounded bellow by some positive constant of g(n) multiple of g(n) for large values of n
example:
Theta Notation
let t(n) and g(n) are two positive function then t(n) is said to be in {g(n)} if
t(n) is bounded above and bounded below by some positive constant multiple of g(n) for large values of n
i.e.
C1g(n)≤t(n)≤C2g(n) whenever n≤n0
example:
t(n)=2n(n−1) or 2n2 whenever n≥2
=2n2−2n≥2n2−4n2
=2n2−2n≥41⋅n2 whenever n≥2
Inequality no 1
=2n(n−1)≥41⋅n2 whenever n≥2
Again
Whenever
Whenever
Inequality no 2
Whenever
In common reason both the equality will be valid simultaneously thus we have
41⋅n2≤2n(n−1)≤21⋅n2
Note
tnεθg(n)
Bidirectional implication.
Theorem 1
If
t1(n)∈Θ(g1(n))andt2(n)∈O(g2(n))
then
t1(n)+t2(n)∈Θ(max(g1n,g2n)).
Proof
We know that
t1(n)∈O(g1(n))⟹t1(n)≤c1g1(n),∀n≥n1,
and
t2(n)∈O(g2(n))⟹t2(n)≤c2g2(n),∀n≥n2
Let
Then, for all , inequalities (1) and (2) hold simultaneously.
Thus,
t1(n)+t2(n)≤c1g1(n)+c2g2(n)
Now, observe that
c1g1(n)+c2g2(n)≤(c1+c2)max(g1n,g2n))
Therefore,
t1(n)+t2(n)∈O(max(g1n,g2n))
Since , we also know there exists a constant such that