as Adobe PDF - Edinburgh Research Explorer
Transcription
as Adobe PDF - Edinburgh Research Explorer
Edinburgh Research Explorer A Novel Algorithm for determinant calculation of N×N matrix Citation for published version: Taheri, SM, Boostanpour, J & Mohammadi, B 2013, 'A Novel Algorithm for determinant calculation of N×N matrix'. in Proceedings of the 2013 International Conference on Advances in Computing, Communications and Informatics, ICACCI 2013., 6637270, pp. 764-769, 2013 2nd International Conference on Advances in Computing, Communications and Informatics, ICACCI 2013, Mysore, United Kingdom, 22-25 August., 10.1109/ICACCI.2013.6637270 Digital Object Identifier (DOI): 10.1109/ICACCI.2013.6637270 Link: Link to publication record in Edinburgh Research Explorer Document Version: Peer reviewed version Published In: Proceedings of the 2013 International Conference on Advances in Computing, Communications and Informatics, ICACCI 2013 General rights Copyright for the publications made accessible via the Edinburgh Research Explorer is retained by the author(s) and / or other copyright owners and it is a condition of accessing these publications that users recognise and abide by the legal requirements associated with these rights. Take down policy The University of Edinburgh has made every reasonable effort to ensure that Edinburgh Research Explorer content complies with UK legislation. If you believe that the public display of this file breaches copyright please contact [email protected] providing details, and we will remove access to the work immediately and investigate your claim. Download date: 14. Oct. 2016 A Novel Algorithm for Determinant Calculation of N×N Matrix Sayed Mostafa Taheri (Author) M’IEEE Jafar Boostanpour (Co-Author) Department of Electronics and Electrical Engineering Ferdowsi University of Mashhad (FUM) Mashhad, I.R.IRAN [email protected] Electrical Engineering Department Ferdowsi University of Mashhad (FUM) Mashhad, I.R.IRAN [email protected] Bahareh Mohammadi (Co-Author) Electrical Engineering Department Barthawa Institute of Technology Mashhad, I.R.IRAN Abstract— Evaluation of the determinant of a square matrix is an important issue in science and engineering for different types of applications. Several methods have been already proposed, but there are some limitation and also drawbacks using each method in particular applications. In this paper we present a novel method for determining the determinant of a square matrix which can be especially faster, and more useful when the order of the matrix increases. The paper is presented in five sections. I. Introduction. II. Review III. The Novel Algorithm (TaBe) where we introduce our new method. IV. Mathematical Proof, here we illustrate the mathematical proof. V. Advantages VI. Conclusion, and finally References. Keywords— Matrix Determinant, Algebra, Computation, Mathematical Algorithms. I. Mathematical INTRODUCTION Working with matrix is one of the most applicable and common issues in science and engineering. Almost every computational method in science and engineering has to either use matrix theory or at least to be expressed and viewed by matrices. Matrices are the well-known main tools in many methods and applications in order to lead the algorithm to achieve the desired objectives. Many famous softwares in mathematics and engineering are based on matrix manipulation; for instance the giant MATLAB (which its name is derived from Matrix Laboratory). One of the most important problems in matrix operations, is to find the determinant of an n order matrix; either containing numbers (real, complex, etc.) or characters, symbols and parameters. This step is a critical step in matrix operations, and is usually cumbersome especially when n increases. Several methods have been already presented which can be used due to the particular application. Nearly all of the presented methods show that the mass and volume of the calculations increase substantially with n enhancement. For instance, in the common method of determinant calculation, we need to find the determinant of n * [n-1] × [n-1] matrices for an n×n matrix. In Laplace expansion (or cofactor expansion) you can evaluate the determinant of an n×n matrix by knowing the 2×2 determinant. Det (A) is a weighted sum of the determinants of sub-matrices of A, each of order (n-1) × (n-1) etc. What is obvious is that the probability of making mistakes for high order matrices increases since the algorithms is somewhat complicated. In this paper, we actually introduce a systematic method which can be useful for both humans and machines (having absolutely simple and fast code). II. REVIEW While there are many way of calculating determinant of an N×N square matrix, few methods are presented over the time to develop or improve the efficiency of the traditional techniques. The most important ways of calculating determinant of a square matrix will be presented briefly in this section. The determinant of a matrix of arbitrary size can be evaluated using Leibnitz or Laplace formulations [37,38]. If ‘A’ is a square matrix: (aij)i,j=1,….,n (1) The determinant of A is defined as: (2) where Sn is the permutation group and sgn returns +1 or -1 for even and odd permutations respectively. Laplace formula can be written as: (8) (3) And simply the determinant of the main matrix [X] is acquired by: Where the i,j cofactor of B is the scalar Cij defined by (4) (9) The determinant can also be expanded using Laplace formulas by complementary minors. It is worth mentioning that there are several notations and presentations of the above basic formulas which do not carry significant difference in fundamental. Other ways of computing the determinant of a matrix, includes: applying Gaussian Elimination, Decomposition Methods which computes the determinant of a given matrix A as a product of matrices which their determinants can be simply evaluated, LU decomposition, QR decomposition, Cholesky decomposition, matrix determinant lemma, Cramer and some other methods [see references section (VII) for detailed information]. In a simpler form of formulation, consider [Y] to be a 2×2 matrix, build up of the elements which are composed by the determinant of the cofactors of the corner elements of the main matrix. That is: III. THE NOVEL ALGORITHM (TABE) In this method, we build a 2×2 matrix which its elements are only four determinant of order (n-1) × (n-1) [instead of n * [n-1] × [n-1] in most methods]. It is notable that the method of picking the elements in our algorithm is totally different with Dodgson method [1]. In the Dodgson method, an [n-1] × [n-1] matrix is created which its elements are all the determinants of order 2×2, calculated in an especial manner. Now let us introduce the new method. Consider the main matrix [x]: (5) And we create a 2×2 matrix [Y]: (10) In the next step, we create a (n-2) × (n-2) matrix which is composed by eliminating the adjacent, top and bottom rows and columns of the [ ]. At the end, only a division of the determinants is needed to evaluate the determinant of the main matrix by (7): (11) Now, as you may guess, the machine code of the proposed method is considerably easier than the Dodgson method (and nearly most other algorithms) because: 1. The number of the chosen matrices at first is always 4 (independent of the order of the main matrix), 2. The algorithm reduces the order of the matrix in a complete systematic manner, 3. The picking of the is really easy in mathematical programming as well as for humans, and 4. The machine code of this method can even be written by low-level programming languages with no predefined mathematical functions, therefore it is nearly as easy as high-level languages with its fast topology (few numbers of loops only). (6) Where (7) The (n-2) × (n-2) matrix [Z] is configured as So the machines or humans alike can calculate the determinant of high order matrices with minimum or no mistakes. Let’s now consider a numerical example to illustrate the concepts. At first sight, we may see a drawback in the algorithm: division by zero when |Z| = 0. This can be addressed by the following suggestions: As can be seen, for n≥5 the usefulness and rapidness of the TaBe method increases quickly. For instance, assume [X] be a 10×10 matrix. In general method, 1. We can prevent division by zero (| | = 0) by using simple permutation of rows and columns, and other elementary operations (which do not change | |). 2. We can substitute some elements of with ʓ such that the | | ≠ 0, and then continue calculating the determinant of . At the end, we may have a statement in terms of ʓ. Now we can reversely replace ʓ by the element which was already substituted with. 10×10 10 * (9×9) By applying the above two solutions, the algorithm would always work. In(a) next section, we will illustrate the mathematical demonstration of the proposed method. 9*(8×8) 8*(7×7) 7*(6×6) IV. MATHEMATICAL PROOF In this section a proof the statements will be presented. As is known, the determinant of a matrix can be defined by: 6*(5×5) (12) 5*(4×4) where xuv are the elements of the square matrix, and ε_(k,r,t,..,z) is the Levi-Civita symbol. 4*(3×3) 3*(2×2) First, we need to know about cofactor, minor, Laplace and Cauchy expressions as preliminaries. Let xuv to be the element of the square matrix X_(n×n). The minor of X is the matrix which is obtained by eliminating the Uth row and Vth coloumn of X and is defined by Xuv. The cofactor of Xuv is defined and presented as follows: (a) Now, by using the TaBe method, 10×10 (13) 4 * (9×9) 4*(8×8) 4*(7×7) 4*(6×6) Laplace theory (b) for determining the determinant of X states that the summation of the multiplication of a row (or columns)'s elements by its cofactor gives the determinant of X . That is (14) 4*(5×5) In a similar way, the Cauchy theory is presented as follows: 4*(4×4) 4*(3×3) (15) 4*(2×2) (b) Also is defined as: (16) So: (27) Therefore it can be shown that: (17) Now we can begin demonstrating the proposed algorithm. For demonstration, we need to prove that for (18) We can find Y (19) Where: (20) And we know: Now, let us define matrix α as: (28) (29) With simple calculation, it can be showed that: (30) As we have already seen, the order of both X and α matrices are equal; hence we can multiply them by each other. (21) (31) (23) By multiplying the 2nd, 3rd, …., nth column of the above matrices by x12, x13, …., x1 n-1 respectively, and then adding the results to the first coloumn, and repeatedly multiplying the 2nd, 3rd, …., nth column by xn2, xn3, …., xn n-1 and adding the results to the last column, we acquire [γ] which can be written as follows by using Laplace and Cauchy theorems: (24) (32) (22) and Z where we used Laplace theorem for γ expansion so Such that (25) and as we have derived γ by elementary operations on β, it is obviously clear that For proof, we can use the following substitutions: (34) , , (33) (26) So we can conclude: (35) , Thus we have reached to the proof (36) V. ADVANTAGES As mentioned before, several methods have been presented to evaluate the determinant of a square matrix. The new proposed method, TaBe, has some especial advantages in comparison with other algorithms. Some of the relative advantages are as follows: 1. 2. 3. As it can be seen in (a) and (b), as examples, the mass of the calculation is quite less than the general methods (almost all methods). The main point here is that the number of the chosen determinants for the 2×2 matrix at first is independent of the order of the main matrix and is always four. So the reduction in calculation volume is obvious. As mentioned before, the simplicity of the machine code for this algorithm is really considerable (detailed explanations presented in section II). As a result, the speed of the code using this algorithm is relatively higher than the other algorithms especially for parametric and symbolic matrices. The other benefit of this algorithm is its systematical topology. To calculate the determinant of a high order matrix (even for n=4) by humans correctly, high level of accuracy and concentration is needed; otherwise mistakes will be made during the calculation and mixing up is very common. But in this method we can reduce the order of the matrix absolutely systematically, by glance of view and continue using this method repeatedly. So the possibility of making mistakes by humans can be decreased considerably. VI. REFERENCES [2] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] CONCLUSION In this paper we propose a novel method for calculating the determinant of a square matrix. We showed that is correct for any square matrix of order n, and is different from all the previous methods. We showed that the TaBe algorithm has lots of advantages which can be used in appropriate applications and situations; For instance, the reduction of calculations, and minimizing the possibility of making mistakes by humans. It has easier machine code, and faster result acquisition for parametric and symbolic matrices can be obtained. [1] [3] J. Abbott, M. Bronstein, T. Mulders, Fast deterministic computation of determinants of dense matrices, in: Proceedings of the ACM International Symposium on Symbolic and Algebraic Computation, ACM Press, New York, 1999, pp. 197–203. I. Z. Emiris, V.Y. Pan,”Improved algorithms for computing determinants and resultants”, Journal of Complexity, Volume 21, Issue 1, February 2005, Pages 43–71. [18] [19] [20] [21] [22] [23] [24] [25] Yong-sheng Wu, Chuan-qing Gu, "A New Algorithm for Computing the Determinant Formulas of Matrix Pade-type Approximation," Computer Science and Electronics Engineering (ICCSEE), 2012 International Conference on , vol.1, no., 23-25 March 2012, pp.656,659. J. D. Shen, C. Q. Gu, "Computing the determinants of matrix Padé approximation," J.Compt Appl.Math. vol. 214, pp. 433-441, 2009 E. X. Jiang, “Computation of matrix”, Bejiang: Sience Press, 2008. N.Drakos,” How to Compute Determinants, Computer Based Learning Unit”, University of Leeds, available in: http://www.math.dartmouth.edu/archive/m8s00/public_html/handouts/m atrices3/node7.html Weisstein, W. Eric , "Determinant Expansion by Minors." From MathWorld A Wolfram Web Resource : http://mathworld.wolfram.com/DeterminantExpansionbyMinors.html H. Hotelling,” Some New Methods in Matrix Calculation”, The Annals of Mathematical Statistics Vol. 14, No. 1 (Mar., 1943), pp. 1-34. E. Horowitz,S.sahni,” On Computing the Exact Determinant of Matrices with Polynomial Entries”, Journal of the ACM (JACM), Volume 22 Issue 1, Jan. 1975 , Pages 38-50. W. M. Gentleman , S. C. Johnson, “Analysis of algorithms, a case study: Determinants of polynomials”, Proceedings of the fifth annual ACM symposium on Theory of computing, p.135-141, April 30-May 02, 1973, Austin, Texas, United States. T. R. Seifullin “Acceleration of Computation of Determinants and Characteristic Polynomials without Divisions”, Cybernetics and Systems Analysis 39(6),pp. 805-815. W. Eberly, M.Giesbrecht, G.Villard , "On computing the determinant and Smith form of an integer matrix," Foundations of Computer Science, 2000. Proceedings. 41st Annual Symposium on , vol., no., pp.675,685. S. J. Berkowitz “On computing the determinant in small parallel time using a small number of processors”, Information Processing Letters, Volume 18, Issue 3, 30 March 1984, Pages 147–150. V. Pan, ”Computing the determinant and the characteristic polynomial of a matrix via solving linear systems of equations”, Information Processing Letters, Volume 28, Issue 2, 24 June 1988, Pages 71–75. D.Henrion, M.Sebek, "Improved polynomial matrix determinant computation," Circuits and Systems I: Fundamental Theory and Applications, IEEE Transactions on , vol.46, no.10, Oct 1999, pp.1307,1308. D. Henrion, “Reliable algorithms for polynomial matrices”, 1998 :Inst. Information Theory Automation, Czech Acad. Sci. M. S&caron,ebek, F. Kraus, S. Pejchova´,, H. Kwakernaak, and D. Henrion, "Numerical methods for zeros and determinant of polynomial matrix", Proc. IEEE Mediterranean Symp. New Directions Control Automation, 1996 , pp.488-491. Ogita, Takeshi, "Exact Determinant of Integer Matrices." In 4th International Workshop on Reliable Engineering Computing (REC 2010). 2010. E. Kaltofen , G. Villard ,” Computing the sign or the value of the determinant of an integer matrix, a complexity survey”, J. Computational Applied Math 162(1), (2004), pp.133-146. E. Kaltofen, G. Villard ,"On the complexity of computing determinants." computational complexity 13, no. 3-4 (2005),pp. 91-130. H. Bronnimann , M. Yvinec ,”Efficient exact evaluation of signs of determinant”, Algorithmica (2000). 27, pp.21-56. K. L. Clarkson ,”Safe and Efficient Determinant Evaluation”, In Proc. 33rd Annual Symp. Foundations of Comp. Sc (1992),pp. 387-395. IEEE Computer Society Press, Los Alamitos, California. Qefsere Gjonbalaj, Armend Salihu “Computing The Determinants By Reducing The Orders By Four”, Applied Mathematics E-Notes, 10(2010), 151-158. New Method to Compute the Determinant of a 3x3 Matrix, Dardan Hajrizaj, International Journal of Algebra, Vol. 3, 2009, no. 5, 211 – 219. S. Barnard, J. M. Child: Higher Algebra, London Macmillan LTD New York, ST Martin*s Press (1959), 131. [26] Scott, Robert Forsyth: The theory of determinants and their applications, Ithaca, New York: Cornell University Library, Cambridge: University Press, (1904), 3-5. [27] W. L. Ferrar: Algebra, A Text-Book of determinants, matrices, and algebraic forms, Second edition, Fellow and tutor of Hertford college Oxford, (1957), 7. [28] Weld, Laenas Gifford: A short course in the theory of determinants, Ithaca, New York: Cornell University Library, New York, London: Macmillan and Co, (1893), 8. [29] F. Chio, “ Mémoire sur les fonctions connues sous le nom de résultantes ou de déterminants”, Turin, 1853. [30] H. Eves, An Introduction to the History of Mathematics, pages 405 and 493, Saunders College Publishing, 1990. [31] H. Eves, Chio’s Expansion, §3.6 in Elementary Matrix Theory, New York: Dover, (1996), 129–136. [32] E. Hamiti, Matematika 1, Universiteti i Prishtin¨es: Fakulteti Elektroteknik, Prishtin¨e, (2000), 163–164. [33] P. H. Hanus, An Elementary Treatise on the Theory of Determinants, A textbook for colleges, Ithaca, New York: Cornell University Library, Boston, Ginn and Company (1886), 13, 14, 18. [34] J. R. Bunch and J. E. Hopcroft, Triangular factorization and inversion by fast matrix multiplication, Mathematics of Computation, 28 (1974), 231–236. [35] Pierre-Simon (de) Laplace, Expansion of determinants in terms of minors, Researches sur le calcul int´egral et sur le syst´eme du monde, Histoire de l’Acad´emie Royale des Sciences (Paris), seconde partie, pages 267–376 (1772). [36] Jos. V. Collins: Advanced algebra, American Book Company (1913), 281,286. [37] http://en.wikipedia.org/wiki/Leibniz_formula_for_determi [38] nants http://en.wikipedia.org/wiki/Laplace_expansion