algorithm - Comparing the Bounds of Functions -
i understand general idea of bounds of functions; example, if function
ƒ1(n) ∈ ω(n^2)
then know ƒ1(n) element within constraints of lower bound n^2, meaning ƒ1(n) can function grows slower or equal of n^2.
now start confused when talk other functions in regards bounds of ƒ1(n). example, have statement claims this:
if
ƒ1(n) ∈ ω(n^2)
and
ƒ2(n) ∈ θ(n)
then
ƒ2(n) ∈ o(ƒ1(n))
i have hard time telling whether or not it's true or false. have 2 different approaches contradict each other:
- true - since ƒ2 tightly bound under n, can considered element within constraints of o(ƒ1(n)) because ƒ2 not grow slower ƒ1.
- false - since ƒ1 has lower bound of n^2, function ƒ2, tightly bound under n, cannot considered element of upper bounds of ƒ1 since know ƒ1 not have upper bound grows slower n^2.
both of these approaches i've thought of seem valid me; think i'm getting confused on whether or not care lower bounds of ƒ1 when we're trying decide if function element of upper bounds.
any on clarifying appreciated.
let's @ definitions of big-o etc. formulas valid sufficiently large n. then, there exist constants k
, such that:
first formula:
ƒ1(n) ∈ Ω(n^2)
⇔ k1 * n^2 <= f1(n)
second formula:
ƒ2(n) ∈ Θ(n)
⇔ k2 * n <= f2(n) <= k3 * n
we know k3 * n < k1 * n^2
(again, sufficiently large n
). hence:
k2 * n <= f2(n) <= k3 * n < k1 * n^2 <= f1(n)
this can reduced to
f2(n) < f1(n)
with knowledge, see inferred formula true:
ƒ2(n) ∈ o(ƒ1(n))
⇔ f2(n) <= k4 * f1(n)
Comments
Post a Comment