Bareiss Algorithm
   HOME

TheInfoList



OR:

In mathematics, the Bareiss algorithm, named after Erwin Bareiss, is an
algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing ...
to calculate the
determinant In mathematics, the determinant is a scalar value that is a function of the entries of a square matrix. It characterizes some properties of the matrix and the linear map represented by the matrix. In particular, the determinant is nonzero if a ...
or the
echelon form In linear algebra, a Matrix (mathematics), matrix is in echelon form if it has the shape resulting from a Gaussian elimination. A matrix being in row echelon form means that Gaussian elimination has operated on the rows, and column echelon form ...
of a
matrix Matrix most commonly refers to: * ''The Matrix'' (franchise), an American media franchise ** ''The Matrix'', a 1999 science-fiction action film ** "The Matrix", a fictional setting, a virtual reality environment, within ''The Matrix'' (franchis ...
with
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
entries using only integer arithmetic; any
division Division or divider may refer to: Mathematics *Division (mathematics), the inverse of multiplication *Division algorithm, a method for computing the result of mathematical division Military *Division (military), a formation typically consisting ...
s that are performed are guaranteed to be exact (there is no
remainder In mathematics, the remainder is the amount "left over" after performing some computation. In arithmetic, the remainder is the integer "left over" after dividing one integer by another to produce an integer quotient ( integer division). In algeb ...
). The method can also be used to compute the determinant of matrices with (approximated)
real Real may refer to: Currencies * Brazilian real (R$) * Central American Republic real * Mexican real * Portuguese real * Spanish real * Spanish colonial real Music Albums * ''Real'' (L'Arc-en-Ciel album) (2000) * ''Real'' (Bright album) (2010) ...
entries, avoiding the introduction of any round-off errors beyond those already present in the input.


History

The general Bareiss algorithm is distinct from the Bareiss algorithm for
Toeplitz matrices In linear algebra, a Toeplitz matrix or diagonal-constant matrix, named after Otto Toeplitz, is a matrix in which each descending diagonal from left to right is constant. For instance, the following matrix is a Toeplitz matrix: :\qquad\begin a & b ...
. In some Spanish-speaking countries, this algorithm is also known as Bareiss-Montante, because of René Mario Montante Pardo, a professor of the
Universidad Autónoma de Nuevo León Universidad (Spanish for "university") may refer to: Places * Universidad, San Juan, Puerto Rico * Universidad (Madrid) Football clubs * Universidad SC, a Guatemalan football club that represents the Universidad de San Carlos de Guatemala ...
,
Mexico Mexico (Spanish: México), officially the United Mexican States, is a country in the southern portion of North America. It is bordered to the north by the United States; to the south and west by the Pacific Ocean; to the southeast by Guatema ...
, who popularized the method among his students.


Overview

Determinant In mathematics, the determinant is a scalar value that is a function of the entries of a square matrix. It characterizes some properties of the matrix and the linear map represented by the matrix. In particular, the determinant is nonzero if a ...
definition has only multiplication, addition and subtraction operations. Obviously the determinant is integer if all matrix entries are integer. However actual computation of the determinant using the definition or Leibniz formula is impractical, as it requires O(''n!'') operations. Gaussian elimination has O(''n''3) complexity, but introduces division, which results in round-off errors when implemented using floating point numbers. Round-off errors can be avoided if all the numbers are kept as integer fractions instead of floating point. But then the size of each element grows in size exponentially with the number of rows. Bareiss brings up a question of performing an integer-preserving elimination while keeping the magnitudes of the intermediate coefficients reasonably small. Two algorithms are suggested: # Division-free algorithm — performs matrix reduction to triangular form without any division operation. # Fraction-free algorithm — uses division to keep the intermediate entries smaller, but due to the Sylvester's Identity the transformation is still integer-preserving (the division has zero remainder). For completeness Bareiss also suggests fraction-producing multiplication-free elimination methods.


The algorithm

The program structure of this algorithm is a simple triple-loop, as in the standard Gaussian elimination. However in this case the matrix is modified so that each entry contains the leading principal minor []. Algorithm correctness is easily shown by induction on . * Input: — an -square matrix
assuming its leading principal minors [] are all non-zero. * Let ''M''0,0 1 (Note: ''M''0,0 is a special variable) * For from 1 to −1: ** For from +1 to : *** For from +1 to : **** Set M_ = \frac * Output: The matrix is modified
in-place In computer science, an in-place algorithm is an algorithm which transforms input using no auxiliary data structure. However, a small amount of extra storage space is allowed for auxiliary variables. The input is usually overwritten by the output ...
,
each entry contains the leading minor [],
entry contains the determinant of the original . If the assumption about principal minors turns out to be false, e.g. if −1,−1 = 0 and some ,−1 ≠ 0 ( = ,...,) then we can exchange the −1 row with the -th row and change the sign of the final answer.


Analysis

During execution of the Bareiss algorithm, every integer that is computed is the determinant of a submatrix of the input matrix. This allows, using the Hadamard inequality, to bound the size of these integers. Otherwise, the Bareiss algorithm may be viewed as a variant of Gaussian elimination and needs roughly the same number of arithmetic operations. It follows that, for an ''n'' × ''n'' matrix of maximum (absolute) value 2''L'' for each entry, the Bareiss algorithm runs in O(''n''3) elementary operations with an O(''n''''n''/2 2''nL'') bound on the absolute value of intermediate values needed. Its computational complexity is thus O(''n''5''L''2 (log(''n'')2 + ''L''2)) when using elementary arithmetic or O(''n''4''L'' (log(''n'') + ''L'') log(log(''n'') + ''L''))) by using
fast multiplication A multiplication algorithm is an algorithm (or method) to multiply two numbers. Depending on the size of the numbers, different algorithms are more efficient than others. Efficient multiplication algorithms have existed since the advent of the d ...
.


References

{{DEFAULTSORT:Bareiss Algorithm Determinants Numerical linear algebra Exchange algorithms Computer algebra