Skip to content
Home ยป Asymptomatic Notations

Asymptomatic Notations

โœ… Asymptotic Notations


โœ… 1. Introduction

Asymptotic Notations are mathematical tools used to describe the time complexity and space complexity of an algorithm when the input size n becomes very large.

โœ… They help us to:

  • Measure algorithm performance
  • Compare two algorithms
  • Ignore constants and less important terms
  • Focus on growth rate of algorithm

๐Ÿ“Œ Example:
If an algorithm takes 5n + 10 operations, for large n, the main term is n.
So complexity becomes O(n).


โœ… 2. Why Asymptotic Notations are Needed?

As input size increases, the execution time changes.
Asymptotic notations help us to calculate how fast the algorithm grows.

โœ… Benefits:

  • Independent of machine speed
  • Independent of programming language
  • Easy comparison of algorithms
  • Useful for large data problems

โœ… 3. Types of Asymptotic Notations

The main asymptotic notations are:

  1. โœ… Big-O Notation (O) โ†’ Worst Case
  2. โœ… Big-ฮฉ Notation (ฮฉ) โ†’ Best Case
  3. โœ… Big-ฮ˜ Notation (ฮ˜) โ†’ Average / Exact Case

(Other notations also exist like little-o and little-ฯ‰, but these 3 are most important for BCA.)


โœ… 4. Big-O Notation (O) โ€“ Worst Case

โœ… Definition

Big-O notation represents the upper bound of an algorithm.
It tells the maximum time an algorithm may take in the worst situation.

๐Ÿ“Œ Meaning:
Even in the worst case, algorithm will not take more time than O(f(n)).

โœ… Example:
Linear Search in array:

  • Best case: element found at first index โ†’ O(1)
  • Worst case: element found at last or not found โ†’ O(n) โœ…

๐Ÿ“Œ Example function:
T(n) = 3n + 5
In Big-O:
๐Ÿ‘‰ O(n) (ignore constants)

โœ… Common Big-O examples:

  • O(1) โ†’ constant time
  • O(n) โ†’ linear time
  • O(nยฒ) โ†’ quadratic time

โœ… 5. Big-ฮฉ Notation (ฮฉ) โ€“ Best Case

โœ… Definition

Big-ฮฉ notation represents the lower bound of an algorithm.
It tells the minimum time required by an algorithm in the best case.

โœ… Example:
Linear Search:

  • Best case: element found at first position โ†’ ฮฉ(1) โœ…

๐Ÿ“Œ Example function:
T(n) = 3n + 5
In Big-ฮฉ:
๐Ÿ‘‰ ฮฉ(n)

โœ… Best case helps to know minimum time when conditions are favorable.


โœ… 6. Big-ฮ˜ Notation (ฮ˜) โ€“ Average / Tight Bound

โœ… Definition

Big-ฮ˜ notation represents the tight bound of an algorithm.
It tells the exact or average growth rate of the algorithm.

๐Ÿ‘‰ Big-ฮ˜ is used when both upper and lower bounds are the same.

โœ… Example:
If algorithm always takes n steps:

  • Upper bound = O(n)
  • Lower bound = ฮฉ(n)
    So,
    โœ… Tight bound = ฮ˜(n)

๐Ÿ“Œ Example function:
T(n) = 4n + 20
Big-ฮ˜:
๐Ÿ‘‰ ฮ˜(n)


โœ… 7. Summary Table (Very Important for Exam)

NotationNameRepresentsMeaning
O(f(n))Big-OUpper BoundWorst case time
ฮฉ(f(n))Big-OmegaLower BoundBest case time
ฮ˜(f(n))Big-ThetaTight BoundAverage / exact time

โœ… 8. Simple Example (For Better Understanding)

โœ… Example: Linear Search

Search an element in array of size n

  • Best Case: element found at first position
    โœ… Time = ฮฉ(1)
  • Worst Case: element found at last / not found
    โœ… Time = O(n)
  • Average Case: found somewhere in middle
    โœ… Time = ฮ˜(n)

โœ… 9. Important Note (How We Simplify Functions)

While calculating asymptotic complexity:

โœ… Ignore:

  • Constants
  • Lower order terms

Example:
T(n) = 6nยฒ + 3n + 10

For large n, the highest power dominates:
โœ… Complexity = O(nยฒ)


โœ… Conclusion

Asymptotic notations are used to describe the performance of algorithms in terms of time and space for large input size. The most commonly used notations are Big-O (worst case), Big-ฮฉ (best case) and Big-ฮ˜ (average or tight bound).