Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

recurrence_growth function

The order of growth of a divide-and-conquer recurrence, as big_theta of a simple function.

How to write it

recurrence_growth(equations, unknown, variable)

The class big_theta(g) for large n, by the master or Akra-Bazzi theorem with its conditions, else as written.

equations
The recurrence, such as t(n) = 2 t(n/2) + n. A list that includes starting values like t(1) = 1 is read too. Takes an equation, or a list of equations in brackets.
unknown
The unknown to solve for, such as y. Takes a variable, or a list of variables.
variable
The variable to work with, a name such as x. Takes a variable, or a list of variables.

Examples

  • t(n)=2t(n2)+n⇒Θ(nln⁡(n))\displaystyle t(n) = 2 t\left(\frac{n}{2}\right)+n \Rightarrow \Theta(n \ln(n))
    recurrence_growth(t(n) = 2 t(n/2) + n, t, n)

    In the solver, recurrence_growth(t(n) = 2 t(n/2) + n, t, n) gives big_theta(n*ln(n)).

    Open in the solver
  • t(n)=t(n3)+t(2n3)+n⇒Θ(nln⁡(n))\displaystyle t(n) = t\left(\frac{n}{3}\right)+t\left(\frac{2 n}{3}\right)+n \Rightarrow \Theta(n \ln(n))
    recurrence_growth(t(n) = t(n/3) + t(2n/3) + n, t, n)

    In the solver, recurrence_growth(t(n) = t(n/3) + t(2n/3) + n, t, n) gives big_theta(n*ln(n)).

    Open in the solver
  • t(n)=t(n)+1⇒Θ(ln⁡(ln⁡(n)))\displaystyle t(n) = t(\sqrt{n})+1 \Rightarrow \Theta(\ln(\ln(n)))
    recurrence_growth(t(n) = t(sqrt(n)) + 1, t, n)

    In the solver, recurrence_growth(t(n) = t(sqrt(n)) + 1, t, n) gives big_theta(ln(ln(n))).

    Open in the solver

Functions its examples use

  • sqrt

    Square root; sqrt(x) is the power x^(1/2).

  • solve_recurrence

    Solve a recurrence relation for a sequence.

  • solve_ode

    Solve a differential equation, or a system, with optional initial conditions.