Adding terms of lower-or-equal order keeps Theta; the largest term dominates, and identities can break when f is not assumed to grow.
کارت مفهوم کنکور ارشد علوم کامپیوتر
اهمیت
۰/۵
Intuition
Asymptotic classes obey simple algebra: a sum is governed by its largest term, and adding anything that is O(f) to f leaves you within a constant factor of f. But the bound 0≤g(n) in the definitions only forces lower bounds when f itself is bounded below — so identities involving roots or squares can fail for decaying functions.
Result / Method
Let g(n)=O(f(n)), i.e. 0≤g(n)≤cf(n). Then:
Sum rule:f(n)+O(f(n))∈Θ(f(n)), since f(n)≤f(n)+g(n)≤(1+c)f(n).
Dominant term:Θ(a(n)+b(n))=Θ(max(a(n),b(n))). So f+f2+f=Θ(f2) once f→∞ — strictly bigger than Θ(f).
Caution:f(n)∈Ω(f(n)) needs f(n)≥c, which fails if f(n)→0.
Worked example (q78)
With f(n) only "a function of n" (not assumed →∞):
II: f(n)∈Ω(f(n)) — false: take f(n)=1/n, then f/f=1/n→0.
III: f(n)+f2(n)+f(n)∈Θ(f(n)) — false: take f(n)=n, sum is Θ(n2)=Θ(n).
Only I holds, so the count is 1.
Pitfall: Never silently assume f(n)→∞. "Obvious" identities like f∈Ω(f) hold for growing running times but break for a decaying f such as 1/n. Always probe with both a growing (f=n) and a shrinking (f=1/n) counterexample.
فرمولهای کلیدی
Sum absorbs lower-order term
f(n)+O(f(n))∈Θ(f(n))
Adding a function bounded by c*f(n) keeps the result within a constant factor of f(n).
Sum equals max
Θ(a(n)+b(n))=Θ(max(a(n),b(n)))
A sum's growth rate is set by its dominant term; e.g. f+f^2 = Theta(f^2).
Omega root condition
f(n)∈Ω(f(n))⟺f(n)≥c
Holds only when f(n) is bounded below by a constant; fails if f(n) -> 0.