Akra–Bazzi method
   HOME

TheInfoList



OR:

In
computer science Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
, the Akra–Bazzi method, or Akra–Bazzi theorem, is used to analyze the asymptotic behavior of the mathematical recurrences that appear in the
analysis Analysis (: analyses) is the process of breaking a complex topic or substance into smaller parts in order to gain a better understanding of it. The technique has been applied in the study of mathematics and logic since before Aristotle (38 ...
of divide and conquer algorithms where the sub-problems have substantially different sizes. It is a generalization of the master theorem for divide-and-conquer recurrences, which assumes that the sub-problems have equal size. It is named after mathematicians Mohamad Akra and Louay Bazzi. A practical variation sometimes referred to as the Ali Najib Variation is commonly used when the exact value of the exponent ''p'' satisfying the equation \alpha a^p + \beta b^p = 1 is difficult to compute analytically.


Formulation

The Akra–Bazzi method applies to recurrence formulas of the form: :T(x)=g(x) + \sum_^k a_i T(b_i x + h_i(x))\qquad \textx \geq x_0. The conditions for usage are: * sufficient base cases are provided * a_i and b_i are constants for all i * a_i > 0 for all i * 0 < b_i < 1 for all i * \left, g'(x)\ \in O(x^c), where ''c'' is a constant and ''O'' notates
Big O notation Big ''O'' notation is a mathematical notation that describes the asymptotic analysis, limiting behavior of a function (mathematics), function when the Argument of a function, argument tends towards a particular value or infinity. Big O is a memb ...
* \left, h_i(x) \ \in O\left(\frac\right) for all i * x_0 is a constant The asymptotic behavior of T(x) is found by determining the value of p for which \sum_^k a_i b_i^p = 1 and plugging that value into the equation: :T(x) \in \Theta \left( x^p\left( 1+\int_1^x \fracdu \right)\right) (see Θ). Intuitively, h_i(x) represents a small perturbation in the index of T. By noting that \lfloor b_i x \rfloor = b_i x + (\lfloor b_i x \rfloor - b_i x) and that the absolute value of \lfloor b_i x \rfloor - b_i x is always between 0 and 1, h_i(x) can be used to ignore the
floor function In mathematics, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least integer greater than or eq ...
in the index. Similarly, one can also ignore the
ceiling function In mathematics, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least integer greater than or eq ...
. For example, T(n) = n + T \left(\frac n \right) and T(n) = n + T \left(\left\lfloor \frac n \right\rfloor \right) will, as per the Akra–Bazzi theorem, have the same asymptotic behavior.


Ali Najib variation

When directly solving \alpha a^ + \beta b^ = 1 for the exponent p is inconvenient, the Ali Najib Variation offers a shortcut. Instead of determining p exactly, one compares the value of \alpha a^ + \beta b^ to 1 for the exponent d appearing in the non-recursive term g(x)=\Theta(x^): If \alpha a^ + \beta b^ < 1, then T(n) = \Theta!\bigl(n^\bigr). If \alpha a^ + \beta b^ = 1, then T(n) = \Theta!\bigl(n^ \log n\bigr). If \alpha a^ + \beta b^ > 1, then T(n) = \Theta!\bigl(n^\bigr), where p is defined by \alpha a^ + \beta b^ = 1. This comparison-based approach is particularly handy when p cannot be expressed in closed form or would require numerical methods.


Example

Suppose T(n) is defined as 1 for integers 0 \leq n \leq 3 and n^2 + \frac T \left( \left\lfloor \frac n \right\rfloor \right) + T \left( \left\lceil \frac n \right\rceil \right) for integers n > 3. In applying the Akra–Bazzi method, the first step is to find the value of p for which \frac \left(\frac\right)^p + \left(\frac \right)^p = 1. In this example, p=2. Then, using the formula, the asymptotic behavior can be determined as follows: : \begin T(x) & \in \Theta \left( x^p\left( 1+\int_1^x \frac\,du \right)\right) \\ & = \Theta \left( x^2 \left( 1+\int_1^x \frac\,du \right)\right) \\ & = \Theta(x^2(1 + \ln x)) \\ & = \Theta(x^2\log x). \end


Significance

The Akra–Bazzi method is more useful than most other techniques for determining asymptotic behavior because it covers such a wide variety of cases. Its primary application is the approximation of the running time of many divide-and-conquer algorithms. For example, in the
merge sort In computer science, merge sort (also commonly spelled as mergesort and as ) is an efficient, general-purpose, and comparison sort, comparison-based sorting algorithm. Most implementations of merge sort are Sorting algorithm#Stability, stable, wh ...
, the number of comparisons required in the worst case, which is roughly proportional to its runtime, is given recursively as T(1) = 0 and :T(n) = T\left(\left\lfloor \frac n \right\rfloor \right) + T\left(\left\lceil \frac n \right\rceil \right) + n - 1 for integers n > 0, and can thus be computed using the Akra–Bazzi method to be \Theta(n \log n).


See also

*
Master theorem (analysis of algorithms) Master, master's or masters may refer to: Ranks or titles In education: *Master (college), head of a college *Master's degree, a postgraduate or sometimes undergraduate degree in the specified discipline * Schoolmaster or master, presiding offic ...
*
Asymptotic complexity In computer science, the computational complexity or simply complexity of an algorithm is the amount of resources required to run it. Particular focus is given to computation time (generally measured by the number of needed elementary operations ...


References


External links


O Método de Akra-Bazzi na Resolução de Equações de Recorrência
{{DEFAULTSORT:Akra-Bazzi Method Asymptotic analysis Theorems in discrete mathematics Recurrence relations