A new recursive algorithm for inverting general k -tridiagonal matrices

A new recursive algorithm for inverting general k -tridiagonal matrices

Accepted Manuscript A new recursive algorithm for inverting general k-tridiagonal matrices Moawwad El-Mikkawy, Faiz Atlan PII: DOI: Reference: S0893-...

202KB Sizes 0 Downloads 106 Views

Accepted Manuscript A new recursive algorithm for inverting general k-tridiagonal matrices Moawwad El-Mikkawy, Faiz Atlan PII: DOI: Reference:

S0893-9659(15)00004-X http://dx.doi.org/10.1016/j.aml.2014.12.018 AML 4695

To appear in:

Applied Mathematics Letters

Received date: 16 November 2014 Revised date: 31 December 2014 Accepted date: 31 December 2014 Please cite this article as: M. El-Mikkawy, F. Atlan, A new recursive algorithm for inverting general k-tridiagonal matrices, Appl. Math. Lett. (2015), http://dx.doi.org/10.1016/j.aml.2014.12.018 This is a PDF file of an unedited manuscript that has been accepted for publication. As a service to our customers we are providing this early version of the manuscript. The manuscript will undergo copyediting, typesetting, and review of the resulting proof before it is published in its final form. Please note that during the production process errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain.

A New Recursive Algorithm for Inverting General k-Tridiagonal Matrices Moawwad El-Mikkawy∗ , Faiz Atlan

Mathematics Department, Faculty of Science, Mansoura University, Mansoura 35516, Egypt E-mails: m− [email protected], [email protected] Abstract In the present article we give a new breakdown-free recursive algorithm for inverting general k-tridiagonal matrices without imposing any simplifying assumptions. The implementation of the algorithm in Computer Algebra Systems (CAS) such as Maple, Mathematica and Macsyma is straightforward. Two illustrative examples are given. Key words: k-Tridiagonal matrices; LU factorization; Matrix inversion; Computer Algebra Systems; Recursion.

1. Introduction The general tridiagonal matrix T = (tij )ni,j=1 in which tij = 0 for |i − j| > 1 can be written in the form:



    T =    

d 1 a1

0

b1

a2 ...

0 .. .

d2 ... ...

0

...

... ... ...

0 .. . 0

bn−2 dn−1 an−1 0

bn−1

dn



    .    

(1)

Tridiagonal matrices frequently appear in a variety of applications such as parallel computing, cubic spline interpolation, telecommunication system analysis, and in numerous other fields of science and engineering. In many of these areas inversion of tridiagonal matrices is required. The interested reader may refer to [1, 3, 4, 5, 6, 10, 11, 13, 14, 15, 16, 22] and the references therein. (k)

A more general tridiagonal matrix is the k-tridiagonal matrix Tn

1

= (tˆij )ni,j=1 which can be

written in the form:



Tn(k)

(k)

For the matrix Tn

        =        

d1

0

0 .. .

d2

0 b1

...

0 .. . 0 . . . . .. 0

0 .. .

... . b2 . . .. .. . .

0

...

0

0

a1

... .. . .. . .. .

0

0

a2 . . . . .. .. . ... .. .. . . .. .. . .

... .. .

...

bn−k

0

... .. . .. . .. . ...

0 .. . 0 an−k

0

0 .. .

0

dn−1

0

...

0

dn



        .        

(2)

in (2), tˆij = 0 for all i, j = 1, 2, ..., n except for |i − j| = 0 or k, where (k)

k ∈ {1, 2, ..., n − 1}. For k ≥ n, the matrix Tn is a diagonal matrix and the case k = 1 gives the

ordinary tridiagonal matrix in (1). In [7], it has been found that the k-tridiagonal matrix plays important role in describing generalized k-Fibonacci numbers. Moreover, the authors in [17, 18] computed integer powers of some special types of these matrices by exploiting some properties of Chebyshev polynomials. In [9, 12, 19, 20] the authors investigated k-tridiagonal matrices in some (k)

details. There is no need to store the zero elements of Tn . The nonzero elements of the matrix in (2) can be stored in 3n − 2k memory locations by using three vectors a = [a1 , a2 , . . . , an−k ],

b = [b1 , b2 , . . . , bn−k ] and d = [d1 , d2 , . . . , dn ]. This is always a good habit in computation in order to save memory space. Throughout this paper, bxc denotes the greatest integer less than or equal to x. Also, the word ’simplify’ means simplify the expression under consideration to its simplest rational form.

The organization of the paper is as follows. In Section 2, a new breakdown-free symbolic computational algorithm is presented. Two illustrative examples are given in Section 3.

2. Main Results In this section we are going to consider the construction of a new computational algorithm for inverting any nonsingular k-tridiagonal matrix. For this purpose it is helpful to introduce an n-component vector c = [c1 , c2 , ..., cn ] whose components are given by [8]: ( di , for i = 1, 2, ..., k ci = bi−k ai−k di − ci−k , for i = k + 1, k + 2, ..., n. With the help of the vector c in (3), we may formulate the following result:

2

(3)

(k)

Lemma 2.1 [2, 21]. Let Tn be a k-tridiagonal matrix in (2) for which ci 6= 0, for i = 1, 2, ..., n. (k)

Then the Doolittle LU factorization of Tn

is given by:

(k) Tn(k) = L(k) n Un ,

(4)

where 

L(k) n

        =        

1

0 .. .

... .. . 1 .. . 0 .. . . . . . .. . .. .. b2 . c2 .. .. . .

0

...

0 .. . 0 b1 c1

0

0

..

.

..

.

..

.

... .. . bn−k cn−k

  ... 0 c 1 0 . . . 0 a1 0 . . . 0  ..  ..  0 c 2 0 . . . 0 a2 . . . .  .     ..   . 0 ... ... . . . ... ... 0     .. ... ... ... ...   . ... an−k  , Un(k) =    .. .. ... ... ... . .   ... 0   . .. .. .. .. .   ... ... . .  . . 0 .   .  .. ...  . . 0  ... 0 cn−1 0   . 0 ... 0 1 0 ... ... 0 cn (5)

and det(Tn(k) ) =

n Y

ci .

(6)

i=1

(k)

(k)

Before we consider the inverse (Tn )−1 of the matrix Tn we may use the efficient computational (k)

algorithm k-DETGTRI [8] to check the non-singularity of the matrix Tn Assuming that

(k) Tn

in linear time.

is nonsingular, let (Tn(k) )−1 = (qij )ni,j=1 = (C1 , C2 , ..., Cn ),

(7)

(k)

where Cr denotes the rth column of (Tn )−1 , r = 1, 2, ..., n. For r = 1, 2, ..., n it is true that: Cr = (C1 , C2 , ..., Cn ) Er ,

(8)

where Er = (δ1r , δ2r , ..., δnr )T and δij is the Kronecker symbol which is equal to 1 if i = j and 0 if i 6= j.

Equation (8) can be rewritten in the form: Tn(k) Cr = Er , r = 1, 2, ..., n.

(9) (k)

In order to construct a new computational algorithm for inverting Tn , two cases will be considered: Case (1): n > 2 k. 3



        ,        

In this case we need first to compute the last k columns, Cr = (qtr ) for r = n, n − 1, ..., n − k + 1, t = r, r − k, r − 2k, ..., 1. By using (9), together with Lemma 2.1, we get: b r−t c k

(−1) qtr = cr (k)

b r−t c k

Y at+(j−1)k . ct+(j−1)k j=1

(10)

(k)

Since (Tn )−1 Tn = In , where In is the n×n identity matrix, then the elements in the remaining (k)

(n − k) columns of (Tn )−1 may be obtained recursively using: (  1 Ei+k − di+k Ci+k , for i= n-k, n-k-1,...,n-2 k+1 ai Ci =  1 Ei+k − di+k Ci+k − bi+k Ci+2k , for i= n-2 k, n-2 k-1,...,1. ai

(11)

Case (2): n ≤ 2 k.

For this case the last (n−k) columns, Cr = (qtr ) for r = n, n−1, ..., k+1, t = r, r−k, r−2k, ..., 1 may be computed, as in Case (1), by using (10). The entries in the remaining k columns of (k)

(Tn )−1 may be obtained recursively using: ( 1 Ei , for i= k, k-1,...,n-k+1 di Ci =  1 Ei+k − di+k Ci+k , for i= n-k, n-k-1,...,1. ai

(12) (k)

Notice that in (12), di 6= 0 for i ∈ {n − k + 1, n − k + 2, ..., k}, otherwise the matrix Tn will be singular. We are now in a position to formulate the following algorithm. The auxiliary parameter ’t’ in the algorithm is just a symbolic name. It is a dummy argument and its actual value is zero. Algorithm 2.1. Symbolic algorithm for inverting a general nonsingular k-tridiagonal matrix. (k)

To compute the inverse of a general k-tridiagonal matrix Tn in (2), we may proceed as follows: INPUT: The order of the matrix n, the value of k and the components ai , bi and di , i = 1, 2, ..., n. Note that an−k+1 = an−k+2 = ... = an = bn−k+1 = bn−k+2 = ... = bn = 0. (k) OUTPUT: The inverse (Tn )−1 = (qij )ni,j=1 = (C1 , C2 , ..., Cn ). Step 1: If ai = 0 for i = 1, 2, ..., n − k Then set ai = t End if. If bi = 0 for i = 1, 2, ..., n − k Then set bi = t End if . If di = 0 for i = 1, 2, ..., n Then set di = t End if.

(k)

Step 2: Use the k-DETGTRI algorithm [8] to check the non-singularity of the matrix Tn . (k)

If the matrix Tn

(k)

is singular then Exiterror (’The matrix Tn

is singular’) End if.

Step 3: Compute and simplify the components qij of the columns Cj , j = 1, 2, ...n using (10)-(12). Step 4: Substitute the actual value t = 0 in all expressions of the elements qij to get the inverse (k)

matrix (Tn )−1 .

4

Putting k=1 in Algorithm 2.1 gives the Algorithm presented in [6] as a special case. (k)

(k)

In [23], the authors investigated the inverse (Tn )−1 of a special symmetric k-tridiagonal matrix, Tn (k)

k , then following [23] we see that for i = 1, 2, ..., k we have: for which n = 4k. Let (T4 k )−1 = (αij )4i,j=1

αi,i+k = α3k+i,2k+i = F−1 , αi+k,i+2k = F0 , (13)

α3k+i,i = F−2 , and αij = 0,

otherwise,

where the Fibonacci numbers, Fn in (13) are given by: √ √   1 1+ 5 n 1− 5 n Fn = √ ( ) −( ) , n = 0, ±1, ±2, ... 2 2 5

(14)

Important Note: Having finished the work of the present paper, the authors became aware of a very recent paper [20] in which the authors constructed an algorithm (Algorithm 1, p. 99) for evaluating k-tridiagonal determinants. For n ≥ 2k, Algorithm 1 works properly. However, for n < 2k, a possible

failure may occur. To see this try by yourself to compute det(A) using Algorithm 1 for the following matrix:

For this matrix, det(A) = −60.



     A=     

1

0

0 0 −1 0

 2    0 0 0  .  3 0 0   0 −1 0   0 0 3

0 −2 0 0 0

0

5

0

0

0

3

0

0

0 −2 0

0

3. Illustrative Examples In this section we are going to give two illustrative examples.

5



Example 3.1. Consider the k-tridiagonal  2 0   0 1    0 0    0 0   0 0  (k) Tn =   0 0    2 0   0 −1    0 0  0 0

matrix 0

0 0

0

1

0

0

0 0

0

−1 0 0

0

0 −1 0

0

0

3 0

0

0

0

0

0 1

0

0

0

0

0

0

0 0 −2 0

0 0

0

5

0

0

0 0

0

0

3

3

0 0

0

0

0

0

2 0

0

0

0

0

0



 0    2 0    0 4   0 0    0 0    0 0   0 0    −1 0   0 3 0

Solution. Here n = 10, k = 6. From Step 2 of Algorithm 2.1, we obtain: c = [2, 1, −1, 3, 1, −2, 4, 2, 5, 13 ]. 10 Q (k) (k) Therefore det(Tn ) = cr = 160. Hence Tn is nonsingular. By using Steps 3-4 of Algorithm 2.1, we

get:

r=1



(Tn(k) )−1

           =          

5 8

0

0

0

0

0

− 18

0

0

0

3 2

0

0

0

0

0

1 2

0

0

0

1 5

0

0

0

0

0

2 5

0

0

0

3

0

0

0

0

0

0

0

0

0

1

0

0

0

0

0

0

0

0

0

0

0

0

0

0

− 21

0

0

− 14

0

1 4

0

0

0

1 2

0

0

0

0

0

1 2

0

0

0

3 5

0

0

0

0

0

1 5

0

0

0 −2 0

0

0

0

0

Example 3.2 [23]. Consider the symmetric  0   0    1   0  (k) Tn =   0    0   0  0

k-tridiagonal matrix 0 1 0 0 0 0 0

0



 0    0    −4   0   . 0    0   0    0   3



 0 0 1 0 0 0 0    0 0 0 1 0 0 0   1 0 0 0 1 0 0    0 1 0 0 0 1 0    0 0 1 0 0 0 1   0 0 0 1 0 0 0   0 0 0 0 1 0 0

Solution. Here n = 4k = 8, k = 2. Step 2 of Algorithm 2.1 gives:   (t2 − 1) (t2 − 1) t(t2 − 2) t(t2 − 2) (t4 − 3t2 + 1) (t4 − 3t2 + 1) c = t, t, , , 2 , , , . t t (t − 1) (t2 − 1) t(t2 − 2) t(t2 − 2)

6

Hence

(k) det(Tn )

=(

8 Q

r=1

Algorithm 2.1 yields:

(Tn(k) )−1 =  t(t2 −2) 4  t −3 t2 +1   0   t2 −1  − t4 −3 t2 +1    0 =   t4 −3tt2 +1    0    − t4 −31t2 +1  0 

        =       

0

0

0

0

1

cr )

=

t=0

0 t(t2 −2) t4 −3 t2 +1

0

t(t2 −1) t4 −3 t2 +1

0 2

t −1 − t4 −3 x2 +1

0

t t4 −3 t2 +1



3t2

t2 −1 − t4 −3 t2 +1

0

t2

− t4 −3 t2 +1 0

0

t t4 −3 t2 +1

0

− t4 −31t2 +1 1 0 0 0 −1 0 1 0 0

0

0

0 0 0 0

0

0

1

0 0 0 0

0

0

0

0 0 0 0

1

0

0

0 0 0 0

0

−1

0

0 0 1 0

0

−1 0 0 0 1

0

0

(t4

0

+



1)2

(k)

= 1. Thus Tn

is nonsingular. Using Steps 3-4 of

t=0

0 t2 −1 − t4 −3 t2 +1

0

t(t2 −1) t4 −3 t2 +1

0

2

− t4 −3t t2 +1 0

t t4 −3 t2 +1

t t4 −3 t2 +1

0

2

− t4 −3t t2 +1 0

t(t2 −1) 4 t −3 t2 +1

0



t2 −1 t4 −3 t2 +1

0

0

−1 t4 −3 t2 +1

0

t t4 −3 t2 +1

0

t t4 −3 t2 +1

2

− t4 −3t t2 +1 0

t(t2 −1) t4 −3 t2 +1

0 2

t −1 − t4 −3 t2 +1

0 2

t −1 − t4 −3 t2 +1

0

t( ) t4 −3 t2 +1 t2 −2

0

0

  − t4 −31t2 +1     0   t  t4 −3 t2 +1    0   t2 −1  − t4 −3 t2 +1    0  t(t2 −2) t4 −3 t2 +1



 −1    0   0   . 0    1   0   0

Applying (13)-(14), we obtained the same result.

4. Conclusion In this paper, we proposed, for the first time, a new recursive algorithm for inverting nonsingular ktridiagonal matrices. The algorithm is constructed without imposing any restrictive conditions . The Algorithm 2.3 presented in [6] is a special case of the new algorithm when k=1. Finally, some illustrative examples are given for the sake of illustration.

Acknowledgment The authors are extremely thankful to the editorial team of AML and anonymous referees for their useful comments and suggestions that have helped in improving the readability of this paper.

7



t=0

References [1] A. D. Aiat Hadj, M. Elouafi, A fast numerical algorithm for the inverse of a tridiagonal and pentadiagonal matrix, Appl. Math. Comput., 202 (2008) 441-445. [2] R.L. Burden, J.D. Faires, Numerical Analysis, 7th Edition, Books & Cole Publishing, Pacific Grove, CA, 2001. [3] M.E.A. El-Mikkawy, On the inverse of a general tridiagonal matrix, Appl. Math. Comput., 150 (2004) 669-679 . [4] M.E.A. El-Mikkawy, A fast algorithm for evaluating nth order tridiagonal determinants, J. Comput. Appl. Math., 166 (2004) 581-584. [5] M.E.A. El-Mikkawy, A. Karawia, Inversion of general tridiagonal matrices, Appl. Math. Lett., 19 (2006) 712-720. [6] M. El-Mikkawy, E.Rahmo , A new recursive algorithm for inverting tridiagonal and anti-tridiagonal matrices, Appl. Math. Comput., 204 (2008) 368-372. [7] M.E.A. El-Mikkawy, T. Sogabe, A new family of k-Fibonacci numbers, Appl. Math. Comput., 215 (2010) 4456-4461. [8] M.E.A. El-Mikkawy, A generalized symbolic Thomas algorithm, Applied Mathematics, 3 (4) (2012) 342-345. [9] M. El-Mikkawy, F. Atlan, A novel algorithm for inverting a general k-tridiagonal matrix, Appl. Math. Lett. 32 (2014) 41-47. [10] M. El-Mikkawy, F. Atlan, Algorithms for solving linear systems of equations of tridiagonal type via transformations, Applied Mathematics, 5 (2014) 413-422. [11] Y. Huang, W.F. McColl, Analytic inversion of general tridiagonal matrices, J. Phys. A, 30 (1997) 7919-7933. [12] J. Jia, T. Sogabe, M. El-Mikkawy, Inversion of k-tridiagonal matrices with Toeplitz structure, Comput. Math. Appl., 65 (2013) 116-125. [13] E. Kilic, Explicit formula for the inverse of a tridiagonal matrix by backward continued fractions, Appl. Math. Comput., 197 (2008) 345-357. [14] J.W. Lewis, Inversion of the tridiagonal matrices, Numer. Math., 38 (1982) 333- 345. [15] R.K. Mallik, The inverse of a tridiagonal matrix, Linear Algebr. Appl., 325 (2001) 109-139. [16] R.-S. Ran, T.-Z. Huang, X.-P. Liu , T.-X. Gu , An inversion algorithm for general tridiagonal matrix, Appl. Math. Mech.-Engl. Ed., 30 (2009) 247-253.

8

[17] J. Rimas, On computing of arbitrary positive integer powers for one type of symmetric tridiagonal matrices of even order II, Appl. Math. Comput., 172 (2006) 245-251. [18] J. Rimas, On computing of arbitrary positive integer powers for one type of symmetric pentadiagonal matrices of odd order, Appl. Math. Comput., 204 (2008) 120-129. [19] T. Sogabe, M.E.A. El-Mikkawy, Fast block diagonalization of k-tridiagonal matricess, Appl. Math. Comput., 218 (2011) 2740-2743. [20] T. Sogabe, F. Yilmaz, A note on a fast breakdown-free algorithm for computing the determinants and the permanents of k-tridiagonal matrices, Appl. Math. Comput., 249 (2014) 98-102. [21] A. Yalciner, The LU factorization and determinants of the k-tridiagonal matrices, Asian-European J. Math. 4 (2011) 187-197. [22] T. Yamamoto, Inversion formulas for tridiagonal matrices with applications to boundary value problems, Numer. Funct. Anal. and Optimiz., 22 (2001) 357- 385. [23] F. Yilmaz, T. Sogabe, A note on symmetric k-tridiagonal matrix family and the Fibonacci, Int. J. Pure and Appl. Math., 96 (2) (2014) 289-298.

9