EUROPEAN JOURNAL OF PURE AND APPLIED MATHEMATICS Vol. 14, No. 2, 2021, 431-450 ISSN 1307-5543 – ejpam.com Published by New York Business Global Chio’s-like method for calculating the rectangular (non-square) determinants: Computer algorithm interpretation and comparison Armend Salihu1, Fahri Marevci2,∗ 1 South East European University, Ilindenska n.335, 1200 Tetovo, Macedonia 2 Faculty of Education, University of Prishtina, Prishtine 10000, Kosovo Abstract. In this paper, we present an approach for the calculation of rectangular determinants, where in addition to the mathematical formula, we also provide a computer algorithm for their calculation. Firstly, we present a method similar to Sarrus method for calculating the rectangular determinant of the order 2 × 3. Secondly, we present an approach for calculating the rectangular determinants of order m×n by adding a row with all elements equal to one (1) in any row, as well as an application of Chio’s rule for calculating the rectangular determinants. Thirdly, we find the time complexity and comparison of the computer execution time of calculation of the rectangular determinant based on the presented algorithms and comparing them with the algorithm based on the Laplace method. 2020 Mathematics Subject Classifications: 08A70, 15A15, 11C20, 65F40, 65Y04, 68Q87, 68W40, 97N80 Key Words and Phrases: Determinants, Rectangular Determinants, Chio’s-like Method, Com- puter Algorithm 1. Rectangular determinants definition Let A be m× n a rectangular matrix: Am×n =  a11 a12 · · · a1n a21 a22 · · · a2n ... ... . . . ... am1 am2 · · · amn  , (1) its determinant, where m ≤ n is the sum (See: [2, 6]): ∗Corresponding author. DOI: https://doi.org/10.29020/nybg.ejpam.v14i2.3920 Email addresses: ar.salihu@gmail.com (A. Salihu), fahrimarevci@hotmail.com (F. Marevci) http://www.ejpam.com 431 c© 2021 EJPAM All rights reserved. A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 432 det(Am×n) = |Am×n| = ∣∣∣∣∣∣∣∣∣ a11 a12 · · · a1n a21 a22 · · · a2n ... ... . . . ... am1 am2 · · · amn ∣∣∣∣∣∣∣∣∣ = ∑ 1 n, then det(Am×n) = det(Am×n)T . This determinant has many known standard characteristics, such as the validity of overall row expansion of Laplace method. It is a symmetric multi-linear function with respect to rows. It is shown that this determinant has the extension of Laplace along rows that is valid for each 1 ≤ i ≤ m [7]: det(Am×n) = n∑ j=1 (−1)i+jaijA i j , (3) where Ai j is the minor of the element aij . In the following, the computer algorithm used to calculate rectangular determinants using Laplace expansion is presented. The algorithm is based on the Rezaifer’s algorithm used to calculate square determinants using the Laplace method [8]. Algorithm 1.1: Recursive algorithm det Laplace for Laplace method to calculate rectangular determinants Step 1: Insert the rectangular determinant A Step 2: Determine the order of rectangular determinant m× n [m,n] = size(A); Step 3: Calculate rectangular determinants using Laplace Method Initialize d = 0; Create Loop for i from 1 to n d = d + (−1)∧(1 + i) ∗A(1, i) ∗ det Laplace(A(2 : m, [1 : i− 1 i + 1 : n])); end Step 4: Display the result of the determinant 2. Main results Proposition 2.1: For a rectangular determinant of order 2×3 the following Sarrus-like formula holds: A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 433 ∣∣∣∣a11 a12 a13 a21 a22 a23 ∣∣∣∣ = + + +∣∣∣∣a11a21 a12 a22 a13 a23 a11 a21 ∣∣∣∣ − − − = a11a22 + a12a23 + a13a21 − a12a21 − a13a22 − a11a23. (4) Proof: The proof follows immediately from the definition of rectangular determinant. � In the following is presented a computer algorithm to calculate rectangular determi- nants of order 2× 3 based on Proposition 2.1. Algorithm 2.1: Proposition 2.1 method to calculate rectangular determinants of order 2× 3 Step 1: Insert the rectangular determinant of order 2× 3 Step 2: Expand determinant horizontally add first column after the last column A = [A A(1 : n− 1, 1 : 1)]; Step 3: Exchange first row with the second row of expanded determinant B = flip(A); Step 4: Calculate expanded determinants using Proposition 2.1 Initialize: c = 0, d = 0; Create Loop for i from 0 to 2 Initialize: a = 1, b = 1; Create Loop for j from 0 to 1 a = a ∗A(j + 1, i + j + 1); b = b ∗B(j + 1, i + j + 1); end c = c + a; d = d + b; end Step 5: Calculate the final result of rectangular determinant e = c− d; Step 6: Display the result of the determinant The following example shows an application of Proposition 2.1 for calculation of the area of a given triangle. Example 2.1 Calculate the area of the triangle given in the following figure. A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 434 S = 1 2 · | ∣∣∣∣x1 x2 x3 y1 y2 y3 ∣∣∣∣ | = 1 2 · | ∣∣∣∣−1 4 2 1 2 4 ∣∣∣∣ | = 1 2 · | + + +∣∣∣∣−1 1 4 2 2 4 −1 1 ∣∣∣∣ − − − | = 1 2 · |(−1) · 2 + 4 · 4 + 2 · 1− 1 · 4− 2 · 2− 4 · (−1)| = 1 2 · | − 2 + 16 + 2− 4− 4 + 4| = 1 2 · |12| = 6 The following Theorem concerns the calculation of the rectangular determinants of order m × n, adding a row with all elements equal to one, the special case can be used to convert the rectangular determinant of order (n− 1)× n to the square determinant of order n× n. Theorem 2.1: For a rectangular determinant of order m × n the following formula holds: A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 435 ∣∣∣∣∣∣∣∣∣ a11 a12 · · · a1n a21 a22 · · · a2n ... ... . . . ... am1 am2 · · · amn ∣∣∣∣∣∣∣∣∣ m×n = (−1)(m+1)+i ∣∣∣∣∣∣∣∣∣∣∣∣∣∣ a11 a12 · · · a1n ... ... . . . ... 1 1 · · · 1 ai+1,1 ai+1,2 · · · ai+1,n ... ... . . . ... am1 am2 · · · amn ∣∣∣∣∣∣∣∣∣∣∣∣∣∣ (m+1)×n , (5) where 1 ≤ i ≤ m + 1, and m + n is odd. Proof: The proof follows immediately from formula 18 in [10] (or Ex. v, 32 in [2]), and property 5 in [6]. � In the following is presented a computer algorithm for calculating rectangular deter- minants of order m× n based on Theorem 2.1, adding one row of all elements equal to 1 in any row. Algorithm 2.2: Theorem 2.1 method to calculate rectangular determinants of order m× n Step 1: Insert the rectangular determinant A Step 2: Determine the order of rectangular determinant m× n [m,n] = size(A); Step 3: Create a row of order 1× n with all elements equal to 1 X(1 : n) = 1 Step 4: Insert where to add the 1× n row with all elements equal to 1 Insert k; Step 5: Create rectangular determinant of order (m+1)×n from given determinant and the row with all elements equal to 1 B = [A(1 : k − 1, 1 : n);X;A(k : m, 1 : n)]; Step 6: Calculate the final result of created determinant d = (−1)∧(m + 1 + k) ∗ det Laplace(B); //Rectangular or square determinant Step 7: Display the result of the determinant In the following it is given an example, in which the row containing all elements equal to 1 is placed in the third row. Example 2.2: Let be given a rectangular matrix of order 4× 5. Its determinant can be calculated based on Theorem 2.1: ∣∣∣∣∣∣∣∣ 3 5 −6 1 4 −2 4 9 2 −4 5 7 1 −3 6 6 −9 5 −4 1 ∣∣∣∣∣∣∣∣ = (−1)(4+1)+3 ∣∣∣∣∣∣∣∣∣∣ 3 5 −6 1 4 −2 4 9 2 −4 1 1 1 1 1 5 7 1 −3 6 6 −9 5 −4 1 ∣∣∣∣∣∣∣∣∣∣ = 3970 A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 436 Theorem 2.2 (Chio’s-like method for rectangular determinants): For a rect- angular determinant of order m × n, in cases for 2 × 3, 2 × 4 and 3 × 4, the following formula holds: ∣∣∣∣∣∣∣∣∣ a11 a12 · · · a1n a21 a22 · · · a2n ... ... . . . ... am1 am2 · · · amn ∣∣∣∣∣∣∣∣∣ m×n = ∣∣Ac ∣∣ am−211 + (−1)m ∣∣∣∣∣∣∣∣∣ a12 a13 · · · a1n a22 a23 · · · a2n ... ... . . . ... am2 am3 · · · amn ∣∣∣∣∣∣∣∣∣ m×(n−1) , (6) where: ∣∣Ac ∣∣ = ∣∣∣∣∣∣∣∣∣∣∣ ∣∣∣∣a11 a12 a21 a22 ∣∣∣∣ · · · ∣∣∣∣a11 a1n a21 a2n ∣∣∣∣ ... . . . ...∣∣∣∣a11 a12 am1 am2 ∣∣∣∣ · · · ∣∣∣∣a11 a1n am1 amn ∣∣∣∣ ∣∣∣∣∣∣∣∣∣∣∣ (m−1)×(n−1) (7) and a11 6= 0. Proof: In the following we will prove the Theorem 2.2 for the rectangular determinant of order 2× 3. First we multiply the elements of the second row by a11 6= 0: A = ∣∣∣∣a11 a12 a13 a21 a22 a23 ∣∣∣∣ 2×3 = 1 a11 · ∣∣∣∣ a11 a12 a13 a11a21 a11a22 a11a23 ∣∣∣∣ 2×3 = 1 a11 · ∣∣∣∣a11 a12 a13 0 a11a22 − a21a12 a11a23 − a21a13 ∣∣∣∣ 2×3 = 1 a11 · ∣∣∣∣∣∣ a11 a12 a13 0 ∣∣∣∣a11 a12 a21 a22 ∣∣∣∣ ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣ ∣∣∣∣∣∣ 2×3 = a11 a11 · Ac︷ ︸︸ ︷∣∣∣∣∣∣∣∣a11 a12 a21 a22 ∣∣∣∣ ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣∣∣∣∣ 1×2 − a12 a11 · ∣∣∣∣0 ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣∣∣∣∣ 1×2 + a13 a11 · ∣∣∣∣0 ∣∣∣∣a11 a12 a21 a22 ∣∣∣∣∣∣∣∣ 1×2 Ac + a12 a11 · ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣ 2×2 − a13 a11 · ∣∣∣∣a11 a12 a21 a22 ∣∣∣∣ 2×2 = Ac + a12 a11 · (a11a23 − a21a13)− a13 a11 · (a11a22 − a21a12) = Ac + a12a23 −Red a12a13a21 a11 − a13a22 + Red a12a13a21 a11 = Ac + ∣∣∣∣a12 a13 a22 a23 ∣∣∣∣ 2×2 A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 437 = 1 a011 ·Ac + (−1)2 ∣∣∣∣a12 a13 a22 a23 ∣∣∣∣ 2×2 . For order 2× 4, we have as follows:∣∣∣∣a11 a12 a13 a14 a21 a22 a23 a24 ∣∣∣∣ 2×4 = 1 a11 ∣∣∣∣ a11 a12 a13 a14 a11a21 a11a22 a11a23 a11a24 ∣∣∣∣ 2×4 = 1 a11 ∣∣∣∣a11 a12 a13 a14 0 a11a22 − a21a12 a11a23 − a21a13 a11a24 − a21a14 ∣∣∣∣ 2×4 = 1 a11 ∣∣∣∣∣∣ a11 a12 a13 a14 0 ∣∣∣∣a11 a12 a21 a22 ∣∣∣∣ ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣ ∣∣∣∣a11 a14 a21 a24 ∣∣∣∣ ∣∣∣∣∣∣ 2×4 = a11 a11 · Ac︷ ︸︸ ︷∣∣∣∣∣∣∣∣a11 a12 a21 a22 ∣∣∣∣ ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣ ∣∣∣∣a11 a14 a21 a24 ∣∣∣∣∣∣∣∣ 1×3 − a12 a11 · ∣∣∣∣0 ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣ ∣∣∣∣a11 a14 a21 a24 ∣∣∣∣∣∣∣∣ 1×3 + a13 a11 · ∣∣∣∣0 ∣∣∣∣a11 a12 a21 a22 ∣∣∣∣ ∣∣∣∣a11 a14 a21 a24 ∣∣∣∣∣∣∣∣ 1×3 − a14 a11 · ∣∣∣∣0 ∣∣∣∣a11 a12 a21 a22 ∣∣∣∣ ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣∣∣∣∣ 1×3 = Ac − a12 a11 ( 0− ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣+ ∣∣∣∣a11 a14 a21 a24 ∣∣∣∣)+ a13 a11 ( 0− ∣∣∣∣a11 a12 a21 a22 ∣∣∣∣+ ∣∣∣∣a11 a14 a21 a24 ∣∣∣∣) −a14 a11 ( 0− ∣∣∣∣a11 a12 a21 a22 ∣∣∣∣+ ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣) = Ac− a12 a11 (0−a11a23+a21a13+a11a24−a21a14)+ a13 a11 (0−a11a22+a21a12+a11a24−a21a14) −a14 a11 (0− a11a22 + a21a12 + a11a23 − a21a13) = Ac+a12a23−Red a12a13a21 a11 −a12a24+Green a12a14a21 a11 −a13a22+Red a12a13a21 a11 +a13a24−Blue a13a14a21 a11 +a14a22 −Green a12a14a21 a11 −a14a23+Blue a13a14a21 a11 = Ac+a12a23−a12a24−a13a22+a13a24+a14a22−a14a23 = Ac + (a12a23 − a13a22)− (a12a24 − a14a22) + (a13a24 − a14a23) A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 438 = Ac + ∣∣∣∣a12 a13 a22 a23 ∣∣∣∣− ∣∣∣∣a12 a14 a22 a24 ∣∣∣∣+ ∣∣∣∣a13 a14 a23 a24 ∣∣∣∣ = Ac + (−1)2 ∣∣∣∣a12 a13 a14 a22 a23 a24 ∣∣∣∣ 2×3 . For order 3× 4, we have as follows: A = ∣∣∣∣∣∣ a11 a12 a13 a14 a21 a22 a23 a24 a31 a32 a33 a34 ∣∣∣∣∣∣ 3×4 = 1 a211 ∣∣∣∣∣∣ a11 a12 a13 a14 a11a21 a11a22 a11a23 a11a24 a11a31 a11a32 a11a33 a11a34 ∣∣∣∣∣∣ 3×4 . Based on the properties of determinants, we can multiply one row with one element and add/subtract the other row: A = 1 a211 ∣∣∣∣∣∣ a11 a12 a13 a14 0 a11a22 − a12a21 a11a23 − a13a21 a11a24 − a14a21 0 a11a32 − a12a31 a11a33 − a13a31 a11a34 − a14a31 ∣∣∣∣∣∣ 3×4 = 1 a211 ∣∣∣∣∣∣∣∣∣∣∣∣∣∣ a11 a12 a13 a14 0 ∣∣∣∣a11 a12 a21 a22 ∣∣∣∣ ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣ ∣∣∣∣a11 a14 a21 a24 ∣∣∣∣ 0 ∣∣∣∣a11 a12 a31 a32 ∣∣∣∣ ∣∣∣∣a11 a13 a31 a33 ∣∣∣∣ ∣∣∣∣a11 a14 a31 a34 ∣∣∣∣ ∣∣∣∣∣∣∣∣∣∣∣∣∣∣ 3×4 . Based on Laplace’s method, we expand the last determinant according to the first row. = a11 a211 · Ac︷ ︸︸ ︷∣∣∣∣∣∣∣∣∣∣ ∣∣∣∣a11 a12 a21 a22 ∣∣∣∣ ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣ ∣∣∣∣a11 a14 a21 a24 ∣∣∣∣ ∣∣∣∣a11 a12 a31 a32 ∣∣∣∣ ∣∣∣∣a11 a13 a31 a33 ∣∣∣∣ ∣∣∣∣a11 a14 a31 a34 ∣∣∣∣ ∣∣∣∣∣∣∣∣∣∣ 2×3 − a12 a211 · ∣∣∣∣∣∣∣∣∣∣ 0 ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣ ∣∣∣∣a11 a14 a21 a24 ∣∣∣∣ 0 ∣∣∣∣a11 a13 a31 a33 ∣∣∣∣ ∣∣∣∣a11 a14 a31 a34 ∣∣∣∣ ∣∣∣∣∣∣∣∣∣∣ 2×3 + a13 a211 · ∣∣∣∣∣∣∣∣∣∣ 0 ∣∣∣∣a11 a12 a21 a22 ∣∣∣∣ ∣∣∣∣a11 a14 a21 a24 ∣∣∣∣ 0 ∣∣∣∣a11 a12 a31 a32 ∣∣∣∣ ∣∣∣∣a11 a14 a31 a34 ∣∣∣∣ ∣∣∣∣∣∣∣∣∣∣ 2×3 − a14 a211 · ∣∣∣∣∣∣∣∣∣∣ 0 ∣∣∣∣a11 a12 a21 a22 ∣∣∣∣ ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣ 0 ∣∣∣∣a11 a12 a31 a32 ∣∣∣∣ ∣∣∣∣a11 a13 a31 a33 ∣∣∣∣ ∣∣∣∣∣∣∣∣∣∣ 2×3 = 1 a11 Ac − a12 a211 · ∣∣∣∣∣∣∣∣∣∣ ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣ ∣∣∣∣a11 a14 a21 a24 ∣∣∣∣ ∣∣∣∣a11 a13 a31 a33 ∣∣∣∣ ∣∣∣∣a11 a14 a31 a34 ∣∣∣∣ ∣∣∣∣∣∣∣∣∣∣ 2×2 + a13 a211 · ∣∣∣∣∣∣∣∣∣∣ ∣∣∣∣a11 a12 a21 a22 ∣∣∣∣ ∣∣∣∣a11 a14 a21 a24 ∣∣∣∣ ∣∣∣∣a11 a12 a31 a32 ∣∣∣∣ ∣∣∣∣a11 a14 a31 a34 ∣∣∣∣ ∣∣∣∣∣∣∣∣∣∣ 2×2 A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 439 −a14 a211 · ∣∣∣∣∣∣∣∣∣∣ ∣∣∣∣a11 a12 a21 a22 ∣∣∣∣ ∣∣∣∣a11 a13 a21 a23 ∣∣∣∣ ∣∣∣∣a11 a12 a31 a32 ∣∣∣∣ ∣∣∣∣a11 a13 a31 a33 ∣∣∣∣ ∣∣∣∣∣∣∣∣∣∣ 2×2 = 1 a11 Ac−a12a23a34+ a12a14a23a31 a11 +Red a12a13a21a34 a11 −Green a12a13a14a21a31 a211 +a12a24a33−Blue a12a14a21a33 a11 −browna12a13a24a31 a11 +Green a12a13a14a21a31 a211 +a13a22a34−Orange a13a14a22a31 a11 −Red a12a13a21a34 a11 +Green a12a13a14a21a31 a211 −a13a24a32+Purple a13a14a21a32 a11 +brown a12a13a24a31 a11 −Green a12a13a14a21a31 a211 −a14a22a33+Orange a13a14a22a31 a11 +Blue a12a14a21a33 a11 −Green a12a13a14a21a31 a211 +a14a23a32−Purple a13a14a21a32 a11 −a12a14a23a31 a11 +Green a12a13a14a21a31 a211 = 1 a11 Ac − (a12a23a34 + a13a24a32 + a14a22a33 − a14a23a34 − a13a22a34 − a12a24a32) = 1 a11 Ac + (−1)3 ∣∣∣∣∣∣ a12 a13 a14 a22 a23 a24 a32 a33 a34 ∣∣∣∣∣∣ 3×3 . The proof is complete. � In the following is presented an algorithm based on Theorem 2.2. As we have compu- tationally tested, we have seen that the algorithm holds also for any determinant of order m× n . Algorithm 2.3: Recursive algorithm det Chio for Theorem 2.2 (Chio’s-like) method to calculate rectangular determinants of order m× n Step 1: Insert the rectangular determinant A Step 2: Determine the order of rectangular determinant m× n [m,n] = size(A); Step 3: Checking if A(1,1) is equal to 0 if A(1, 1) = 0 Exchange rows to find nonzero element Step 4: Calculating sub matrices A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 440 Initialize B = 0; Create Loop for i from 1 to m-1 Create Loop for j from 1 to n-1 B(i, j) = A(1, 1) ∗A(i + 1, j + 1)−A(1, j + 1) ∗A(i + 1, 1) end end Step 5: Calculate the final result of rectangular determinant d = 1/A(1, 1)∧(m− 2) ∗ det Chio(B) + (−1)∧m ∗ det Chio(A(1 : m, 2 : n)); Step 6: Display the result of the determinant Remark 2.1: We have computationally tested Algorithm 2.3 for orders 3× 4, 3× 5, , 499 × 501 and 500 × 501, and compared with the Algorithm 1.1 (Laplace). For m = n the Chio’s Theorem holds (See: [1, 3]). In the following, it is given an example of the calculation of a rectangular determinant based on Chio’s-like formula and the result are compared with those obtained by Laplace method. Example 2.3: Let us calculate the following determinant∣∣∣∣∣∣ 2 −5 1 4 3 1 3 −2 1 4 −4 2 1 3 1 ∣∣∣∣∣∣ 3×5 Solution: 1. Chio’s-like formula: ∣∣∣∣∣∣ 2 −5 1 4 3 1 3 −2 1 4 −4 2 1 3 1 ∣∣∣∣∣∣ 3×5 = 1 2 ∣∣∣∣∣∣∣∣∣∣ ∣∣∣∣2 −5 1 3 ∣∣∣∣ ∣∣∣∣2 1 1 −2 ∣∣∣∣ ∣∣∣∣2 4 1 1 ∣∣∣∣ ∣∣∣∣2 3 1 4 ∣∣∣∣ ∣∣∣∣ 2 −5 −4 2 ∣∣∣∣ ∣∣∣∣ 2 1 −4 1 ∣∣∣∣ ∣∣∣∣ 2 4 −4 3 ∣∣∣∣ ∣∣∣∣ 2 3 −4 1 ∣∣∣∣ ∣∣∣∣∣∣∣∣∣∣ 2×4 +(−1)3 ∣∣∣∣∣∣ −5 1 4 3 3 −2 1 4 2 1 3 1 ∣∣∣∣∣∣ 3×4 = 1 2 ∣∣∣∣ 11 −5 −2 5 −16 6 22 14 ∣∣∣∣ 2×4 − ∣∣∣∣∣∣ −5 1 4 3 3 −2 1 4 2 1 3 1 ∣∣∣∣∣∣ 3×4 = −126 2 − 104 = −167 2. Laplace method: ∣∣∣∣∣∣ 2 −5 1 4 3 1 3 −2 1 4 −4 2 1 3 1 ∣∣∣∣∣∣ = (−1)1+1 · 2 · ∣∣∣∣3 −2 1 4 2 1 3 1 ∣∣∣∣+ (−1)1+2 · (−5) · ∣∣∣∣ 1 −2 1 4 −4 1 3 1 ∣∣∣∣ A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 441 +(−1)1+3 · 1 · ∣∣∣∣ 1 3 1 4 −4 2 3 1 ∣∣∣∣+ (−1)1+4 · 4 · ∣∣∣∣ 1 3 −2 4 −4 2 1 1 ∣∣∣∣+ (−1)1+5 · 3 · ∣∣∣∣ 1 3 −2 1 −4 2 1 3 ∣∣∣∣ = 2 · (−17) + 5 · (−9) + 25− 4 · 44 + 3 · 21 = −34− 45 + 25− 176 + 63 = −167 Corollary 2.1: For a rectangular determinant of order mn, in cases for 2 × 3, 2 × 4 and 3× 4 the following formula holds: ∣∣∣∣∣∣∣∣∣∣∣∣ a11 a12 · · · a1n ... ... . . . ... ak1 ak2 · · · akn ... ... . . . ... am1 am2 · · · amn ∣∣∣∣∣∣∣∣∣∣∣∣ m×n = (−1)k−1 am−2k1 ∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣ ∣∣∣∣ak1 ak2 a11 a12 ∣∣∣∣ · · · ∣∣∣∣ak1 akn a11 a1n ∣∣∣∣ ... . . . ...∣∣∣∣ ak1 ak2 ak−1,1 ak−1,2 ∣∣∣∣ · · · ∣∣∣∣ ak1 akn ak−1,1 ak−1,n ∣∣∣∣ ∣∣∣∣ ak1 ak2 ak+1,1 ak+1,2 ∣∣∣∣ · · · ∣∣∣∣ ak1 akn ak+1,1 ak+1,n ∣∣∣∣ ... . . . ...∣∣∣∣ak1 ak2 am1 am2 ∣∣∣∣ · · · ∣∣∣∣ak1 akn am1 amn ∣∣∣∣ ∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣ (m−1)×(n−1) +(−1)m+k−1 ∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣ ak2 ak3 · · · akn a12 a13 · · · a1n ... ... . . . ... ak−1,2 ak−1,3 · · · ak−1,n ak+1,2 ak+1,3 · · · ak+1,n ... ... . . . ... am2 am3 · · · amn ∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣∣ m×(n−1) , (8) where, 1 ≤ k ≤ m, and ak1 6= 0. Proof: Proof of Corollary 2.1 is derived from Theorem 2.2 and property of interchang- ing two rows, property 5 by interchanging the rows of the matrix in [6]. Note 2.1: In special cases when a11 is equal to zero, then Corollary 2.1 is applied, in the case when all elements of the first column are equal to 0, then the first column is eliminated and the sign before the determinant changes when m - (number of rows) is odd. In the following is presented an algorithm based on Corollary 2.1. Algorithm 2.4: Recursive algorithm det Chio Cor for Corollary 2.1 (Chio’s-like) method to calculate rectangular determinants of order m× n A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 442 Step 1: Insert the rectangular determinant A Step 2: Determine the order of rectangular determinant m× n [m,n] = size(A); Step 3: Select the row k of pivot element Step 4: Checking if A(k,1) is equal to 0 if A(k, 1) = 0 Message: Select another k Repeat Step 4 Step 5: Create modified matrix if k <= 0 || k > m + 1 B=A else B=[A(k,:);A(1:k-1, 1:n);A(k+1:m, 1:n)] Step 6: Calculating sub matrices Initialize C=0; Create Loop for i from 1 to m− 1 Create Loop for j from 1 to n− 1 C(i, j) = B(1, 1) ∗B(i + 1, j + 1)−B(1, j + 1) ∗B(i + 1, 1) end end Step 7: Calculate the final result of rectangular determinant d = (−1)∧(k−1)∗(1/A(k, 1)∧(m−2)∗det Chio Cor(C)+(−1)∧m∗det Chio Cor(B(1 : m, 2 : n))) Step 8: Display the result of the determinant Example 2.4: Find the volume of the prism given in the following figure. A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 443 V = 1 2 · | ∣∣∣∣∣∣ x1 x2 x3 x4 y1 y2 y3 y4 z1 z2 z3 z4 ∣∣∣∣∣∣ | = 1 2 · | ∣∣∣∣∣∣ −1 4 2 −1 1 2 4 1 0 0 0 4 ∣∣∣∣∣∣ | = 1 2 ·|(−1)2−1 13−2 ∣∣∣∣∣∣∣∣∣∣ ∣∣∣∣ 1 2 −1 4 ∣∣∣∣ ∣∣∣∣ 1 4 −1 2 ∣∣∣∣ ∣∣∣∣ 1 1 −1 −1 ∣∣∣∣ ∣∣∣∣1 2 0 0 ∣∣∣∣ ∣∣∣∣1 4 0 0 ∣∣∣∣ ∣∣∣∣1 1 0 4 ∣∣∣∣ ∣∣∣∣∣∣∣∣∣∣ +(−1)3+2−1 ∣∣∣∣∣∣ 2 4 1 4 2 −1 0 0 4 ∣∣∣∣∣∣ | = 1 2 ·| ∣∣∣∣6 6 0 0 0 4 ∣∣∣∣−48| = 1 2 · |24− 24− 48| = 1 2 · | − 48| = 24 3. Time complexity and execution time comparison of rectangular determinants calculation For Algorithm 1.1, based on Laplace method, the time complexity is as follows [4, 9]: - Loop of row expansion is O(n); - Creation of minor matrix is O(n); - Recursion is O((n− 1)!). The asymptotic time complexity of the Algorithm 1.1 is O((n−1)! ·max(n, n) = O(n!). Time complexity of square determinant calculation of LU Decomposition Algorithm is as follows [9, 11]: - Swapping rows is O(n2); - First loop is O(n3), since: + Loop i (Rows) is O(n); + Loop j (Columns) is O(n); and + Loop k (Elements subtraction) is O(n); - Second loop (pivot multiplication) is O(n). The asymptotic time complexity of LU Decomposition Algorithm is O(max(n2, n3, n) = O(n3). Since the Algorithm 2.2 increases the number of rows for one, then time complexity of Algorithm 2.2 is same as Algorithm 1.1 using Laplace method. For special case of order (n−1)×n transforming to square determinant, and since time complexity of square determinants is O(n3) (LU decomposition), therefore for this case time complexity of Algorithm 2.2 is O(n3). Regarding the time complexity of Algorithms 2.3 and 2.4 is as follows: - Nested loop is O(m · n), since: + Loop i (Rows) is O(m); and + Loop j (Columns) is O(n); - Creation of block matrices of order 2× 2 is O(m · n); - Recursion is O(m− 1). A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 444 The asymptotic time complexity of the Algorithms 2.3 and 2.4 is O((m− 1) ·max(m · n, n)) = O(m2 · n). For additional algorithm complexity analysis see [5]. As can be seen from the time complexity of Algorithms 1.1, 2.2, 2.3 and 2.4, one can conclude that the algorithm based on Laplace-based method is slower than other algorithms. While, comparing the Algorithm 2.2 (for special case of order (n − 1) × n with Algorithms 2.3 and 2.4, one can concluded that the execution time should be approximately the same as closely as m is to n. Regarding the execution time of the rectangular determinant calculation, a computer with the following characteristics is used: Table1: Computer characteristics used to simulate the calculation of determinants. Name: Dell Model: Vostro 15-3578 CPU: Intel Core i7-8th gen 8550U 1.80 GHZ RAM: 8 GB DDR4 GPU: FULL HD Display 15.6” 1920x1080, AMD Radeon (TM) 520, 2048 MB GDDR5 HDD: 480 GB SSD While software used for this simulation are presented in Table 2. Table 2: Computer tools used for determinant calculation simulation: OS Windows 10 Pro 64-bit, Version 1803 (OS Build 17134.765 Software MATLAB, Version 9.0.0321247 (R2016a), 64-bit (win64) In this paper we have realized three comparisons of execution time of rectangular determinant calculation: (i) First comparison is between Theorem 2.1 (adding a row with all elements equal to 1), Theorem 2.2 (Chio’s like method) and Laplace method, for rectangular determinant of order (n− 1)× n, the results are presented in seconds in Table 3; (ii) Second comparison is between Theorem 2.2 (Chio’s like method) and Laplace method, for rectangular determinant of order m × n, m = 10, n from 11 to 25, the results are presented in seconds in Table 4; (iii) Third comparison is between Theorem 2.2 (Chio’s like method) and Laplace method, for rectangular determinant of order m× n, m from 5 to 19, n = 20, the results are presented in seconds in Table 5; For the first comparison it is generated a random matrix of order (n− 1)× n and tic toc is used to calculate the execution time, the MATLAB function is presented in the following: A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 445 Function 3.1: First comparison for order (n− 1)× n n = Order of determinant A = rand(n− 1, n); disp(’ ’) disp(’Rectangular determinant of order (n−1)×n calculation adding one row with all elements equal to 1’) tic d1 = det 1(A) toc disp(’ ’) disp(’Rectangular determinant of order (n − 1) × n calculation using Chios-like method’) tic d2 = det Chio(A) toc disp(’ ’) disp(’Rectangular determinant of order (n − 1) × n calculation using Laplace method’) tic d3 = det Laplace(A) toc Results are presented in seconds in Table 3. Table 3: Rectangular determinant calculation comparison between Theorem 2.1, The- orem 2.2 and Laplace method: A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 446 2*Det. Order Theorem 2.1 Theorem 2.2 Laplace Comparison 1 2 3 2-1 3-1 3-2 9× 10 0.0004 0.0010 0.0020 0.0006 0.0016 0.0010 10× 11 0.0007 0.0019 0.0021 0.0012 0.0014 0.0002 19× 20 0.0003 0.0006 0.0041 0.0003 0.0038 0.0035 20× 21 0.0010 0.0010 0.0059 0.0000 0.0049 0.0049 29× 30 0.0003 0.0009 0.0141 0.0006 0.0138 0.0132 30× 31 0.0006 0.0012 0.0151 0.0006 0.0145 0.0139 39× 40 0.0007 0.0024 0.0279 0.0017 0.0272 0.0255 40× 41 0.0006 0.0015 0.0317 0.0009 0.0311 0.0302 49× 50 0.0004 0.0018 0.0518 0.0014 0.0514 0.0500 50× 51 0.0006 0.0019 0.0593 0.0013 0.0587 0.0574 59× 60 0.0007 0.0041 0.0997 0.0034 0.0990 0.0956 60× 61 0.0007 0.0030 0.1074 0.0022 0.1067 0.1045 69× 70 0.0024 0.0066 0.3043 0.0043 0.3019 0.2977 70× 71 0.0008 0.0070 0.2967 0.0062 0.2959 0.2897 79× 80 0.0010 0.0092 0.4361 0.0082 0.4351 0.4269 80× 81 0.0009 0.0076 0.4657 0.0067 0.4648 0.4581 89× 90 0.0010 0.0086 0.6169 0.0077 0.6160 0.6083 90× 91 0.0011 0.0089 0.6351 0.0078 0.6340 0.6262 99× 100 0.0008 0.0125 0.8656 0.0116 0.8648 0.8531 100× 101 0.0009 0.0125 0.8861 0.0116 0.8852 0.8736 149× 150 0.0025 0.0253 3.2421 0.0228 3.2396 3.2168 150× 151 0.0010 0.0266 3.4131 0.0256 3.4121 3.3865 199× 200 0.0007 0.0566 10.0962 0.0559 10.0955 10.0395 200× 201 0.0026 0.0553 9.9452 0.0527 9.9426 9.8899 249× 250 0.0018 0.0962 32.5930 0.0945 32.5912 32.4967 250× 251 0.0030 0.0935 31.6585 0.0905 31.6556 31.5650 299× 300 0.0036 0.1686 65.4817 0.1651 65.4781 65.3131 300× 301 0.0035 0.1787 64.7036 0.1752 64.7001 64.5249 As can be seen in Table 3, there are some cases when the execution time of algorithms based on Theorem 2.1 and Theorem 2.2, shows that higher order of determinants are executed faster than lower order determinants. This is due to a very short period of execution time and the computer process priority and resource allocation (since execution was on windows environment). For the second comparison we generated a random matrix of order 10 × n, for 11 ≤ n ≤ 25 and tic toc is used to calculate execution time, the MATLAB function is presented in the following: Function 3.2: Second comparison for order 10× n, for 11 ≤ n ≤ 25 A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 447 m=10 n = Number of columns A = rand(m,n); disp(’ ’) disp(’Rectangular determinant of order 10 × n, for 11 ≤ n ≤ 25 calculation using Chios-like method’) tic d1 = det Chio(A) toc disp(’ ’) disp(’Rectangular determinant of order 10 × n, for 11 ≤ n ≤ 25 calculation using Laplace method’) tic d2 = det Laplace(A) toc Results are presented in seconds in Table 4. Table 4: Rectangular determinant calculation comparison between Theorem 2.2 and Laplace method, m=10, n from 11 to 25: 2*Det. Order Theorem 2.2 Laplace Comparison 1 2 2-1 10× 11 0.0010 0.0032 0.0021 10× 12 0.0009 0.0074 0.0064 10× 13 0.0051 0.0221 0.0170 10× 14 0.0082 0.0666 0.0584 10× 15 0.0206 0.1834 0.1627 10× 16 0.0494 0.4661 0.4166 10× 17 0.1225 1.1035 0.9810 10× 18 0.3933 3.6824 3.2891 10× 19 0.8419 7.7522 6.9102 10× 20 1.6791 15.5346 13.8555 10× 21 3.1759 29.8277 26.6518 10× 22 5.7377 60.5595 54.8218 10× 23 10.1708 98.7320 88.5612 10× 24 17.7038 196.3848 178.6810 10× 25 29.4464 291.9469 262.5005 For the third comparison is used to generate a random matrix of order m × 20, for 5 ≤ m ≤ 19 and tic toc is used to calculate the execution time, the MATLAB function is presented in the following: Function 3.3: Third comparison for order m× 20, for 5 ≤ m ≤ 19 A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 448 m=10 n = Number of columns A = rand(m,n); disp(’ ’) disp(’Rectangular determinant of order m × 20, for 5 ≤ m ≤ 19 calculation using Chios-like method’) tic d1 = det Chio(A) toc disp(’ ’) disp(’Rectangular determinant of order m × 20, for 5 ≤ m ≤ 19 calculation using Laplace method’) tic d2 = det Laplace(A) toc Results are presented in seconds in Table 5. Table 5: Rectangular determinant calculation comparison between Theorem 2.2 and Laplace method, m from 5 to 19, n=20: 2*Det. Order Theorem 2.2 Laplace Comparison 1 2 2-1 5× 20 0.1177 0.4406 0.3229 6× 20 0.2762 1.4091 1.1329 7× 20 0.5743 3.6031 3.0288 8× 20 0.9602 7.2210 6.2608 9× 20 1.4076 11.8139 10.4063 10× 20 1.6498 15.7704 14.1206 11× 20 1.6005 16.9290 15.3285 12× 20 1.4516 21.1123 19.6607 13× 20 0.8583 10.3589 9.5006 14× 20 0.4422 5.9305 5.4883 15× 20 0.1862 2.6365 2.4503 16× 20 0.6209 0.9372 0.3163 17× 20 0.0183 0.2529 0.2346 18× 20 0.0052 0.0557 0.0505 19× 20 0.0011 0.0048 0.0038 4. Conclusion In this paper, we have presented a method for calculating 2 × 3 order of rectangular determinants, which is similar to the Sarus’s method. We also presented the respective A. Salihu, F. Marevci / Eur. J. Pure Appl. Math, 14 (2) (2021), 431-450 449 computer algorithm. In addition, we have presented the possibility of adding a row with all elements equal to 1 in any row, based on the definition of Cullis/Radic, as well as the properties of de- terminants for interchanging two rows of rectangular determinant. As a special case we considered the case when the order of the determinant is (n− 1)× n which can be trans- formed into square determinants. We also have presented the corresponding algorithm (See: Theorem 2.1 and Algorithm 2.2). Regarding the Chio’s-like method for calculating rectangular determinant, it is pre- sented a Theorem 2.2, which is proven for orders 2×3, 2×4 and 3×4, while the computer algorithm is presented in Algorithm 2.3 and holds for determinants of order m × n, con- sidering cases when pivot element is equal to zero. Then we have obtained Corollary 2.1 where as a pivot element can be used any of the elements of first column. In cases when all elements of the first column are zero, if the number of rows is odd, the first column can be eliminated considering sign change. Based on the time complexity of the presented algorithms, the algorithm based on Laplace method has time complexity of O(n!), the algorithm based adding a row of all elements equal to 1 (transforming rectangular determinant of order (n − 1) × n, to the square determinant of order n× n) has time complexity same as square determinant that is O(n3). The time complexity of algorithm based on Chio’s-like method is O(m2 · n). Based on the comparison of time complexity of these algorithms one can conclude that the slowest algorithm is based on Laplace method, and other algorithms are approximately the same, depending on how close is m to n. In the third part of the paper, we have compared the computational speed of the rectangular determinants by different methods. The first comparison is made for the rectangular determinants of the order (n − 1) × n, between Theorem 2.1, by adding a row of all elements equal to 1 in any row (Algorithm 2.2), Theorem 2.2, based on Chio’s- like method (Algorithm 2.3) and the Laplace method (Algorithm 1.1). From the analysis of the obtained results, we have noticed that Algorithm 2.2 is more effective than the other two algorithms. This algorithm has a very small advantage over Algorithm 2.3 since the time complexity of both Algorithms 2.2 and 2.3 is approximately the same, and there is seen significant advantage over Algorithm 1.1, the most obvious advantage is observed in determinants of higher orders, since the time complexity of Laplace method is O(n!) and much higher than O(n3). From this comparison a significant advantage was observed between Algorithm 2.3 compared to Algorithm 1.1, which is obvious also based on time complexity. Similarly a significant difference was observed in the higher orders determinants. The second comparison is made for the orders of rectangular determinants ranging from 10× 11 to 10× 25, between Algorithm 2.3 and Algorithm 1.1. Also in this comparison, an obvious advantage was observed regarding the computational speed of the calculation of the rectangular determinant of Algorithm 2.3 compared to Algorithm 1.1, especially the significant difference was observed in the higher orders of columns. The last comparison in this paper is to compare the speed of calculation of rectangular determinants by Algorithm 2.3 and Algorithm 1.1, for orders from 5 × 20 up to 19 × 20. REFERENCES 450 In this regard, it has been observed an obvious advantage of the computational speed of rectangular determinants calculation with Algorithm 2.3 compared to Algorithm 1.1. Unlike the previous comparisons, here we have noticed that a higher difference is when the number of columns is approximate twice the number of rows. This occurs because the highest possible value of combinations n choose k is attained when k is half of the n. Acknowledgements The authors would like to thank the referees for the comprehensive reading, reviewing and their valuable comments and suggestions, to improve our paper. References [1] F Chio. Memoire sur les fonctions connues sous le nom de resultantes ou de determi- nants. Turin: E. Pons, 1853. [2] C E Cullis. Matrices and determinoids. Cambridge: University Press, Cambridge, 1913. [3] L E Fuller and J D Logan. On the evaluation of determinants by chio’s method. The Two-Year College Mathematics Journal, 6:8–10, 1975. [4] W M Gentleman and S C Johnson. The evaluation of determinants by expansion by minors and the general problem of substitution. Mathematics of Computation, 28:543–548, 1974. [5] R E Neaplitan. Foundations of Algorithms. Jones and Bartlett Learning, Cambridge, 2015. [6] M Radic. Definition of determinant of rectangular matrix. Glasnik Matematicki, pages 17–22, 1966. [7] M Radic and R Susanj. On determinants of rectangular matrices which have laplaces expansion along rows. Glasnik Matematicki, 46:175–180, 2012. [8] O Rezaifar and H Rezaee. A new approach for finding the determinant of matrices. Applied Mathematics and Computation, 188:1445–1454, 2008. [9] S S Skiena. The Algorithm Design Manual. Springer-Verlag London Limited, London, 2008. [10] R Susanj and M Radic. Geometrical meaning of one generalization of the determinant of square matrix. Glasnik Matematicki, 29:217–233, 1994. [11] X Wang and X Yaoqi. How difficult to compute coefficients of characteristic polyno- mial? International Journal of Research Studies in Computer Science and Engineer- ing (IJRSCSE), 3:7–12, 2016.