A Space Efficient Flexible Pivot Selection Approach to Evaluate Determinant and Inverse of a Matrix

This paper presents new simple approaches for evaluating determinant and inverse of a matrix. The choice of pivot selection has been kept arbitrary thus they reduce the error while solving an ill conditioned system. Computation of determinant of a matrix has been made more efficient by saving unnecessary data storage and also by reducing the order of the matrix at each iteration, while dictionary notation [1] has been incorporated for computing the matrix inverse thereby saving unnecessary calculations. These algorithms are highly class room oriented, easy to use and implemented by students. By taking the advantage of flexibility in pivot selection, one may easily avoid development of the fractions by most. Unlike the matrix inversion method [2] and [3], the presented algorithms obviate the use of permutations and inverse permutations.


Introduction
The term determinant is originally associated with the system of linear equations. It provides us with a foresight about the nature of solution of a given system of linear equations.
Maclaurin [4] published the first result on determinant of 2|2 and 3|3 system, which was generalized for n|n systems by Cramer [5]. Later, the well known Laplace expansion for evaluating determinant was proposed by Laplace, but he had then used the term 'resultant' instead of determinant. The first use of the term determinant in the modern context was done by Cauchy [6]. In 1866, Dodgson presented another method for finding the determinant of n|n systems which he named as the ''Method of condensation'' [7]. For larger systems the most preferred method for evaluating the determinant up till now is the Gaussian method [8]. It deals with the problem by converting the coefficient matrix into its equivalent upper/lower triangular form. The product of the pivot elements gives the determinant.
The existence of matrix inverse also depends on its determinant. The method of finding the inverse by Gaussian method is discussed later in this paper. Ahmed & Khan [2], and Khan, Shah, & Ahmad [3] proposed algorithms for the calculation of inverse of a matrix which are streamlined forms of the Gaussian method and also require permutation and inverse permutations. In this paper, we have presented two new algorithms related to the evaluation of determinant and inverse of a matrix. The first presented algorithm evaluates the determinant and is more efficient than Gaussian method as it reduces the order of the matrix at each iteration thereby saving unnecessary computations. In the second algorithm, we have presented another easy to mange way to calculate the inverse of the matrix by constructing the dictionary of the given system and thus excluding the need of permutations and inverse permutations.

Determinant of A Matrix: A Brief Review
Determinant of a square matrix A, denoted by det(A), is basically a real valued function. Because of its useful relationship with the matrix A and the solution to the system of equations of the form Ax = b, it becomes essential to have a knowledge about determinants while studying matrices. Evaluation of a determinant through its cofactor expansion (also known as Laplace expansion) is famous for lower order n|n matrices. Let M ij be the minor of entry a ij ,(i[f1,2, Á Á Á ,ng,j[f1,2, Á Á Á ,ng) which is the determinant of the sub-matrix obtained after deleting the i th row and j th column of A.

Consider
If j th column of A is opted for cofactor expansion then, where, C ij is the cofactor of entry a ij such that Similarly the cofactor expansion along the i th row would be For a matrix of order n, the evaluation of determinant by the above cofactor expansion requires computing n determinants of matrices of order (n21). Therefore it can be implemented for finding determinant of a matrix of order 2 or 3 with ease but for higher orders it becomes a tedious job. To reduce the computational effort usually the following three basic row operations of matrices are incorporated to evaluate the determinant [9], the method is known as evaluation of determinant by row reduction (also known as Gaussian method).

Elementary row operations
Let A be an n|n matrix, the following elementary row operations can be applied a) Multiply a row by a non-zero constant. b) Interchange two rows. c) Add a multiple of one row to another row.
Effect of row operations on the value of determinant: [9] Let A be an n|n matrix then a) If B is the matrix that results when a single row or single column of A is multiplied by a scalar k, then det(B) = k det(A). b) If B is the matrix that results when a two rows or two columns of A are interchanged then det(B) = 2det(A). c) If B is the matrix that results when a multiple of one row of A is added to another row or when a multiple of one column is added to another column, then det(B) = det(A).

Lemma: [9]
If A is an n|n triangular matrix (upper triangular, lower triangular or diagonal), then det(A) is the product of the entries on the main diagonal of the matrix; that is, det (A)~a 11 a 22 . . . a nn .
The New Method Approach of row reduction may involve all the elementary row operations, as illustrated in above example. Here we are defining an operation (say pivot operation for evaluation of determinant) which consists of (n21) applications of row operation (c) only, and can be employed to evaluate the determinants avoiding involvement of row operations (a) and (b).
For example consider the following matrix, Selecting a non-zero pivot element located at any arbitrary location (i, j), say a ij , and performing row operation (c) to make the remaining elements of the j th column zero we get  Here we can see that the pivot row remains unchanged while the (p,k) th element of the matrix, a 0 pk~a pk { a pj a ij |a ik , where a pj and a ik are the elements corresponding to the pivot element in the pivot column and pivot row respectively. Cofactor expansion along the j th column will give The above procedure results in a computation of determinant of a matrix with reduced order of (n21). A repetition of the above procedure will eventually give a 2|2 determinant. For a n|n matrix there must be n non-zero pivot elements. The product of respective pivot elements gives the value of the determinant. However, if at any step there is no non-zero pivot exists, we can deduce that the determinant of the given matrix is 0.

Problem 1
Find determinant of the matrix A = ½a ij of order n.
Step 4: If L = Q then d = 0 and go to step 7 Otherwise m :~a pk p[P, k[L, and Step 5: Reduce the order of A by removing p th row and k th column of A. Also set n: = n21 Step 6: d :~({1) pzk |m|d. If n=0 go to step 2.

Example
Consider the matrix Hence determinant of given matrix is 12.

Comparison with row reduction method
The above example illustrates the efficiency of the algorithm in terms of memory storage and the number of elements computed. If a matrix of order 4 is solved by row reduction method the number of elements computed will be 12, 6 and 2 in first, second and third iterations respectively. However we have computed 9, 4 and 1 elements in the respective iterations. So the total number of element computations needed for row reduction method is 20, but our method needs only 14 element computations. Also, at each iteration the size of the matrix has been reduced. Row reduction method needs to store 16 elements for each iteration, hence on the whole method requires 48 elements to be stored in the memory, while in contrast our algorithm stores 16+9+4+1 = 30 elements, which is a noteworthy reduction in terms of storage requirement.
A comparison of the number of elements computed and stored to evaluate the determinant of different orders by row reduction and our algorithm are shown in table 1.

Inverse of A Matrix: A Brief Review
Consider a matrix A~½a ij of order n. To evaluate the inverse of the matrix, say B, one must solve the following n system of equations, for x 1 ,x 2 , . . . ,x n a 11 x 1 a 12 x 2 Á Á Á a 1n x n~y1 a 21 x 1 a 22 x 2 Á Á Á a 2n x n~0 a n1 x 1 a n2 x 2 Á Á Á a nn x n~yn system n ð Þ The solutions of the above system are From system (1) : x 1~b11 y 1 ,x 2~b21 y 2 , Á Á Á ,x n~bn1 y n From system (2) : x 1~b12 y 1 ,x 2~b22 y 2 , Á Á Á ,x n~bn2 y n . . .
From system (n) :x 1~b1n y 1 ,x 2~b2n y 2 , Á Á Á ,x n~bnn y n Then the matrix B~b where x~x 1 x 2 Á Á Á x n ½ T y~y 1 y 2 Á Á Á y n ½ T and I is identity matrix of order n.
If A is invertible, applying successive elementary row operations of Gaussian method yields, The New Approach Based on Dictionary Notation Usually the following augmented matrix is used to solve above system, Here, we are using the concept of dictionary notation developed by [1]. Now basic variables are the variables whose coefficients are in the form of any column of identity matrix, and a basis is collection of all basic variables. We can see that basis for the above matrix B~fy 1 ,y 2 , Á Á Á ,y n g and we may consider N~fx 1 ,x 2 , Á Á Á ,x n g as the non-basis of the current matrix. The objective is to convert the basic variables into non-basic variables and vice versa by using pivot operations. Using the dictionary concept defined by [1] we can remove the basic columns from the matrix and construct the following dictionary form with basis B and non-basis N: (Note basic variables are shown in left most column and non basic variables in the top row of the dictionary). Pivot operation for evaluating inverse The following pivot operations [1] may be applied to enter x i into basis B and y j into non-basis N,

i)
Divide the pivot row by pivot element and the pivot column by negative of the pivot element (except the pivot element). ii) The remaining (n21) 2 elements are determined by the formula as defined in the new method of determinant. iii) Reciprocate the pivot element.
If the number of pivot elements is equal to the order of the matrix the resulting matrix gives the inverse otherwise we may conclude that the inverse does not exist.

Problem 2
Find the inverse of matrix A = ½a ij of order n|n.
Step 2: Step 5: B :~Bzfx k g{fy p g and N :~N{fx k gzfy p g. Update D(A) and go to step 2. Step

Comparison with Gaussian method
The above example illustrates the efficiency of the algorithm in terms of memory storage and the number of elements computed. If a matrix of order 4 is solved by Gaussian method the number of elements computed will be 20 at each iteration. However our method requires computation of 16 elements at each iteration. So the total number of element computations needed for Gaussian method is 80, on the other hand for our method it is 64. Also the Gaussian method needs to store 32 elements for each iteration, hence on the whole Gaussian method requires 128 elements to be stored in the memory, while in contrast our algorithm stores 64 elements, which is a noteworthy reduction in terms of storage requirement.
A comparison of the number of elements computed and stored to evaluate the inverse by Gaussian method and our algorithm are shown in table 2.

Applications
Matrix determinant and inverse have applications in various fields like mathematics, economics, physics, biology etc. Solving different models like population growth involve the use of matrix determinant and inverse. Matrix inverse and determinant are also used in cryptography [10]. Linear transformations (rotation, reflection, translation etc.) involve the calculation of matrix inverse. Matrix inverse and determinant are also employed in operations research while solving linear programs, revised simplex method and markov chains. Determinants of order 3 are used to find area of triangles and for testing colinearity of points. Least square analysis of data requires the evaluation of matrix inverse [11]. p-dimensional volume of parallelepiped in < m is determined by computing determinant [12].

Conclusion
This paper presented easy algorithms for computations of determinant and inverse of a matrix. Since the order of the given matrix has been reduced at each step while calculating its determinant, the algorithm reduces the storage requirement (as exhibited in the example). The calculation of inverse has been done using the dictionary notation which obviates the use of permutations and makes it easier to cope with in class room teaching. Ill conditioned system can also be handled as the selection of pivots has been kept arbitrary, thus improving the numerical accuracy of the system.