Abstract

The determinant of a matrix is very powerful tool that helps in establishing properties of matrices. Indisputably, its importance in various engineering and applied science problems has made it a mathematical area of increasing significance. From developed and existing methods of finding determinant of a matrix, basketweave method/Sarrus’ rule has been shown to be the simplest, easiest, very fast, accurate, and straightforward method for the computation of the determinant of 3 × 3 matrices. However, its gross limitation is that this method/rule does not work for matrices larger than 3 × 3 and this fact is well established in literatures. Therefore, the state-of-the-art methods for finding the determinants of 4 × 4 matrix and larger matrices are predominantly founded on non-basketweave method/non-Sarrus’ rule. In this work, extension of the simple, easy, accurate, and straightforward approach to the determinant of larger matrices is presented. The paper presents the developments of new method with different schemes based on the basketweave method/Sarrus’ rule for the computation of the determinant of 4 × 4. The potency of the new method is revealed in generalization of the basketweave method/non-Sarrus’ rule for the computation of the determinant of () matrices. The new method is very efficient, very consistence for handy calculations, highly accurate, and fastest compared to other existing methods.

1. Introduction

Over the years, the subject, linear algebra has been shown to be the most fundamental component in mathematics as it presents powerful tools in wide varieties of areas from theoretical science to engineering, including computer science. Its important role and abilities in solving real life problems and in data clarification [1] have led it to be frequently applied in all the branches of science, engineering, social science, and management. During the applications and analysis in such areas of studies, a system of linear equations can be written in matrix form and solving the system of linear equations and the inversion of matrices is necessary which is mainly dependent on determinant (a real number or a function of the elements of an matrix that yields a single number that well determines something about the matrix). Therefore, the importance of finding the determinant in linear algebra cannot be overemphasized as it does not only help in finding solution to systems of linear equations but it also helps determine whether the system has a unique solution and helps establish relationship and properties of matrices. Undoubtedly, the computation of such single number called the determinant is fundamental in linear algebra. It is one of the basic concepts in linear algebra which has major applications in various branches of engineering and applied science problems such as in the solutions systems of linear equations and also in finding the inverse of an invertible matrix. Also, many complicated expressions of electrical and mechanical systems can be conveniently handled by expressing them in “determinant form.” Therefore, it has become a mathematical area of increasing significance as the computation of the determinant of an matrix of numbers or polynomials is a classical problem and challenge for both numerical and symbolic methods. Consequently, various direct and nondirect methods such as butterfly method, Sarrus’ rule, triangle’s rule, Gaussian elimination procedure, permutation expansion or expansion by the elements of whatever row or column, pivotal or Chio’s condensation method, Dodgson’s condensation method, LU decomposition method, QR decomposition method, Cholesky decomposition method, Hajrizaj’s method, and Salihu and Gjonbalaj’s method [135] have been proposed for finding the determinant of matrices. In the gamut of the methods or rules for finding the determinant of the matrices, Sarrus’ rule (a method of finding the determinant of 3 × 3 matrices named after a French mathematician, Pierre Frédéric Sarrus (1798–1861)) has been shown to be the simplest, easiest, fastest, and very straightforward method. Although the wide range of applications of the rule for the computation of the determinant of 3 × 3 matrices is well established, it is grossly limited in applications since it cannot be used for finding the determinants of 4 × 4 matrices and larger matrices. Moreover, the combined idea of finding determinant of 2 × 2 matrices using butterfly method which is the conventional idea in all literatures and using Sarrus’ rule for finding the determinant of 3 × 3 matrices is termed basketweave method. However, the basketweave method does not work on matrices larger than 3 × 3 [1]. Therefore, for larger matrices, the computations of determinants are carried out by methods such as row reduction or column reduction, Laplace expansion method, Dodgson’s condensation method, Chio’s condensations, triangle’s rule, Gaussian elimination procedure, LU decomposition, QR decomposition, and Cholesky decomposition. However, these methods are not as simple, easy, fast, and very straightforward as basketweave method/Sarrus’ rule. Additionally, the cost of the computation of the determinant of a matrix of order is about arithmetic operations using Gauss elimination; if the order of the matrix is large enough, then the computation is not feasible. Therefore, Rezaifar and Rezaee [1] developed a recursion technique to evaluate the determinant of a matrix. In their quests for establishing a new scheme for the generalization of Rezaifar and Rezaee’s procedure, Dutta and Pal [36] pointed out the limitation of Rezaifar and Rezaee’s procedure as it fails to evaluate the values of the determinants of matrices in some cases. Therefore, in this paper, a new method using different schemes based on Sarrus’ rule was developed to carry out the computation of the determinant of 4 × 4 matrices. The developed method is shown to be very quick, easy, efficient, very usable, and highly accurate. It creates opportunities to find other new methods based on Sarrus’ rule to compute determinants of higher orders. Also, the new approach has been shown to be applicable to the computation of determinants of larger matrices such as 5 × 5, 6 × 6, and all other () matrices.

2. Definition of Determinants

The determinant of matrix square matrix is a real number or a function of the elements of the matrix which well determines something about the matrix. It determines whether the system has a unique solution and whether the matrix is singular or not.

The determinant of an -order matrix will be called sum, which has ! different terms which will be formed of matrix elements.

Let be an matrix:Then determinant of iswhere The determinant of matrix could also be written in Laplace cofactor form as

3. Existing Methods of Computation of Determinants

The easiest way to find the determinant of a matrix is to use a computer program which has been optimized so as to reduce the computational time and cost, but there are several ways to do it by hand [3743]. Therefore, the computation of determinants of matrices has been carried out by some existing methods in literature such as basketweave method, butterfly method, Sarrus’ method, triangle’s rule, Gaussian elimination procedure, permutation expansion or Laplace expansion by the elements of whatever row or column, row reduction method, column reduction method, pivotal or Chio’s condensation method, Dodgson’s condensation method, LU decomposition method, QR decomposition method, Cholesky decomposition method, Hajrizaj’s method, Salihu and Gjonbalaj’s method, Rezaifar and Rezaee’s method, and Dutta and Pal’s method. The simplest among these methods is the basketweave method which could be stated as the combination of butterfly method for determinant computation of 2 × 2 matrices and Sarrus’ rule for determinant computation of 3 × 3 matrices.

3.1. The Butterfly Method

A 2 × 2 matrix is written asIn order to find the determinant of the 2 × 2 matrix, we carry out the diagonal products. We then subtract the diagonal product as we go right to left from the diagonal product of a square matrix as left to right as follows:

Example 1. Evaluate :

3.2. Sarrus’ Method

A 3 × 3 matrix is written asSarrus’ rule which is sometimes also called the basketweave method is an alternative way to evaluate the determinant of a 3 × 3 matrix. It is a method that is only applicable to 3 × 3 matrices. It follows the same process as carried out in the 3 × 3 matrix, except that we need to repeat the first two columns to the right of the original matrix and then do the basketweave method. Therefore, a 3 × 5 array is constructed by writing down the entries of the 3 × 3 matrix and then repeating the first two columns at the back of the third column. We calculate the products along the six diagonal lines shown in the diagram. The determinant is equal to the sum of products along diagonals labeled 1, 2, and 3 minus the sum of the products along the diagonals labeled 4, 5, and 6. An example is shown as follows:

Example 2. Evaluate :Multiplication of the numbers on the same line, addition of the ones from down-going lines, and subtraction of the ones from up-going lines are an approach that led to the name “the basketweave method.” Unfortunately, the simple weave method does not work on matrices larger than 3 × 3.
The use of Laplace cofactor expansion along either the row or column is a common method for the computation of the determinant of 3 × 3, 4 × 4, and 5 × 5 matrices. The evaluation of the determinant of an matrix using the definition involves the summation of ! terms, with each term being a product of factors. As increases, this computation becomes too cumbersome. This drawback is not only peculiar to Laplace cofactor expansion method as other common methods developed in literatures also required additional computational cost and time for the computation of determinant. Therefore, in recent times, different techniques have been devised in literatures. However, these techniques are not as simple, easy, fast, and very straightforward as the basketweave method/Sarrus’ rule. Additionally, many of them come with relatively high computational cost and time.

4. The Development of the New Methods for the Computation of Determinants

Consider a 4 × 4 matrix whose determinant is required, given as follows:Following the definition given in Section 2, the conventional method of finding the determinant by Laplace cofactor expansion method is carried out as follows.

Expanding along the first row, we haveAgain, expanding each of the 3 × 3 matrices along the first row, we haveNow, we haveSo, it is shown that 4! different terms will be needed to compute the determinant of the forth-order matrices.

In order to generate these 4! different terms (24 terms), we have the following 3 different 4 × 4 matrices as follows: In the arrangements, , , , and represent the first, the second, the third, and the fourth columns, respectively, as given in the original 4 × 4 matrix. We could see in (15) that the first arrangement of matrix remains the same as given in the original matrix . To get the second arrangement of another 4 × 4 matrix, remove and transfer the second column in the first arrangement to the last column of the given 4 × 4 matrix . To get the third arrangement of another new 4 × 4 matrix, remove and transfer the second column in the second arrangement to be the last column of the second 4 × 4 matrix. This forms the third 4 × 4 matrix. After the third step, we need not go further to perform the procedure of removing and transferring the second column in the first arrangement to the last column of the given 4 × 4 matrix because if we do we will end up repeating the first step or getting the first original 4 × 4 matrix in this procedure. In fact, this approach helps us know when to stop the procedures. That is why the last arrangement was cancelled.

Following the procedure, we have 4 × 4 matrices.

The first 4 × 4 matrix isThe second 4 × 4 matrix isThe third 4 × 4 matrix isFrom the above, 10 new schemes based on Sarrus’ rule were developed for the computation of the determinant of the 4 × 4 matrix.

In the new method/scheme, the next step to find after the arrangements is as follows:(1)In the first submatrix , rewrite the 1st, 2nd, and 3rd columns on the right-hand side of matrix (as columns 5, 6, and 7). To the resulting 4 × 7 augmented matrix, assign “+” to the leading element in the odd numbered columns and assign “−” sign to the leading element in the even numbered columns. This givesThis is the first part of the solution of the computation of determinant of the given 4 × 4 matrix.(2)In the second submatrix , rewrite the 1st, 2nd, and 3rd columns on the right-hand side of matrix ( as columns 5, 6, and 7). As in the first step, to the augmented matrix, assign “+” to the leading element in the odd numbered columns and assign “−” sign to the leading element in the even numbered columns and then apply Sarrus’ rule. This is the second part of the computation of determinant of the given 4 × 4 matrix.(3)In the third submatrix , rewrite the newest 1st, 2nd, and 3rd columns on the right-hand side of matrix (as columns 5, 6, and 7). And again, to the augmented matrix, assign “+” to the leading element in the odd numbered columns and assign “−” sign to the leading element in the even numbered columns and then apply Sarrus’ rule. This is the third part of the computation of determinant of the given 4 × 4 matrix.(4)For each of augmented matrices , , and , apply Sarrus’ rule by adding the products along the four full diagonals that extend from upper left to lower right and subtract the products along the four full diagonals that extend from the lower left to the upper right. After finding the determinant of the augmented matrices , , and , the addition of the results after applying Sarrus’ rule on the augmented matrices , , and is the determinant of . This is shown as follows:Therefore, we have () which is equivalent in all entireties to (14) when Laplace cofactor expansion method is used:Alternatively, the new scheme could be carried out in another way. In the alternative way, the algorithm still remains the same but the difference is in the manner where the submatrices , , and are constructed. In this scheme, we rewrite the 1st, 2nd, and 3rd columns on the left-hand side of matrix (as columns 0, −1, and −2) to form the required 4 × 7 augmented matrix. Therefore, we have the submatrices , , and given as

As before, Again, we arrived at (14):Furthermore, the new scheme could be carried out in another way. In this alternative approach to the new method, the submatrices , , and are constructed via a different approach. The determinant of the given fourth-order matrix is found as shown below.

First submatrix isSecond submatrix isThird submatrix isAs before,

Then, we arrived at (14):

5. Numerical Examples

In our numerical example, we investigate the workability, correctness, and efficiency of the use of the new method. We do this by first applying the other known and common methods such as expansion of cofactors method, pivotal condensation method, and the new method based on Sarrus’ rule.

Example 1. One hasUsing Laplace Expansion of Cofactor Method. One hasUsing Chio’s Pivotal Condensation Method. One hasInitialize and reduce to row echelon form [35]:Adding −2 times the first row to the second row, remains 1:Adding 1 times the first row to the third row, remains 1:Adding −6 times the first row to the fourth row, remains 1:Multiplying the second row by −1/6, :Adding −5 times the second row to the third row, remains −6:Adding 7 times the second row to the fourth row, remains −6.
Multiplying the second row by 6/13, :Adding −13/6 times the third row to the fourth row, remains −13:The matrix is now in row echelon form with diagonal elements 1, 1, 1, and 0.
Thus, .
Using the New Method (Gbemi’s Method). One hasHence,Applying Sarrus’ rule to the second part ,Applying Sarrus’ rule to the third part ,Therefore,

Example 2.
Using the Laplace Expansion of Cofactors Method. One hasUsing the New Method (Gbemi’s Method). One hasHence,Therefore, Hence,It should not be that we only apply the first scheme in this example. If we use any of the 10 schemes developed in work, we will still arrive at the same results.

6. Efficiency of the New Method

6.1. Asymptotic Analysis

In order to determine the efficiency of the method, an asymptotic analysis was carried out using big-. The advantage of asymptotic analysis is that it is independent of the computer specifications. This will be used to compare the existing methods with the new method.

The conventional method in most texts and literatures is the Laplace expansion method which evaluates the determinant as a weighted sum of its submatrices. It is well established in literature that the run time of the Laplace expansion method for finding determinant is .

6.1.1. Run Time of New Method

The new method evaluates the determinant of a 4 × 4 matrix as an extension of Sarrus’ rule. Thus, for every diagonal, there are items that are visited. Thus, the running time is . This can also be verified from the MATLAB program. There are two nested for loops which means an algorithm.

6.1.2. Run Time of Other Variations of the New Method

Analyzing the other variations of the new method, the run time is .

7. Programming

This section presents the evaluation of the new approach (called the G-method) and its ability to be used in programming (i.e., as a subroutine for more applications); the program is written in MATLAB. Also, the MATLAB codes for Rezaifar and Rezaee [1] and Laplace expansion method are also presented as shown in Algorithm 1.

function answer = GMethod(A,part)
%% Developed by Sobamowo M. Gbeminiyi************************************
%% GMethod stands for Gbeminiyis method.
n = length(A);
sum1 = 0;
sum2 = 0;
for i = 1:1:n
  sum3 = 1;
  sum4 = 1;
  for j = 1:1:n
  sum3 = sum3*A(j,non_zero(mod(i+j-1,4),4));
  sum4 = sum4*A(n - j + 1,non_zero(mod(i+j-1,4),4));
  end
  sum1 = sum1 + ((-1)(i+1))*sum3;
  sum2 = sum2 + ((-1)(i))*sum4;
end
answer = (sum1 - sum2);
if part <= 2
  answer = answer + GMethod([A(:,1),A(:,3:n),A(:,2)],part+1);
end
end
function answer = RMethod(m)
%% Developed by Omid Rezaifar.****************************************
%% RMethod stands for Rezaifar Method.
%% Developed by Omind Rezaifar.
%% This code was extracted from [31, 3842]
n = length(m);
if n == 1
answer = m;
elseif n == 2
answer = m(1,1)*m(2,2) - m(1,2)*m(2,1);
else
m11 = m(2:n,2:n);
m1n = m(2:n,1:n -1);
mn1 = m(1:n -1,2:n);
mnn = m(1:n - 1, 1:n -1);
m11nn = m11(1:n -2, 1:n-2);
answer = RMethod(m11)*RMethod(mnn) - RMethod(m1n)*RMethod(mn1);
answer = answer / RMethod(m11nn);
end
end
function [answer] = ExpansionMethod(A)
%% Laplace Expansion Method ******************************************
%%
n = length(A);
if  n==1
  answer = A;
else
  if  n == 2
    answer = A(1,1)*A(2,2) - A(1,2)*A(2,1);
  else
    answer = 0;
    for i = 1:1:n
      answer = answer + ((-1)(1+i)*A(1,i))*ExpansionMethod([A(2:n,1:i - 1), A(2:n, i+1:n)]);
    end
  end
end
>> ExecutionTest1
Matrix Executed
Average Time per Execution For Laplace Expansion Method
Number of Executions = 1000
Total Time for Execution = 0.453
Average Time per Execution = 0.000453
>> ExecutionTest2
Matrix Executed
Average Time per Execution For Gbeminiyi Method (G-Method)
Number of Executions = 1000
Total Time for Execution = 0.218
Average Time per Execution = 0.000218
>> ExecutionTest3
Matrix Executed
Average Time per Execution For Rezaifar Method
Number of Executions = 1000
Total Time for Execution = 0.359
Average Time per Execution = 0.000359

8. Comparison with Existing Methods

The running time is far better than running time. This means that the G-method (the new method) is more efficient than the existing Laplace expansion method and other existing methods for the computation of 4 × 4 matrix. This fact was also illustrated with the execution time of the MATLAB code run on an Intel® Core™2 Duo CPU 2.00 GHz 4.00 GB (RAM) system. The codes for the Laplace expansion method and G-method were run with a test matrix.

In order to see the difference in execution time and speed of execution more efficiently, the algorithm has to be run many times. Therefore, the codes were run 1000 and 10,000 times on the same matrix, and the average execution time per problem is calculated. The results are shown in Tables 1 and 2.

It can been seen from Tables 1 and 2 that the new method saves much time and the speed of running is faster than the Laplace expansion and Rezaifar’s methods. Although the recursive loops in Rezaifar’s method make it be used more in programming, if the division by zero appears during the computation of the determinant of a matrix, then the method fails to evaluate the value of the determinant unless rows are changed and as a result the determinant altered [1]. This shortcoming or limitation of Rezaifar’s method was also pointed out by Dutta and Pal [36]. However, the newly developed method (G-method) overcomes the limitation of Rezaifar’s method.

For the optimized MATLAB in-built method, for the 1000 number of executions, the total time for execution is 0.015 sec, while the average time per execution is 0.000015 sec. However, it has been pointed out that, commonly in machine programs which required some algorithm to find the determinant of matrices, Gaussian elimination or Gauss-Jordan method is used. This method is based on linear and unilateral approach to find the determinant [1]. It is hoped that if this newly developed algorithm is optimized, it will run faster than the MATLAB in-built method.

9. Conclusion and Future Works

In this paper, efficient techniques based on Sarrus’ rule for computation of the determinant of 4 × 4 matrices have been proposed. The techniques are shown to be very quick, easy, efficient, very usable, and highly accurate. The new method creates opportunities to find other new methods based on Sarrus’ rule to compute determinants of higher orders. Also, the new approach has been shown to be applicable to compute the determinants of larger matrices such as 5 × 5, 6 × 6, and all other () matrices. This will be presented in the second part of the paper.

Competing Interests

The author declares that there are no competing interests regarding the publication of this paper.