Created
Aug 16, 2025
Last Modified
3 months ago

Binary Search (Recurrence Relation)

Floor Function

  • floor(x): If x is a real number, then floor(x) is the greatest integer less than or equal to x.

Ceil Function

  • ceil(x): If x is a real number, then ceil(x) is the smallest integer greater than or equal to x.


Binary Search Recursive Equation

  1. Finding the middle element:

  2. Comparing the key with the middle element:

    • If key == arr[mid] → element found

    • If key < arr[mid] → search in left half

    • If key > arr[mid] → search in right half

Recursive Equation

  • id

  • = Time to comparing key with mid

  • $t\left(\frac{2}\right)$ = Time to search in the remaining half the array

  • $dbyin


Recurrence Relation

  • Def a mapping from natural numme set.
    A recurrence relation defines each term of tuence as a function of itsibonacci Relation

This is a classic recurrence relation.


General Form of Recurrence Relation

Let Is a sequence where an is term of the sequence then a relation of type

  • is some functi, \dots, c_k$ are coner, called the degree ofinear recurrance relation with constant coefficient.

condition


Types of Recurrence Relations

  1. Homogeneous Linear Recurrence Relation with constant coefficient

  2. Inhomogeneous Linear Recurrence Relation with constant coefficient


Examples of Recurrence Relation

Homogeneous

 

Inhomogeneous

Inhomogeneous


Meaning of the Solution of a Recurrence Relation