Scientific Converters Precise unit conversions for science & engineering.

    Loading…

    Master Theorem Calculator

    The master theorem compares f(n) with n^(log_b a): T(n) = 8T(n/2) + n² is Θ(n^3) because n³ dominates n².

    T(n) =

    Θ(n^3)

    log_b a
    3
    Recurrence
    T(n) = 8T(n/2) + Θ(n^2)
    Step-by-step solution
    1. Compare f(n) = Θ(n^2) with n^(log_b a) = n^3
    2. Case 1: k = 2 < log_b a = 3
    3. T(n) = Θ(n^3)

    Master Theorem Formula

    T(n) = aT(n/b) + Θ(nᵏ logᵖ n)

    compare k with log_b a

    Worked Example

    T(n) = 8T(n/2) + n²:

    1. Compare f(n) = Θ(n^2) with n^(log_b a) = n^3
    2. Case 1: k = 2 < log_b a = 3
    3. T(n) = Θ(n^3)

    Recurrence: T(n) = 8T(n/2) + Θ(n^2)

    GATE tip

    Binary search is T(n) = T(n/2) + 1 (a = 1, b = 2, k = 0) → Θ(log n); Strassen is 7T(n/2) + n² → Θ(n^2.807).

    More Computer Networks and Algorithms Calculators

    Frequently asked questions

    What is the recurrence for merge sort?

    T(n) = 2T(n/2) + n, which is case 2 of the master theorem and gives Θ(n log n).

    When does the master theorem not apply?

    When subproblems have unequal sizes, a is not constant, or f(n) is not polynomially comparable, e.g. T(n) = T(n − 1) + n.

    Sources

    Last reviewed: . Factors are stored exactly and computed with 50-digit decimal arithmetic. See how we verify conversion factors.

    Cite this page

    APA

    Scientific Converters. (2026, October 15). Master Theorem Calculator. Retrieved October 25, 2026, from https://scientificconverters.com/calculators/master-theorem-calculator/

    IEEE

    Scientific Converters, "Master Theorem Calculator," scientificconverters.com. Accessed: Oct. 25, 2026. [Online]. Available: https://scientificconverters.com/calculators/master-theorem-calculator/

    Send feedback

    Found a wrong value, a missing unit or an idea? Tell us. We read every message.

    What is it about?

    We store your message, the page you were on and your email if given. See the privacy policy.