Back to the 2025 paper

Module 1: Introduction

20257m

Discuss the concepts of asymptotic notations and its properties.

Worked SolutionAI Assisted

Asymptotic Notations & Properties

Definitions (as in Q36)

  • O(g)O(g) upper: ∃c,n0:0≤f(n)≤cg(n)\exists c,n_0: 0\le f(n)\le c g(n) ∀n≥n0\forall n\ge n_0.
  • Ω(g)\Omega(g) lower: ∃c,n0:0≤cg(n)≤f(n)\exists c,n_0: 0\le c g(n)\le f(n).
  • Θ(g)\Theta(g) tight: c1g(n)≤f(n)≤c2g(n)c_1 g(n)\le f(n)\le c_2 g(n) → O∩ΩO \cap \Omega.
  • o(g)o(g) strict upper: ∀c>0\forall c>0 f(n)<cg(n)f(n)<c g(n) eventually (f/g→0f/g\to0).
  • ω(g)\omega(g) strict lower (f/g→∞f/g\to\infty).

Properties

  1. Transitivity: f=O(g),g=O(h)⇒f=O(h)f=O(g), g=O(h)\Rightarrow f=O(h) (similar for Ω,Θ\Omega,\Theta).
  2. Reflexivity: f=Θ(f)f=\Theta(f).
  3. Symmetry: f=Θ(g)  ⟺  g=Θ(f)f=\Theta(g)\iff g=\Theta(f); transpose symmetry f=O(g)  ⟺  g=Ω(f)f=O(g)\iff g=\Omega(f).
  4. Additivity/Max rule: If f1=O(g1),f2=O(g2)f_1=O(g_1), f_2=O(g_2) then f1+f2=O(max⁡(g1,g2))f_1+f_2=O(\max(g_1,g_2)). Hence polynomial aknk+⋯=O(nk)a_k n^k+\dots=O(n^k).
  5. Scaling: cf(n)=Θ(f(n))c f(n)=\Theta(f(n)) for constant c>0c>0; lower-order terms absorbed.
  6. Ordering: O(1)⊂O(log⁡n)⊂O(n)⊂O(nlog⁡n)⊂O(n2)⊂O(n3)⊂O(2n)⊂O(n!)O(1)\subset O(\log n)\subset O(n)\subset O(n\log n)\subset O(n^2)\subset O(n^3)\subset O(2^n)\subset O(n!).
  7. Polynomial gap: na=o(nb)n^{a}=o(n^{b}) if a<ba<b; any poly is o(2n)o(2^n).
  8. Master/recurrence use: notations hide constants allowing comparison Unabhängig von Hardware.

Example Hierarchy

  • Linear search worst Θ(n)\Theta(n), binary Θ(log⁡n)\Theta(\log n), merge Θ(nlog⁡n)\Theta(n\log n), matrix mult naive Θ(n3)\Theta(n^3), Strassen Θ(n2.81)\Theta(n^{2.81}), TSP brute Θ(n!)\Theta(n!).

Pitfalls

  • OO is not tight — use Θ\Theta when both upper and lower known.
  • Not all functions comparable (nsin⁡nn^{\sin n} incomparable).
  • Amortized vs worst-case: OO still worst over sequence.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.