Back to the 2025 paper

Module 1: Introduction

20257m

Write a short note on:

Asymptotic Notations

Worked SolutionAI Assisted

Asymptotic Notations — Short Note

Purpose

Describe algorithm growth for large nn, abstracting constants/hardware, classifying efficiency (as in Q36/Q88).

Definitions

  • O(g(n))O(g(n)): ∃c,n0:0≤f(n)≤c⋅g(n)∃c,n_0: 0≤f(n)≤c·g(n) ∀n≥n0∀n≥n_0 — at most gg (upper bound).
  • Ω(g(n))Ω(g(n)): ∃c,n0:0≤c⋅g(n)≤f(n)∃c,n_0: 0≤c·g(n)≤f(n) — at least gg (lower bound).
  • Θ(g(n))Θ(g(n)): ∃c1,c2,n0:c1g≤f≤c2g∃c_1,c_2,n_0: c_1g≤f≤c_2g — tight bound (O∩ΩO∩Ω).
  • o(g)o(g): ∀c>0∀c>0 eventually f<c⋅gf<c·g — strict upper (f/g→0f/g→0).
  • ω(g)ω(g): strict lower (f/g→∞f/g→∞).

Examples

  • 3n2+2n+1=Θ(n2)=O(n2)=O(n3)=Ω(n2)=Ω(n)3n^2+2n+1 = Θ(n^2)=O(n^2)=O(n^3)=Ω(n^2)=Ω(n).
  • nlog⁡n=o(n2)n\log n = o(n^2), 2n=ω(n100)2^n = ω(n^{100}).

Hierarchy

O(1)⊂O(log⁡n)⊂O(n)⊂O(nlog⁡n)⊂O(n2)⊂O(2n)⊂O(n!)O(1)⊂O(\log n)⊂O(n)⊂O(n\log n)⊂O(n^2)⊂O(2^n)⊂O(n!) — helps choose algorithm (e.g., merge nlog⁡nn\log n vs insertion n2n^2).

Properties

Transitivity, reflexivity, symmetry for ΘΘ, transpose f=O(g)⇔g=Ω(f)f=O(g)⇔g=Ω(f), sum rule f1+f2=O(max(g1,g2))f_1+f_2=O(max(g_1,g_2)).

Use: Analyze worst/best/average cases; e.g., linear search worst Θ(n)Θ(n), binary Θ(log⁡n)Θ(\log n), quicksort avg Θ(nlog⁡n)Θ(n\log n).

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.