Research Paper
E-ISSN NO : 2455-295X | VOLUME : 3 | ISSUE : 4 | APRIL 2017
EVALUATION OF DETERMINANT BY MATRIX ORDER CONDENSATION Feng Cheng Chang 1 1
Allwave Corporation, 3860 Del Amo Blvd, Suite 404,Torrance, California.
ABSTRACT A fast iterative method is presented for computing the determinant of any square matrix by applying the succession an algorithm of matrix order condensation. The process is very simple and straightforward. It is found that the total number of multiplication/division operations needed to compute the determinant of a square matrix is less than 2/3 of that required for the product of two square matrices of an identical size. Keywords: Determinant, Matrix Inversion, Matrix Multiplication, Recursive Algorithm, Matrix Order Condensation, Matrix Order Expansion.
Introduction An iterative algorithm of matrix order condensation is developed for computing the determinant of any general square matrix. The process is very simple and straightforward and involves only simple matrix oprations. Computer listings in MATLAB are provided, and typical numerical examples are given to show the merit of the approach presented.
Formulation The determinant of any given square matrix [M] can be evaluated as follows by an iterative algorithm relying upon matrix order condensation. At the beginning of the iterative process, k = 0, the given square matrix [M] of order N x N is denoted as [M] = [M0].
Then in the k-th
step of the following process, k = 1, 2, .... , K, the matrix [Mk-1] of order nk 1 nk 1 is given by
M k 1
P uk k , vk Wk
which contains four sub-matrices, Pk , uk , vk , and Wk, of order mk mk , mk nk , nk mk , and nk nk , respectively, where
nk 1 nk mk , nk 1 mk mk 1 mK , and n0 N , nK 1 mK , nK 0 . The condensed matrix [Mk] is thus directly computed from these four matrices, provided that the pivot matrix is Pk is not singular,
M k Wk
vk Pk1 uk .
Then we have
det M k 1 det Pk det M k . The determinant of this given matrix [M] = [M0] is therefore determined after performing a total of K process steps:
det M det P1 det P2 det PK . Proof
The proof of the algorithm is quite simple and straightforward. Since
P u M k 1 vk Wk k k
Ik Pk I k Pk1uk , v P 1 I Wk vk Pk1uk I k 1 k 1 k k
it follows that
P uk P det M k 1 det k det k vk Wk
det Pk det M k . M k
INTERNATIONAL EDUCATIONAL SCIENTIFIC RESEARCH JOURNAL
44
Research Paper
E-ISSN NO : 2455-295X | VOLUME : 3 | ISSUE : 4 | APRIL 2017
This completes the proof of the algorithm. The algorithm can be further modified so that all sub-matrices are not necessarily solid matrices. The pivot matrix Pk, which is formed from the selected rows and columns manually in every iteration step, need not to be located along the diagonal. In fact the modified algorithm is equivalent to the original algorithm with the given matrix after the rows and columns are rearranged. The desired results are then obtained from the computed results after restoring both rows and columns into their original orders.
Computer routine Two computer programs, derived from the algorithm and its modification, are presented as MATLAB routines. (1) function detM = det_m(M) % Finding determinant of a square matrix % by Condensation --- along diagonal.
Z = [ ]; for k = 1:length(M), nm = length(M); M, m = input('Pivot size = '); if m > nm, m = nm; end; n = nm-m; P = M([1:m],[1:m]); V = M([m+1:nm],[1:m]); U = M([1:m],[m+1:nm]); W = M([m+1:nm],[m+1:nm]); nM = [P,U;V,W]; iP = inv(P); dP = det(P); k,n,m,nM,iP,dP, disp(' '); Z = [Z,dP]; if nm <= m, break, end; M = W-V*iP*U; end; detM = prod(Z); Z, (2) function detM = det_pq(M) % Finding determinant of a square matrix % by Condensation --- select rows & cols.
Z = [ ];
INTERNATIONAL EDUCATIONAL SCIENTIFIC RESEARCH JOURNAL
45
Research Paper
E-ISSN NO : 2455-295X | VOLUME : 3 | ISSUE : 4 | APRIL 2017
for k = 1:length(M), nm = length(M); M, pq = input('[rows;cols] = '); p = sort(pq(1,:)); q = sort(pq(2,:)); m = length(p); n = nm-m; e = (-1)^sum(pq(:)); W = M(setdiff(1:nm,p),setdiff(1:nm,q)); V = M(setdiff(1:nm,p),q); U = M(p,setdiff(1:nm,q)); P = M(p,q); nM = [P,U;V,W]; iP = inv(P); dP = det(P); k,n,m,nM,iP, disp(' '); Z = [Z,dP*e]; if nm <= m, break, end; M = W-V*iP*U; end; detM = prod(Z); Z,
Examples For a given matrix [M] of order 6x6, 1 2 3 M 2 6 2
5 5 2 4 2 7
8 4 5 1 4 9
3 3 0 2 7 1
4 0 7 0 1 3
3 1 4 5 6 2
its determinant det [M ] may be obtained in 4 different schemes by applying the derived MATLAB routines:
(1)
Run
detM = det_m(M),
with inputs:
m =
1,
1,
1,
1,
1,
1.
INTERNATIONAL EDUCATIONAL SCIENTIFIC RESEARCH JOURNAL
46
Research Paper k = 1,
E-ISSN NO : 2455-295X | VOLUME : 3 | ISSUE : 4 | APRIL 2017 m1 = 1,
M 0
k = 2,
n1 = 5
1 2 P1 u1 3 M v1 W1 2 6 2
m2 = 1,
P
m3 = 1,
8 4 5 1 4 9
4 0 7 0 1 3
3 3 0 2 7 1
2
15 17 u2 6 W2 32 3
12 19 17 44
3 9 8 25
8 19 8 23
25
5
11
m4 = 1,
7 5 11 12 8
n3 = 3
5.4 12.2 P u 3 3 M 2 W2 v2 P21u2 v W 18.4 3 3 22.6
k = 4,
3 1 4 5 6 2
n2 = 4
M1 W1 v1P11u1 v2
k = 3,
5 5 2 4 2 7
5.6 6.8 18.6 4.4
9.9333 4.8 5.9333 9.4
2.9333 8.2 2.9333 6.6
n4 = 2
5.8519 17.6420 14.8272 P4 u4 1 M W v P u 3 3 3 3 3 v W 0.4815 27.9136 7.0617 4 4 19.0370 32.1728 18.8765
k = 5,
m5 = 1,
n5 = 1 P
M 4 W4 v4 P41u4 v5
k = 6,
m6 = 1,
5
u5 26.4620 W5 25.2194
5.8418 29.3586
n6 = 0
M 5 W5 v5 P51u5 P6 23.7912 M6
Then det M P1 P2 P3 P4 P5 P6 298410.
(2)
Run k = 1,
detM = det_m(M), m1 = 3,
M 0
k = 2,
with inputs:
3,
3
n1 = 3
1 2 P1 u1 3 M v1 W1 2 6 2
m2 = 3,
m =
5 5 2 4 2 7
8 4 5 1 4 9
3 3 0 2 7 1
4 0 7 0 1 3
3 1 4 5 6 2
n2 =0
INTERNATIONAL EDUCATIONAL SCIENTIFIC RESEARCH JOURNAL
47
Research Paper
E-ISSN NO : 2455-295X | VOLUME : 3 | ISSUE : 4 | APRIL 2017 5.8519 17.6420 14.8272 0.4815 27.9136 7.0617 19.0370 32.1728 18.8765
M1 W1 v1P11u1 P2 M 2
Then
det M det P1 det P2 298410. (3)
Run detM = det_pq(M),
inputs: [rows; cols] = [4;3], [2;3], [3;3], [3;1],[2;1],[1;1].
1 2 3 M 0 M 2 6 2
k = 1,
8 4 5 1 4 9
3 3 0 2 7 1
4 0 7 0 1 3
3 1 4 5 6 2
2 1 2 3 6 2
4 5 5 2 2 7
2 3 3 0 7 1
0 4 0 7 1 3
5 3 1 4 6 2
37 21 21 14 43
[r1; c1 ] [4; 3]
1 8 P1 u1 4 v W 5 1 1 4 9 z1
1
r1 c1
det P1 1.
17 10 1 M1 W1 v1P 1u1 13 14 16
k = 2,
5 5 2 4 2 7
37
13
4
11 18 14
5 10 15
0 7 1
29
19
3
10 17 13 14
11 37 18 14
0 4 7 1
16
29
3
[r2 ; c2 ] [2; 3]
P2 v 2
5 13 u2 10 W2 15 19
z2
1
r2 c2
21 37 21 14 43
det P2 5.
INTERNATIONAL EDUCATIONAL SCIENTIFIC RESEARCH JOURNAL
48
Research Paper
E-ISSN NO : 2455-295X | VOLUME : 3 | ISSUE : 4 | APRIL 2017
9 7 M 2 W2 v2 P21u2 16 22
k = 3,
8.4 4 19 12.8
z3
1
r3 c3
16 9 7 22
19 49 8.4 17.6 4 21 12.8 36.8
det P3 1.
55 M 3 W3 v P u 119 26
84.4 178.4 137 364 44.2 110.2
1 3 3 3
[r4 ; c4 ] [3; 1] 44.2 110.2 84.4 178.4 137 364
26 P4 u4 v W 55 4 4 119
z4
1
r4 c4
det P4 26.
9.1 65.3
54.7154 140.3769
P5 u5 v W 5 5
65.3 9.1
140.3769 54.7145
M 4 W4 v4 P41u4
k = 5,
17.6 21 49 36.8
[r3 ; c3 ] [3; 3] 1 P3 u3 4 v W 7 3 3 3
k = 4,
4 7 1 3
[r5 ; c5 ] [2; 1]
z5
1
r5 c5
det P5 65.3.
M 5 W5 v5 P51u5 35.153
k = 6,
[r6 ; c6 ] [1; 1]
P6 35.135 z6
1
r6 c6
det P6 35.135.
M6
INTERNATIONAL EDUCATIONAL SCIENTIFIC RESEARCH JOURNAL
49
Research Paper
E-ISSN NO : 2455-295X | VOLUME : 3 | ISSUE : 4 | APRIL 2017
Then,
det M z1 z2 z3 z4 z5 z6 298410.
(4)
Run
detM = det_pq(M),
with inputs: [rows; cols] = [2 4 5; 1 4 5], [1; 2], [1 2; 1 2 ].
1 2 3 M 0 M 2 6 2
k = 1,
5 5 2 4 2 7
8 4 5 1 4 9
3 3 0 2 7 1
4 0 7 0 1 3
3 1 4 5 6 2
3 2 7 4 1 4
0 0 1 1 5 6
1 3 2 5 2 7
3 0 1 8 5 9
4 7 3 3 4 2
[r1; c1 ] [2 4 5; 1 4 5] 2 2 P1 u1 6 v W 5 1 1 4 2 z1
1
r1 c1
det P1 10.0
73.4 M1 W1 v P u 113.2 39.0 1 1 1 1
k = 2,
27.5 59.5 13.0
84.9 161.7 66.0
[r2 ; c2 ] [ 1; 2] 73.4 27.5 P2 u2 59.5 113.2 v W 2 2 13.0 39.0
z2
1
r2 c2
84.9 161.7 66.0
det P2 27.5
45.6109 21.9927 4.3018 25.8655
M 2 W2 v2 P21u2
k = 3,
[r3 ; c3 ] [ 1 2; 1 2]
P3
45.6109 21.9927 4.3018 25.8655
INTERNATIONAL EDUCATIONAL SCIENTIFIC RESEARCH JOURNAL
50
Research Paper
E-ISSN NO : 2455-295X | VOLUME : 3 | ISSUE : 4 | APRIL 2017 z3
1
r3 c3
det P3 1085.1
M3 Then
det M z1 z2 z3 298410.
Conclusion A simple method has been developed for finding the determinant of a given square matrix of high order. The process involves successive applications of an algorithm for matrix order condensation. The algorithm may be modified to resolve the problem in the event that the pivot matrix becomes singular during any iteration step. The sign of the computed result must be adjusted regarding to the swapping of the rows and columns of the pivot matrix at each process step. When compared to various approaches available in the literature [1]-[4], the process presented is very compact, efficient, and involves only the simple elementary arithmetical operations of addition, subtraction, multiplication, and division. It is shown that, no matter what size of pivot matrix chosen at each step, the total number of multiplication/division operations needed to compute the determinant of a 2 2 3 4 given N x N matrix is found to be 3 N N 3 N 1 , where N 3 is the total number of multiplication operations required to compute the product of any two N x N matrices. If we are interested in both determinant and inverse of any given square matrices, the algorithm of matrix order expansion as found in [7] may be useful.
Acknowledgements The author would like to acknowledge the useful help from Dr. George Cheng, Dr. Jan Grzesik, Dr. Young Chu, Ms. Lala Xu and Mr. Felix Wong of Allwave Corporation.
REFERENCES 1. C.T. Su and F.C. Chang, “Quick evaluation of determinant,” Appl. Math. & Compu. 75, 1996, p.117-118. 2. F.C. Chang, “Determinant of matrix by order condensation,” British J. of Math. & Comput. Science, 4(13), 2014, pp.1843-1848. 3. O. Rezaifar and H. Rezaee, “Anew approach for finding the determinant of matrices,” Appl. Math. & Compu. 188, 2007, pp.1445-1454. 4. T. Sogabe, “On a two-term recurrence for the determinant of a general matrix,” Appl. Math. & Compu. 187, 2007, pp.758-788. 5. A. R. Moghaddamfar, S. Navid Salehy and S. Nima Salehy, “The determinant of matrices with recursive entries,” Linear Algeb.& Its appl., 428, 2008, pp.2468-2481. 6. R.S. Bird,”A simple division-free algorithm for computing determinants,” Information Processing Letters, 111, 2011, pp.1072-1074. 7. F.C.Chang,“Inverse and determinant of a matrix by order expansion and condensation,” IEEE Antenas and Propagation Magazine, 57(1), 2015, pp.28-32.
INTERNATIONAL EDUCATIONAL SCIENTIFIC RESEARCH JOURNAL
51