You are on page 1of 4

Applied Mathematics, 2012, 3, 342-345

http://dx.doi.org/10.4236/am.2012.34052 Published Online April 2012 (http://www.SciRP.org/journal/am)

A Generalized Symbolic Thomas Algorithm


Moawwad El-Mikkawy
Mathematics Department, Faculty of Science, Mansoura University, Mansoura, Egypt
Email: m_elmikkawy@yahoo.com

Received February 4, 2012; revised March 1, 2012; accepted March 8, 2012

ABSTRACT
The current paper is mainly devoted to construct a generalized symbolic Thomas algorithm that will never fail. Two
new efficient and reliable computational algorithms are given. The algorithms are suited for implementation using
computer algebra systems (CAS) such as Mathematica, Macsyma and Maple. Some illustrative examples are given.

Keywords: Tridiagonal Matrices; LU Factorization; Linear Systems; DETGTRI Algorithm; Thomas Algorithm

1. Introduction tridiagonal matrices of the form (1.1) and this can be


done using the efficient symbolic algorithm DETGTRI in
The n  n general tridiagonal matrix T takes the form:
[6]. The motivation of the present paper is to continue the
 d1 a1 0  0  study of the LU factorization [7] of the matrix Tn( k ) in
b d a   
 2 2 2  (1.2) using a new approach, different from the recent
T   0 b3 d3  0  (1.1) approach given in [8], in order to obtain a generalized
  symbolic Thomas algorithm that will never fail.
     an 1  The organization of the paper is as follows. In Section
 0  0 bn d n 
2, generalization of the DETGTRI algorithm in [6] is in-
This type of matrices frequently appear in many scien- vestigated. The generalization of the Thomas algorithm
tific and engineering applications. This area of research [7] is considered in Section 3. Some illustrative examples
is still very active and has been considered by many au- are given in Section 4 for the sake of illustration. A con-
thors. The interested reader may refer to, for instance to clusion is given in Section 5.
[1-3] and the references therein. The n  n general tri-
diagonal matrix T in (1.1) can be stored using only three 2. Generalization of the DETGTRI Algorithm
n-dimensional vectors since there is no need to store the We begin this section by giving the following result
zero elements. In this paper we shall focus on k-tridi- whose proof will be omitted.
agonal matrices [4] of order n  n of the form: Theorem 2.1. For k  1, 2, n  1 , the Doolittle LU
 d1 0  0 a1 0  0  factorization [7] of the k-tridiagonal matrix Tn( k ) in (1.2)
 0 d2 0  0 a2    is given by:

 0  0    0  Tn( k )  L(nk )U n( k ) , (2.1)
  where
0   d n k    an k 
Tn( k )   (1.2)  1 
bk 1 0      0   0 
   1 
 0 bk  2   0  0 
 
  0 
  0  0 d n1 0   
   0   1 
 0  0 bn 0  0 d n 
 bk 1 
where 1  k  n . For k  n , the matrix in (1.2) is a di-  0    
Ln   c1
(k )
 (2.2)
agonal matrix and the case k = 1 gives the ordinary tridi-
 bk  2 
agonal matrix in (1.1). As pointed out in [4,5], the matrix  0   0  
Tn( k ) plays an important role in describing generalized  c2 
k-Fibonacci numbers. Furthermore, the matrix Tn( k ) has     0  0 1 
very recently received attention by some authors. In [5],  
 

using direct sum of matrices, it is proved that det Tn( k )  0  0
bn
0  0 1
may be obtained as the product of exactly k ordinary  cn-k 

Copyright © 2012 SciRes. AM


M. EL-MIKKAWY 343

and Algorithm 3.1. (Generalization of the Thomas nu-


c1 0  0 a1 0  0  meric algorithm [7])
 c2 0  0 a2    To solve the linear system of the form (3.1), we may
  proceed as follows:
  0    0 
  Step 1: Compute c1 , c2 , , cn using (2.4).
cn k    an k 
U n( k )  (2.3) Step 2: Compute z1 , z2 , , zn using
    0 
 
  0   yi i  1, 2, , k
 
cn 1 0  zi   bi zi -k
   yi  c i  k  1, k  2, , n
 cn   i -k

with Step 3: The solution of the system (3.1) is


di i  1, 2, , k
  zi
ci   bi ai -k (2.4) c i  n, n  1, , n  k  1
di  c i  k  1, k  2, , n  i
xi  
 i -k
 zi - ai xi  k i  n  k , n  k  1, ,1
Now we can formulate our first result.  ci
Algorithm 2.1. (Generalization of the DETGTRI al-
gorithm [6]) The Algorithm 3.1 will be referred to as k-Thomas al-
To compute the determinant of the k-tridiagonal matrix gorithm. The Thomas algorithm is a special case of the
Tn( k ) in (1.2) we may proceed as follows: k-Thomas algorithm when k = 1.
Step 1: Compute c1 , c2 , , cn to its simplest rational Note 3.1. Since the k-Thomas algorithm is based on
forms according to (2.4), setting cr   (  is just a the LU factorization of the matrix, Tn( k ) , then the k-
symbolic name) whenever cr  0, r  1, 2, , n .
n
Thomas numeric algorithm may fail if cr  0 ,
Step 2: Compute the polynomial p      cr to its r  1, 2, , n - k  as can be seen from (2.1)-(2.4). To
r 1

 
simplest rational form. Meanwhile, det Tn( k )  p  0  . remove all cases in which the k-Thomas numeric algo-
rithm fails, it is convenient to give the following sym-
The Algorithm 2.1 will be referred to as k-DETGTRI
algorithm. The DETGTRI algorithm in [6] is a special bolic version of the k-Thomas numeric algorithm de-
case of the k-DETGTRI algorithm when k = 1. Note that scribed above. The k-Thomas symbolic algorithm can be

the k-DETGTRI algorithm computes det Tn( k ) in linear stated as follows:
Algorithm 3.2. (Generalized symbolic Thomas al-
time.
gorithm)
3. Generalization of the Thomas Numeric To solve the linear system of the form (3.1), we may
proceed as follows:
Algorithm
Step 1: Compute c1 , c2 , , cn to its simplest rational
In this section, we are going to generalize the well- forms using (2.4), setting cr   (  is just a symbolic
known Thomas numeric algorithm [7]. The purpose of
the generalized algorithm is to solve the following linear name) whenever cr  0, r  1, 2, , n .
system for any k  1, 2, , n  1 . Step 2: Compute z1 , z2 , , zn to its simplest rational
The new algorithm can be stated as follows: forms using:

 d1 0  0 a1 0  0   x1   y1 
 0 d2 0  0 a2     x2   y2 

 0  0    0   x3   y3 
    
 0   d nk    ank       
 . (3.1)
bk 1 0      0      
    
 0 bk  2   0  0    xn2   yn 2 
    0  0 d n1 0   xn1   yn1 
    
 0  0 bn 0  0 d n   xn   yn 

Copyright © 2012 SciRes. AM


344 M. EL-MIKKAWY

 yi i  1, 2, , k modified positions are written in bold):



zi   bi zi -k 2 0 0 0 1 0 0 0 0 0   x1   4 
 yi  c i  k  1, k  2, , n
 i -k
0 1 0
 0 0 1 0 0 0 0   x2   2 
Step 3: The solution of the system (3.1) is  0 0 1 0 0 0 2 0 0 0   x3   0 
    
0 0 0 3 0 0 0 4 0 0   x3  13
 zi
c i  n, n  1, , n  k  1 2 0 0 0 1 0 0 0 1 0   x5   6 
 i       .
xi    0 1 0 0 0 2 0 0 0 3  x6  10 
 zi - ai xi  k

i  n  k , n  k  1, ,1 0 0 3 0 0 0 5 0 0 0   x7   0 
ci     
0 0 0 2 0 0 0 3 0 0   x8   9 
evaluated at   0 .     
0 0 0 0 1 0 0 0 1 0   x9   0 
Before we consider the solution of the system (3.1) by
 0 0 0 0 0 5 0 0 0 3  x10   4 
using the k-Thomas algorithm, it is recommended to use
the k-DETGTRI algorithm to check the nonsingularity of (4.2)
the coefficient matrix Tn( k ) firstly. In this case the k-Thomas numeric algorithm fails
since c5 = 0 as can be easily checked. However, the
4. Some Illustrative Examples k-Thomas symbolic algorithm yields:
 c1  2, c2  1, c3  1, c4  3, c5   , c6  3, c7  11,
In this section we are going to give some illustrative
examples.
1
c8  , c9  
   1 , c  8 (Step 1);
Example 4.1. Consider the following k-tridiagonal sys- 3  10

tem with n = 10 and k = 4:  


Hence det Tn  528    1  0  528. Consequently
(k )

(k )
2 0 0 0 1 0 0 0 0 0   x1   4  the matrix T is nonsingular.
n
 z1  4, z2  2, z3  0, z4  13, z5  8, z6  12, z7  0,

0 1 0 0 0 1 0 0 0 0   x2   2 
1 2
 0 0 1 0 0 0 2 0 0 0   x3   0  z8  , z9   , z10  24 (Step 2);
     3 
0 0 0 3 0 0 0 4 0 0   x3  13
2  1
2 0 0 0 4 0 0 0 1 0   x5  12   x1   1, x2  1, x3  0, x4  3,
      .   1  0
 0 1 0 0 0 2 0 0 0 3  x6  10 
2 2
0 0 3 0 0 0 5 0 0 0   x7   0  x5 
  1  0 6 7  2, x  1, x  0, x  1, x
8 9
  1  0
 2,
    
0 0 0 2 0 0 0 3 0 0   x8   9  x10  3 (Step 3).
    
0 0 0 0 1 0 0 0 1 0   x9   0  Example 4.3. Consider the k-tridiagonal matrix
 0 0 0 0 0 5 0 0 0 3  x10   4 
2 0 0 0 1 0 0 0 0 0
(4.1) 0 1 0 0 0 1 0 0 0 0 

Applying the numeric or the symbolic version of the  0 0 1 0 0 0 2 0 0 0
k-Thomas algorithms gives:  
c1  2, c2  1, c3  1, c4  3, c5  3, c6  3, c7  11, 0 0 0 3 0 0 0 4 0 0
2 0 0 0 1 0 0 0 1 0
1 4 Tn( k )    . (4.3)
c8  , c9   , c10  8 (Step 1);
3 3  0 1 0 0 0 2 0 0 0 3
0 0 3 0 0
 
Hence det Tn( k )  2112 . Thus Tn( k ) is nonsingular. 
0 0 0 5 0

0 0 0 2 0 0 0 3 0 0
 z1  4, z2  2, z3  0, z4  13, z5  8, z6  12, z7  0,  
0 0 0 0 1 0 0 0 1 0 
1 8
z8  , z9   , z10  24 (Step 2);  0 0 0 0 0 5 0 0 0 5
3 3
 x1  1, x2  1, x3  0, x4  3, x5  2, x6  1, x7  0, x8  1, For this matrix, the k-DETGTRI algorithm gives:
x9  2, x10  3 (Step 3). 1
c1  2, c2  1, c3  1, c4  3, c5   , c6  3, c7  11, c8  ,
Example 4.2. Consider the following k-tridiagonal 3
system with n = 10 and k = 4 (this example is Example
c9  
   1
, c10   . (Step 1)
4.1 with slight modifications in some positions. The 

Copyright © 2012 SciRes. AM


M. EL-MIKKAWY 345

 
Hence det Tn( k )  66    1  0  0. Therefore the General Tridiagonal Matrices,” Applied Mathematics Let-
ters, Vol. 19, No. 8, 2006, pp. 712-720.
matrix Tn( k ) is singular.
doi:10.1016/j.aml.2005.11.012
5. Conclusion [4] M. El-Mikkawy and T. Sogabe, “A New Family of k-Fib-
onacci Numbers,” Applied Mathematics and Computation,
A generalized symbolic Thomas algorithm, that will Vol. 215, No. 12, 2010, pp. 4456-4461.
never fail, is developed, for the first time, in this paper. doi:10.1016/j.amc.2009.12.069
The algorithm is suited for implementation using the [5] T. Sogabe and M. El-Mikkawy, “Fast Block Diagonaliza-
Computer Algebra Systems (CAS) such as Macsyma, tion of k-Tridiagonal Matrices,” Applied Mathematics and
Maple and Mathematica. Computation, Vol. 218, No. 6, 2011, pp. 2740-2743.
doi:10.1016/j.amc.2011.08.014
[6] M. E. A. El-Mikkawy, “A Fast Algorithm for Evaluating
REFERENCES nth Order Tridiagonal Determinants,” Journal of Compu-
tational and Applied Mathematics, Vol. 166, No. 2, 2004,
[1] M. E. A. El-Mikkawy, “A Note on a Three-Term Recur-
pp. 581-584. doi:10.1016/j.cam.2003.08.044
rence for a Tridiagonal Matrix,” Applied Mathematics
and Computation, Vol. 139, No. 2-3, 2003, pp. 503-511. [7] R. L. Burden and J. D. Faires, “Numerical Analysis,” 7th
doi:10.1016/S0096-3003(02)00212-6 Edition, Books & Cole Publishing, Pacific Grove, 2001.
[2] M. E. A. El-Mikkawy, “On the Inverse of a General Tri- [8] A. Yalciner, “The LU Factorization and Determinants of
diagonal Matrix,” Applied Mathematics and Computation, the k-Tridiagonal Matrices,” Asian-European Journal of
Vol. 150, No. 3, 2004, pp. 669-679. Mathematics, Vol. 4, No. 1, 2011, pp. 187-197.
doi:10.1016/S0096-3003(03)00298-4 doi:10.1142/S1793557111000162
[3] M. E. A. El-Mikkawy and A. Karawia, “Inversion of

Copyright © 2012 SciRes. AM

You might also like