# On the Extension of Sarrus’ Rule ton×n(n>3) Matrices: Development of New Method for the Computation of the Determinant of 4×4 Matrix

Authors: M. G. Sobamowo
Journal: International Journal of Engineering Mathematics
 (2016)

---

## 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 ofn×n (n>3) matrices. The new method is very efficient, very consistence for handy calculations, highly accurate, and fastest compared to other existing methods.


---

## Body

## 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 n×n 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 n×n matrix A 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 [1–35] have been proposed for finding the determinant of n×n matrices. In the gamut of the methods or rules for finding the determinant of the n×n 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 n is about 2n3/3 arithmetic operations using Gauss elimination; if the order n 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 n×n (n>6) matrices.


## 2. Definition of Determinants

The determinant ofn×n matrix square matrix A=[aij] 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 ann-order matrix will be called sum, which has n! different terms εj1,j2,…,jna1j1a2j2⋯anjn which will be formed of matrix A elements.LetA be an n×n matrix:(1)A=a11a12⋯a1na21a22⋯a2n··⋯a3n··⋯a4nan1an2⋯a5n.Then determinant of A is(2)D=det⁡A=A=a11a12⋯a1na21a22⋯a2n··⋯a3n··⋯a4nan1an2⋯a5n=∑snεj1,j2,…,jna1j1a2j2⋯anjn,where (3)εj1,j2,…,jn=+1,ifj1,j2,…,jnisanevenpermutation-1,ifj1,j2,…,jnisanoddpermutation.The determinant of matrix A could also be written in Laplace cofactor form as(4a)det⁡A=A=∑i=1n-1i+jai,jdet⁡Aij(4b)det⁡A=A=∑j=1n-1i+jai,jdet⁡Aij.


## 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 [37–43]. 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 as(5)A=a11a12a21a22.In 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:(6)Example 1.
EvaluateA=1-463:(7)


### 3.2. Sarrus’ Method

A 3 × 3 matrix is written as(8)a11a12a13a21a22a23a31a22a33.Sarrus’ 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:(9)Example 2.
EvaluateA=123214325:(10)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 ann×n matrix using the definition involves the summation of n! terms, with each term being a product of n factors. As n 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.


## 3.1. The Butterfly Method

A 2 × 2 matrix is written as(5)A=a11a12a21a22.In 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:(6)Example 1.
EvaluateA=1-463:(7)


## 3.2. Sarrus’ Method

A 3 × 3 matrix is written as(8)a11a12a13a21a22a23a31a22a33.Sarrus’ 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:(9)Example 2.
EvaluateA=123214325:(10)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 ann×n matrix using the definition involves the summation of n! terms, with each term being a product of n factors. As n 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:(11)A=a11a12a13a14a21a22a23a24a31a32a33a34a41a42a43a44.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 have(12)det⁡A=a11a22a23a24a32a33a34a42a43a44-a12a21a23a24a31a33a34a41a43a44+a13a21a22a24a31a32a34a41a42a44-a14a21a22a23a31a32a33a41a42a43.Again, expanding each of the 3 × 3 matrices along the first row, we have(13)det⁡A=a11a22a33a34a43a44-a23a32a34a42a44+a24a32a33a42a43-a12a21a33a34a43a44-a23a31a34a41a44+a24a31a33a41a43+a13a21a32a34a42a44-a22a31a34a41a44+a24a31a32a41a42-a14a21a32a33a42a43-a22a31a33a41a43+a23a31a32a41a42.Now, we have(14)det⁡A=a11a22a33a44-a12a23a34a41+a13a24a31a42-a14a21a32a43-a13a22a31a44-a12a21a34a43+a11a24a33a42-a14a23a32a41+a11a23a34a42-a13a24a32a41+a14a22a31a43-a12a21a33a44-a14a23a31a42-a13a21a32a44+a11a22a34a43-a12a24a33a41+a11a24a32a43-a14a22a33a41+a12a23a31a44-a13a21a34a42-a12a24a31a43-a14a21a33a42+a11a23a32a44-a13a22a34a41.So, 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:(15)In the arrangements, C1, C2, C3, and C4 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 C1C2C3C4 of 4×4 matrix remains the same as given in the original matrix A. To get the second arrangement C1C3C4C2 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 A. To get the third arrangement C1C4C2C3 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 is(16)Afp=a11a12a13a14a21a22a23a24a31a32a33a34a41a42a43a44.The second 4 × 4 matrix is(17)Asp=a11a13a14a12a21a23a24a22a31a33a34a32a41a43a44a42.The third 4 × 4 matrix is(18)Atp=a11a14a12a13a21a24a22a23a31a34a32a33a41a44a42a43.From 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 finddet⁡(A) after the arrangements is as follows:(1)
In the first submatrixAfp, rewrite the 1st, 2nd, and 3rd columns on the right-hand side of matrix Afp (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 gives(19)Aargfp=+-+-+-+a11a12a13a14a11a12a13a21a22a23a24a21a22a23a31a32a33a34a31a32a33a41a42a43a44a41a42a43.This is the first part of the solution of the computation of determinant of the given 4 × 4 matrix.(2)
In the second submatrixAsp, rewrite the 1st, 2nd, and 3rd columns on the right-hand side of matrix Asp ( 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. (20)Aargsp=+-+-+-+a11a13a14a12a11a13a14a21a23a24a22a21a23a24a31a33a34a32a31a33a34a41a43a44a42a41a43a44.This is the second part of the computation of determinant of the given 4 × 4 matrix.(3)
In the third submatrixAtp, rewrite the newest 1st, 2nd, and 3rd columns on the right-hand side of matrix Atp (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. (21)Aargsp=+-+-+-+a11a12a13a14a11a12a13a21a22a23a24a21a22a23a31a32a33a34a31a32a33a41a42a43a44a41a42a43.This is the third part of the computation of determinant of the given 4 × 4 matrix.(4)
For each of augmented matricesAargfp, Aargsp, and Aargtp, 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 Aargfp, Aargsp, and Aargtp, the addition of the results after applying Sarrus’ rule on the augmented matrices Aargfp, Aargsp, and Aargtp is the determinant of A. This is shown as follows:(22)Therefore, we have (9) which is equivalent in all entireties to (14) when Laplace cofactor expansion method is used:(23)A=a11a22a33a44-a12a23a34a41+a13a24a31a42-a14a21a32a43-a13a22a31a44-a12a21a34a43+a11a24a33a42-a14a23a32a41+a11a23a34a42-a13a24a32a41+a14a22a31a43-a12a21a33a44-a14a23a31a42-a13a21a32a44+a11a22a34a43-a12a24a33a41+a11a24a32a43-a14a22a33a41+a12a23a31a44-a13a21a34a42-a12a24a31a43-a14a21a33a42+a11a23a32a44-a13a22a34a41.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 Afp, Asp, and Atp are constructed. In this scheme, we rewrite the 1st, 2nd, and 3rd columns on the left-hand side of matrix A (as columns 0, −1, and −2) to form the required 4 × 7 augmented matrix. Therefore, we have the submatrices Afp, Asp, and Atp given as (24)Afp=a12a13a14a11a12a13a14a22a23a24a21a22a23a24a32a33a34a31a32a33a34a42a43a44a41a42a43a44Asp=a13a14a12a11a13a14a12a23a24a22a21a23a24a22a33a34a32a31a33a34a32a43a44a42a41a43a44a42Atp=a14a12a13a11a14a12a13a24a22a23a21a24a22a23a34a32a33a31a34a32a33a44a42a43a41a44a42a43.As before,(25)Again, we arrived at (14):(26)det⁡A=a11a22a33a44-a12a23a34a41+a13a24a31a42-a14a21a32a43-a13a22a31a44-a12a21a34a43+a11a24a33a42-a14a23a32a41+a11a23a34a42-a13a24a32a41+a14a22a31a43-a12a21a33a44-a14a23a31a42-a13a21a32a44+a11a22a34a43-a12a24a33a41+a11a24a32a43-a14a22a33a41+a12a23a31a44-a13a21a34a42-a12a24a31a43-a14a21a33a42+a11a23a32a44-a13a22a34a41.Furthermore, the new scheme could be carried out in another way. In this alternative approach to the new method, the submatrices Afp, Asp, and Atp are constructed via a different approach. The determinant of the given fourth-order matrix A is found as shown below.First submatrix is(27)Second submatrix is(28)Third submatrix is(29)As before,(30)det⁡A=SAfp+SAsp+SAtp.Then, we arrived at (14): (31)det⁡A=a11a22a33a44-a12a23a34a41+a13a24a31a42-a14a21a32a43-a13a22a31a44-a12a21a34a43+a11a24a33a42-a14a23a32a41+a11a23a34a42-a13a24a32a41+a14a22a31a43-a12a21a33a44-a14a23a31a42-a13a21a32a44+a11a22a34a43-a12a24a33a41+a11a24a32a43-a14a22a33a41+a12a23a31a44-a13a21a34a42-a12a24a31a43-a14a21a33a42+a11a23a32a44-a13a22a34a41.


## 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 has(32)1-2-342-25-6-13-4665-36.
Using Laplace Expansion of Cofactor Method. One has(33)A=12-342-25-6-13-4665-36det⁡A=1-25-63-465-36-225-6-1-466-36+-32-2-6-136656-42-25-13-465-3det⁡A=1-2-46-36-53656+-63-45-3-22-46-36-5-1666+-6-1-46-3+-323656--2-1666+-6-1365-423-45-3--2-1-46-3+5-1365det⁡A=1-2-24+18-518-30-6-9+20-22-24+18-5-6-36-63+24-3218-30+2-6-36-6-5-18-42-9+20+23+24+5-5-18det⁡A=6+-72+-90+156=0.
Using Chio’s Pivotal Condensation Method. One has(34)A=12-342-25-6-13-4665-36.Initialize D=1 and reduce A to row echelon form [35]:(35)12-340-611-6-13-4665-46.Adding −2 times the first row to the second row, D remains 1:(36)12-340-611-1405-71065-46.Adding 1 times the first row to the third row, D remains 1:(37)12-340-611-1405-7100-715-18.Adding −6 times the first row to the fourth row, D remains 1:(38)
1
2
-
3
4
0
1
-
11
6
14
6
0
5
-
7
10
0
-
7
15
-
18
.Multiplying the second row by −1/6, D←D(-6)=1(-6)=-6:(39)
1
2
-
3
4
0
1
-
11
6
14
6
0
0
13
6
-
5
3
0
-
7
15
-
18
.Adding −5 times the second row to the third row, D remains −6:(40)
1
2
-
3
4
0
1
-
11
6
14
6
0
0
13
6
-
5
3
0
-
7
13
6
-
5
3
.Adding 7 times the second row to the fourth row, D remains −6.
Multiplying the second row by 6/13,D←D(13/6)=-6(13/6)=-13:(41)
1
2
-
3
4
0
1
-
11
6
14
6
0
0
1
-
10
13
0
0
13
6
-
5
3
.Adding −13/6 times the third row to the fourth row, D remains −13:(42)
1
2
-
3
4
0
1
-
11
6
14
6
0
0
1
-
10
13
0
0
0
0
.The matrix is now in row echelon form with diagonal elements 1, 1, 1, and 0.
Thus,det⁡A=-13(1)(1)(0)=0.
Using the New Method (Gbemi’s Method). One has(43)A=12-342-25-6-13-4665-36Afp=12-3412-32-25-62-25-13-46-13-465-3665-4Asp=1-3421-3425-6-225-6-1-463-1-466-3656-36Atp=142-31422-6-252-6-2-163-4-163665-3665.Hence,(44)Applying Sarrus’ rule to the second part Asp,(45)Applying Sarrus’ rule to the third part Atp,(46)Therefore, (47)det⁡A=SAfp+SAsp+SAtp=-126+142+-16=0.Example 2.
⁡
Using the Laplace Expansion of Cofactors Method. One has(48)A=2233233253793247det⁡A=2332379247-2232579347+3232539327-3233537324det⁡A=2349-36-321-18+212-14-2249-36-335-27+220-21+3221-18-335-27+210-9-3212-14-320-21+310-9=-2.
Using the New Method (Gbemi’s Method). One has(49)A=2233233253793247Afp=2233223233223353795373247324Asp=2332233232323257935793472347Atp=2323232223322359375933724372.Hence,(50)Therefore, (51)det⁡A=SAfp+SAsp+SAtp=-26-58+82=-2.Hence,(52)det⁡A=-2.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-O. 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 isO(n!).


#### 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 aren items that are visited. Thus, the running time is O(n2). This can also be verified from the MATLAB program. There are two nested for loops which means an O(n2) algorithm.


#### 6.1.2. Run Time of Other Variations of the New Method

Analyzing the other variations of the new method, the run time isO(n2).


## 6.1. Asymptotic Analysis

In order to determine the efficiency of the method, an asymptotic analysis was carried out using big-O. 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 isO(n!).


### 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 aren items that are visited. Thus, the running time is O(n2). This can also be verified from the MATLAB program. There are two nested for loops which means an O(n2) algorithm.


### 6.1.2. Run Time of Other Variations of the New Method

Analyzing the other variations of the new method, the run time isO(n2).


## 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 aren items that are visited. Thus, the running time is O(n2). This can also be verified from the MATLAB program. There are two nested for loops which means an O(n2) algorithm.


## 6.1.2. Run Time of Other Variations of the New Method

Analyzing the other variations of the new method, the run time isO(n2).


## 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.Algorithm 1
f unction answer = GMethod(A,part) %% Developed by Sobamowo M. Gbeminiyi************************************ %% GMethod stands for Gbeminiyi’s 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, 38–42] 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 ifn == 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 10 1 3 - 7 5 4 1 12 0 2 10 1 4 3 20 11 ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗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 10 1 3 - 7 5 4 1 12 0 2 10 1 4 3 20 11 ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗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 10 1 3 - 7 5 4 1 12 0 2 10 1 4 3 20 11 ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗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 timeO(n2) is far better than O(n!) 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 Tables1 and 2.Table 1
Comparison of time consumption among different methods.
Laplace expansion method Rezaifar method The new method (Gbemi’s method) Number of executions 1,000 1,000 1,000 Total time for executions 0.453 s 0.359 s 0.218 s Average time per execution 0.00453 s 0.00359 s 0.00218 sTable 2
Comparison of time consumption among different methods.
Laplace expansion method Rezaifar method The new method (Gbemi’s method) Number of executions 10,000 10, 000 10,000 Total time for executions 4.197 s 3.496 s 1.766 s Average time per execution 0.0004197 s 0.003496 s 0.0001766 sIt can been seen from Tables1 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 othern×n (n>6) matrices. This will be presented in the second part of the paper.



---

*Source: 9382739-2016-12-05.xml*