developing computer program for computing

0 downloads 0 Views 171KB Size Report
May 20, 2011 - [5] B. Jacob, Linear Algebra, W. H. Freeman and Company, New York, ... [8] S. Lipschutz and M. L. Lipson, Aljabar Linier, Penerbit Erlangga, ...
Far East Journal of Mathematical Sciences (FJMS) Volume 56, Number 2, 2011, Pages 185-200 Published Online: September 15, 2011 This paper is available online at http://pphmj.com/journals/fjms.htm © 2011 Pushpa Publishing House

DEVELOPING COMPUTER PROGRAM FOR COMPUTING EIGENPAIRS OF 2 × 2 MATRICES AND 3 × 3 UPPER TRIANGULAR MATRICES USING THE SIMPLE ALGORITHM IRAWATI and TITO WALUYO PURBOYO Algebra Research Group Faculty of Mathematics and Natural Sciences Institut Teknologi Bandung Bandung, Indonesia e-mail: [email protected] Abstract In this paper, we investigate the theory and the process of computing eigenvalue and eigenvector using a simple algorithm and realize it in a computer program. We compare the simple algorithm with the classical one to see the effectiveness of both algorithms. The criteria for comparing the two algorithms are the speed and the accuracy of the computer program.

1. The Theory a For the following matrix A = ⎛⎜ ⎝c

b⎞ ⎟ , let us see the characteristic equation d⎠

λ2 − (a + d ) λ + (ad − bc ) = 0. With substitute λ = a + bm (b ≠ 0) into the equation,

we get (a + bm )2 − (a + d )(a + bm ) + ad − bc = 0 and we have a 2 + 2abm + b 2 m 2 − a 2 − ad − abm − dbm + ad − bc = 0. Next, we get b 2 m 2 + (a − d ) m − bc = 0. 2010 Mathematics Sub ject Classification: 65F15, 15A18. Keywords and phrases: simple algorithm, eigenvalues, eigenvectors. Received May 20, 2011

IRAWATI and TITO WALUYO PURBOYO

186

So bm 2 + (a − d ) m − c = 0 has Δ = 4bc + (a − d )2 as discriminant. But the characteristic equation has discriminant Δ = (a + d )2 − 4(ad − bc ) which can be changed into Δ = a 2 + 2ad + d 2 − 4ad + 4bc and we have Δ = a 2 − 2ad + d 2 + 4bc. So Δ = (a − d )2 + 4bc. We can see that the characteristic equations λ2 − (a + d ) λ + (ad − bc ) = 0 and bm 2 + (a − d ) m − c = 0 have the same discriminant.

So we can use the equation bm 2 + (a − d ) m − c = 0 to find the eigenvalue and the eigenvector of A. a Proposition 1. Let A = ⎛⎜ ⎝c ⎡ (a) ⎢a + bm, ⎣

b⎞ ⎟ with a, b, c, d ∈ R. Then d⎠

⎛ 1 ⎞⎤ ⎜ ⎟⎥ is the eigencouple of A if and only if m is the finite root of ⎝ m ⎠⎦

bm 2 + (a − d ) m − c = 0. ⎡ (b) The couple ⎢d , ⎣

⎛ 0 ⎞⎤ ⎜ ⎟⎥ is the eigencouple of A if and only if ∞ is the root of ⎝ 1 ⎠⎦

bm 2 + (a − d ) m − c = 0.

(c) If at least one of the coefficients of bm 2 + (a − d ) m − c = 0 is not zero, then its eigenspace is of dimension one. If all of the coefficient of bm 2 + (a − d ) m ⎡ − c = 0 are zero, then ⎢a, ⎣ zero.

⎛ x ⎞⎤ ⎜ ⎟⎥ is an eigencouple of A for some x and y not all ⎝ y ⎠⎦

⎛1⎞ ⎛0⎞ Proof. Let vm = ⎜ ⎟ and v∞ = ⎜ ⎟ . ⎝m⎠ ⎝1⎠

For a real number m, m is the slope of vm and the slope of v∞ is infinite. (a) (⇒) ⎡ ⎛ 1 ⎞⎤ Let ⎢a + bm, ⎜ ⎟⎥ be an eigencouple of A for a finite number m, so we have ⎣ ⎝ m ⎠⎦

DEVELOPING COMPUTER PROGRAM FOR COMPUTING … ⎛a ⎜ ⎝c

187

b⎞⎛ 1 ⎞ ⎛1⎞ ⎟ ⎜ ⎟ = (a + bm ) ⎜ ⎟ . d ⎠ ⎝m⎠ ⎝ m⎠

We get ⎛ a + bm ⎞ ⎛ a + bm ⎞ ⎜ ⎟=⎜ 2 ⎟. ⎝ c + dm ⎠ ⎝ am + bm ⎠

So c + dm = am + bm 2 .

We have bm 2 + (a − d ) m − c = 0. So m is a finite root of bm 2 + (a − d ) m − c = 0. (⇐) Let m be a finite root of bm 2 + (a − d ) m − c = 0. We have bm 2 + am = c + dm ⇔ m(a + bm ) = c + dm.

So c + dm = m(a + bm ) .

The last equation can be written as ⎛ a + bm ⎞ ⎛ a + bm ⎞ ⎜ ⎟=⎜ 2 ⎟. ⎝ c + dm ⎠ ⎝ am + bm ⎠

And we have ⎛a ⎜ ⎝c ⎡ It means that ⎢a + bm, ⎣

b⎞⎛ 1 ⎞ ⎛1⎞ ⎟ ⎜ ⎟ = (a + bm ) ⎜ ⎟ . d ⎠ ⎝m⎠ ⎝m⎠

⎛ 1 ⎞⎤ ⎜ ⎟⎥ is an eigencouple of A. ⎝ m ⎠⎦

(b) (⇒) ⎡ Let ⎢d , ⎣

⎛ 0 ⎞⎤ ⎜ ⎟⎥ be an eigencouple of A. ⎝ 1 ⎠⎦

IRAWATI and TITO WALUYO PURBOYO

188 ⎛a We have ⎜ ⎝c

b ⎞ ⎛ 0⎞ ⎛0⎞ ⎟ ⎜ ⎟ = d⎜ ⎟. d ⎠ ⎝1⎠ ⎝1⎠

So b = 0, so the root of bm 2 + (a − d ) m − c = 0 is m1, 2 =

(d − a ) ± (a − d )2 + 4bc 2b

.

Because of b = 0, we get that the root of bm 2 + (a − d ) m − c = 0 is infinite. So ∞ is a root of bm 2 + (a − d ) m − c = 0. (⇐) Let λ be the root of bm 2 + (a − d ) m − c = 0. Because the root of bm 2 + (a − d ) m − c = 0 is infinite and the root is

(d − a ) ± (a − d )2 + 4bc 2b

⎛a Let ⎜ ⎝c

, then we get b = 0.

0 ⎞ ⎛ 0⎞ ⎛ 0 ⎞ ⎛ 0⎞ ⎟ ⎜ ⎟ = ⎜ ⎟ = d⎜ ⎟. d ⎠ ⎝1⎠ ⎝ d ⎠ ⎝1⎠

⎛a Because of ⎜ ⎝c

0 ⎞ ⎛ 0⎞ ⎛ 0 ⎞ ⎡ ⎛ 0 ⎞⎤ ⎟ ⎜ ⎟ = d ⎜ ⎟ , ⎢d , ⎜ ⎟⎥ is the eigencouple of A. d ⎠ ⎝1⎠ ⎝ 1 ⎠ ⎣ ⎝ 1 ⎠⎦

(c) Let bm 2 + (a − d ) m − c = 0 have at least one non-zero coefficient, so we have bm 2 + (a − d ) m − c = 0 has at most two roots. Next, let us see ⎛a ⎜ ⎝c

b⎞⎛ 1 ⎞ ⎛1⎞ ⎟ ⎜ ⎟ = λ⎜ ⎟ , b ≠ 0 d ⎠ ⎝ m⎠ ⎝m⎠

and ⎛a ⎜ ⎝c

0 ⎞ ⎛0⎞ ⎛0⎞ ⎟ ⎜ ⎟ = λ⎜ ⎟ . d ⎠ ⎝1⎠ ⎝1⎠

⎛1⎞ ⎛ 0⎞ If vm = ⎜⎜ ⎟⎟ and v∞ = ⎜⎜ ⎟⎟ are eigenvectors, then the eigenvalue corresponds to ⎝ m⎠ ⎝1⎠ vm is a + bm and the eigenvalue corresponds to v∞ is d.

DEVELOPING COMPUTER PROGRAM FOR COMPUTING …

189

⎛ x⎞ Because that every non-zero vector ⎜ ⎟ in R 2 can be written uniquely as ⎝ y⎠

constant multiple either of vm for a real number m, or of v∞ , that is, ⎛ x⎞ ⎛1⎞ ⎛ x⎞ ⎛ 0⎞ ⎜ ⎟ = s⎜ ⎟ ; s ∈ R or ⎜ ⎟ = s⎜ ⎟ ; s ∈ R. ⎝ y⎠ ⎝m⎠ ⎝ y⎠ ⎝1⎠ ⎡ Then every eigencouple ⎢a + bm, ⎣

⎛ 1 ⎞⎤ ⎡ ⎜ ⎟⎥ or ⎢d , ⎝ m ⎠⎦ ⎣

⎛ 0 ⎞⎤ ⎜ ⎟⎥ is a one dimensional. ⎝ 1 ⎠⎦

For the second statement, let all of the coefficient of bm 2 + (a − d ) m − c = 0 are zero, b = 0, a − d = 0 and c = 0, so λ and every finite m is the root of bm 2 + (a − d ) m − c = 0. ⎛a In this case, A = ⎜ ⎝0

0⎞ ⎟. a⎠

⎛ 1 ⎞ ⎤ ⎡ ⎛ 1 ⎞⎤ ⎡ For a finite m, we get ⎢a + bm, ⎜ ⎟⎥ = ⎢a, ⎜ ⎟⎥ = [a, vm ]. ⎝ m ⎠ ⎦ ⎣ ⎝ m ⎠⎦ ⎣ ⎡ For an infinite m, ⎢d , ⎣

⎛ 0 ⎞⎤ ⎡ ⎜ ⎟⎥ = ⎢a, ⎝ 1 ⎠⎦ ⎣

⎛ 0 ⎞⎤ ⎜ ⎟⎥ = [a, v∞ ]. ⎝ 1 ⎠⎦

⎡ ⎛ x ⎞⎤ So ⎢a, ⎜ ⎟⎥ is an eigencouple of A for x and y not all zero. ⎣ ⎝ y ⎠⎦

In the next proposition, we expand the result in 3 × 3 triangular matrices ⎛a ⎜ A = ⎜0 ⎜0 ⎝

b d 0

c⎞ ⎟ e ⎟ with (a ≠ d ≠ f ; a, b, c, d , e, f ∈ R ) . f ⎟⎠

⎛a ⎜ Proposition 2. Let A = ⎜ 0 ⎜0 ⎝ ⎡ (a) The couple ⎢a + bm1, ⎢ ⎣⎢

b d 0

c⎞ ⎟ e ⎟ with a, b, c, d , e, f ∈ R; a ≠ d ≠ f . f ⎟⎠

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎜ m1 ⎟⎥ is an eigencouple of A if and only if m1 is a ⎜ 0 ⎟⎥ ⎝ ⎠⎦

root of m[b 2 m 2 − b( f + d − 2a ) m + (d − a ) ( f − a )] = 0.

IRAWATI and TITO WALUYO PURBOYO

190

⎡ ⎢ ⎢ (b) The couple ⎢a + bm2 , ⎢ ⎢ ⎣⎢

e c ⎞⎤ ⎛ ⎜ ( f − d ) m + bm ⎟⎥ 2 2⎟ ⎜ ⎥ ⎜ ⎟⎥ is an eigencouple of A if and e ⎜ ⎟⎥ f −d ⎜ ⎟⎥ ⎜ ⎟⎥ 1 ⎝ ⎠⎦

only if m2 is a finite root of m[b 2 m 2 − b( f + d − 2a ) m + (d − a ) ( f − a )] = 0. ⎡ (c) The couple ⎢d , ⎢ ⎣⎢

⎛ 0 ⎞⎤ ⎜ ⎟⎥ ⎜ 1 ⎟⎥ is an eigencouple of A if and only if ∞ is a root of ⎜ 0 ⎟⎥ ⎝ ⎠⎦

b 2 m 2 − b( f + d − 2 a ) m + ( d − a ) ( f − a ) = 0.

⎡ ⎢ ⎢ (d) The couple ⎢ f , ⎢ ⎢ ⎢⎣

⎛ c ⎞⎤ ⎜ f − a ⎟⎥ ⎟⎥ ⎜ ⎜ e ⎟⎥ is an eigencouple of A if and only if ∞ is a root of ⎜ f − d ⎟⎥ ⎟⎥ ⎜ ⎜ 1 ⎟⎥ ⎠⎦ ⎝

b 2 m 2 − b( f + d − 2 a ) m + ( d − a ) ( f − a ) = 0.

Proof. (a) (⇒) ⎡ Let ⎢a + bm, ⎢ ⎣⎢

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎜ m ⎟⎥ is the eigencouple of A for a finite m such that ⎜ 0 ⎟⎥ ⎝ ⎠⎦ ⎛a ⎜ ⎜0 ⎜0 ⎝

b d 0

c ⎞⎛ 1 ⎞ ⎛1⎞ ⎟⎜ ⎟ ⎜ ⎟ e ⎟ ⎜ m ⎟ = (a + bm ) ⎜ m ⎟ . ⎜0⎟ f ⎟⎠ ⎜⎝ 0 ⎟⎠ ⎝ ⎠

We get ⎛ a + bm ⎞ ⎛ a + bm ⎞ ⎜ ⎟ ⎜ 2⎟ ⎜ dm ⎟ = ⎜ am + bm ⎟ . ⎜ 0 ⎟ ⎜ ⎟ 0 ⎝ ⎠ ⎝ ⎠

It means that dm = am + bm 2 : 0 = bm 2 − dm + am = b 2 m 2 − bdm − bam (because b ≠ 0) = b 2 m 2 − b(d − a ) m.

DEVELOPING COMPUTER PROGRAM FOR COMPUTING …

191

By writing b 2 m 2 − b(d − a ) m = b 2 m 2 − b(d − a ) m, we have 0 = b 2 m 2 − b 2 m 2 − b( d − a ) m + b( d − a ) m = b 2 m 2 − b(bm + (d − a )) m + (d − a ) bm = b 2 m 2 − b(( f − a ) + (d − a )) m + (d − a ) ( f − a ) (because f = a + bm ) = b 2 m 2 − b( f + d − 2 a ) m + ( d − a ) ( f − a ) = m[b 2 m 2 − b( f + d − 2a ) m + (d − a ) ( f − a )].

So m[b 2 m 2 − b( f + d − 2a ) m + (d − a ) ( f − a )] = 0. And we get m is a root of m[b 2 m 2 − b( f + d − 2a ) m + (d − a ) ( f − a )] = 0.

(⇐) Let m is the root of m[b 2 m 2 − b( f + d − 2a ) m + (d − a ) ( f − a )] = 0.

We have that b 2 m 2 − b( f + d − 2 a ) m + ( d − a ) ( f − a ) = 0. 0 = b 2 m 2 − b (( f − a ) + ( d − a )) m + ( d − a ) ( f − a ) = b 2 m 2 − b(bm + (d − a )) m + (d − a ) bm (because f = a + bm ) = b 2 m 2 − b 2 m 2 − b( d − a ) m + b( d − a ) m = b 2 m 2 − b( d − a ) m = b 2 m 2 − b( d − a ) m = b 2 m 2 − b( d − a ) m

= b 2 m 2 − bdm − bam = bm 2 − dm + am (because b ≠ 0) = dm = am + bm 2 .

So dm = m(a + bm ) .

IRAWATI and TITO WALUYO PURBOYO

192 And we get

⎛ a + bm ⎞ ⎛ a + bm ⎞ ⎟ ⎜ ⎟ ⎜ ⎜ dm ⎟ = ⎜ m(a + bm ) ⎟ , ⎟ ⎜ 0 ⎟ ⎜ 0 ⎠ ⎝ ⎠ ⎝ ⎛a ⎜ ⎜0 ⎜0 ⎝ ⎡ So ⎢a + bm, ⎢ ⎣⎢

b d 0

c ⎞⎛ 1 ⎞ ⎛1⎞ ⎜ ⎟ ⎟⎜ ⎟ e ⎟ ⎜ m ⎟ = (a + bm ) ⎜ m ⎟ . ⎜0⎟ f ⎟⎠ ⎜⎝ 0 ⎟⎠ ⎝ ⎠

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎜ m ⎟⎥ is an eigencouple of A. ⎜ 0 ⎟⎥ ⎝ ⎠⎦

(b) (⇒) ⎡ ⎢ ⎢ Let ⎢a + bm2 , ⎢ ⎢ ⎢⎣

e c ⎞⎤ ⎛ ⎜ ( f − d ) m + bm ⎟⎥ 2 2⎟ ⎜ ⎥ ⎜ ⎟⎥ is an eigencouple of A for a finite real e ⎜ ⎟⎥ f −d ⎜ ⎟⎥ ⎜ ⎟⎥ 1 ⎝ ⎠⎦

number m2 such that

⎛a ⎜ ⎜0 ⎜0 ⎝

b d 0

e c ⎞ e c ⎞ ⎛ ⎛ ⎜ ( f − d ) m + bm ⎟ ⎜ ( f − d ) m + bm ⎟ 2 2⎟ 2 2⎟ c ⎞⎜ ⎜ ⎟⎜ ⎟. ⎜ ⎟ = (a + bm2 ) e⎟ e e ⎟ ⎜ ⎟ ⎜ ⎟ f −d f −d f ⎠⎜ ⎟ ⎜ ⎟ ⎟ ⎜ ⎟ ⎜ 1 1 ⎠ ⎝ ⎠ ⎝

So we have ⎛ a + bm2 ⎞ ⎛ a + bm2 ⎞ ⎜ ⎟ ⎜ ⎟ ⎜ ef ⎟ = ⎜ ef ⎟. ⎜ f −d ⎟ ⎜ f −d ⎟ ⎜ ⎟ ⎜ a + bm ⎟ f ⎝ ⎠ ⎝ 2⎠

This means dm2 = am2 + bm22 . So m[b 2 m 2 − b( f + d − 2a ) m + (d − a ) ( f − a )] = 0.

DEVELOPING COMPUTER PROGRAM FOR COMPUTING …

193

We have that m is a finite root of m[b 2 m 2 − b( f + d − 2a ) m + (d − a )( f − a )] = 0.

(⇐) Let m is a finite root of m[b 2 m 2 − b( f + d − 2a ) m + (d − a ) ( f − a )] = 0. Then we have m(a + bm ) = dm.

So dm = m(a + bm ) .

We have ⎛ a + bm ⎞ ⎛ a + bm ⎞ ⎜ ⎟ ⎜ 2⎟ ⎜ dm ⎟ = ⎜ am + bm ⎟ . ⎜ 0 ⎟ ⎜ ⎟ 0 ⎝ ⎠ ⎝ ⎠

And finally, we get

⎛a ⎜ ⎜0 ⎜0 ⎝

b d 0

⎡ ⎢ ⎢ So ⎢a + bm2 , ⎢ ⎢ ⎢⎣

e c ⎞ e c ⎞ ⎛ ⎛ ⎜ ( f − d ) m + bm ⎟ ⎜ ( f − d ) m + bm ⎟ 2 2⎟ 2 2⎟ c⎞⎜ ⎜ ⎟ ⎟ ⎜ ⎟. a bm e⎟⎜ = + ( ) e e ⎜ ⎟ ⎜ ⎟ ⎟ f −d f −d f ⎠⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟ 1 1 ⎝ ⎠ ⎝ ⎠

e c ⎞⎤ ⎛ ⎜ ( f − d ) m + bm ⎟⎥ 2 2⎟ ⎜ ⎥ ⎜ ⎟⎥ is an eigencouple of A. e ⎜ ⎟⎥ f −d ⎜ ⎟⎥ ⎜ ⎟⎥ 1 ⎝ ⎠⎦

(c) (⇒) ⎡ Let ⎢d , ⎢ ⎣⎢

So b = 0.

⎛ 0 ⎞⎤ ⎜ ⎟⎥ ⎜ 1 ⎟⎥ be an eigencouple of A. Then ⎜ 0 ⎟⎥ ⎝ ⎠⎦ c ⎞ ⎛ 0⎞ ⎛a b ⎜ ⎟⎜ ⎟ d e ⎟ ⎜1⎟ = 0 ⎜ ⎜0 f ⎟⎠ ⎜⎝ 0 ⎟⎠ 0 ⎝

⎛ 0⎞ ⎜ ⎟ d⎜1⎟. ⎜ 0⎟ ⎝ ⎠

IRAWATI and TITO WALUYO PURBOYO

194

As the root of b 2 m 2 − b( f + d − 2a ) m + (d − a ) ( f − a ) = 0, we get b( f + d − 2a ) ± (b( f + d − 2a ))2 + 4b 2 (d − a ) ( f − a )

m1, 2 =

2b 2

.

Because of b = 0, we get that b 2 m 2 − b( f + d − 2a ) m + (d − a ) ( f − a ) = 0 has

an infinite root. (⇐) Let λ be the root of b 2 m 2 − b( f + d − 2a ) m + (d − a ) ( f − a ) = 0. From m = ⎛a ⎜ Let ⎜ 0 ⎜0 ⎝ ⎡ So ⎢d , ⎢ ⎣⎢

(d − a ) ± (a − d )2 + 4bc 2b

0 d 0

, we get b = 0.

c ⎞ ⎛ 0⎞ ⎛ 0 ⎞ ⎛ 0⎞ ⎟⎜ ⎟ ⎜ ⎟ ⎜ ⎟ e ⎟ ⎜1⎟ = ⎜ d ⎟ = d⎜1⎟. ⎜ 0⎟ f ⎟⎠ ⎜⎝ 0 ⎟⎠ ⎜⎝ 0 ⎟⎠ ⎝ ⎠

⎛ 0 ⎞⎤ ⎜ ⎟⎥ ⎜ 1 ⎟⎥ is an eigencouple of A. ⎜ 0 ⎟⎥ ⎝ ⎠⎦

(d) (⇒) ⎡ ⎢ ⎢ Let ⎢ f , ⎢ ⎢ ⎢⎣

⎛ c ⎞⎤ ⎜ f − a ⎟⎥ ⎜ ⎟⎥ ⎜ e ⎟⎥ be an eigencouple of A. ⎜ f − d ⎟⎥ ⎜ ⎟⎥ ⎜ 1 ⎟⎥ ⎝ ⎠⎦

We have ⎛a ⎜ ⎜0 ⎜0 ⎝

So b = 0.

b d 0

⎛ c ⎞ ⎛ c ⎞ ⎜ f −a⎟ ⎜ f −a⎟ c⎞⎜ ⎟ ⎜ ⎟ ⎟ e ⎟ ⎜ e ⎟ = f ⎜ e ⎟. ⎜ ⎟ ⎜ f −d⎟ f ⎟⎠ ⎜ f − d ⎟ ⎜ ⎟ ⎜ 1 ⎟ ⎜ 1 ⎟ ⎝ ⎠ ⎝ ⎠

DEVELOPING COMPUTER PROGRAM FOR COMPUTING …

195

The roots of b 2 m 2 − b( f + d − 2a ) m + (d − a ) ( f − a ) = 0 can be gotten from m1, 2 =

b( f + d − 2a ) ± (b( f + d − 2a ))2 + 4b 2 (d − a ) ( f − a ) 2b 2

.

Because of b = 0, b 2 m 2 − b( f + d − 2a ) m + (d − a ) ( f − a ) = 0 has an infinite root. So ∞ is a root of b 2 m 2 − b( f + d − 2a ) m + (d − a ) ( f − a ) = 0.

(⇐) Let λ be a root of b 2 m 2 − b( f + d − 2a ) m + (d − a ) ( f − a ) = 0. Because of m =

(d − a ) ± (a − d )2 + 4bc 2b

is the root of b 2 m 2 − b( f + d − 2a ) m

+ (d − a ) ( f − a ) = 0, we get b = 0.

⎛a ⎜ Let ⎜ 0 ⎜0 ⎝

0 d 0

⎛ c ⎞ ⎛ fc ⎞ ⎛ c ⎞ ⎜ f −a⎟ ⎜ f −a⎟ ⎜ f −a⎟ c ⎞⎜ ⎜ ⎟ ⎟ ⎜ ⎟ ⎟ e ⎟ ⎜ e ⎟ = ⎜ fe ⎟ = f ⎜ e ⎟ . ⎟ ⎜ ⎟ ⎜ ⎜ ⎟ f ⎟⎠ ⎜ f − d ⎟ ⎜ f − d ⎟ ⎜ f −d⎟ ⎜ 1 ⎟ ⎜ f ⎟ ⎜ 1 ⎟ ⎝ ⎠ ⎝ ⎝ ⎠ ⎠

⎛a 0 ⎜ Because of ⎜ 0 d ⎜⎜ 0 0 ⎝

⎛ c ⎞ c ⎞⎜ f − a ⎟ ⎟⎜ e ⎟ ⎟= e ⎟⎜ ⎟⎟ ⎜ f − d ⎟ f ⎠⎜ 1 ⎟ ⎜ ⎟ ⎝ ⎠

⎡ ⎛ c ⎞⎤ ⎛ c ⎞ ⎜ f −a⎟ ⎢ ⎜ f − a ⎟⎥ ⎜ ⎟ ⎢ ⎜ e ⎟⎥ e ⎟ ⎟⎥ is an f⎜ , we have ⎢ f , ⎜ ⎜ f −d⎟ ⎢ ⎜ f − d ⎟⎥ ⎜ 1 ⎟ ⎢ ⎜ 1 ⎟⎥ ⎟⎥ ⎜ ⎟ ⎢⎣ ⎜⎝ ⎠⎦ ⎝ ⎠

eigenspace of A. 2. The Computer Program

The program is written in Delphi language. 2.1. The computer program for classical algorithm

The equation for the classical algorithm consists of:

196

IRAWATI and TITO WALUYO PURBOYO 1. The characteristic equation b ⎞ ⎛a − λ ⎟ = 0. det ⎜⎜ d − λ ⎟⎠ ⎝ c

2. The equation for getting eigenvalues λ=

a+d ± 2

( a + d )2

=

a+d ± 2

4bc + (a − d )2 . 2

4

+ bc − ad

3. For every eigenvalue λ, we find the eigenvector from the following equation ⎡ x⎤ Av = λv, where v = ⎢ ⎥ with x, y ∈ R. ⎣ y⎦

2.2. The computer program for the simple algorithm

The equation for the simple algorithm consists of: 1. The equation bm 2 + (a − d ) m − c = 0.

2. The root of the equation in 1, m=

d −a ± 2

( a − d )2

=

d −a ± 2

(a − d )2 + 4bc

4

+ bc

2

.

3. If m is finite, then the eigencouple is ⎡ ⎢a + bm, ⎣

⎛ 1 ⎞⎤ ⎜ ⎟⎥ . ⎝ m ⎠⎦

⎡ ⎛ 0 ⎞⎤ 4. If m is infinite, then the eigencouple is ⎢a, ⎜ ⎟⎥ . ⎣ ⎝ 1 ⎠⎦

DEVELOPING COMPUTER PROGRAM FOR COMPUTING …

197

2.3. The speed comparison of the two programs 2.3.1. The 2 × 2 matrices Matrix 2 × 2 Det

⎡1 ⎢0 ⎣

0⎤ 1⎥⎦

⎡1 ⎢0 ⎣

1⎤ 1⎥⎦

⎡1 ⎢1 ⎣

0⎤ 1⎥⎦

⎡1 ⎢1 ⎣

1⎤ 1⎥⎦

⎡1 ⎢−1 ⎣

−1⎤ 1 ⎥⎦

⎡1 ⎢1 ⎣

−1⎤ 1 ⎥⎦

⎡1 ⎢−1 ⎣

1⎤ 1⎥⎦

0

0

0

4

4

–4

–4

The root in m

Infinite and 0

0

Infinite

1 and –1

–1 and 1

–i and i

i and –i

The root of the char polynomial

1

1

1

2 and 0

2 and 0

1+ i and 1– i

1 + i and 1 – i

Eigencouple

⎡ ⎛ 0 ⎞⎤ ⎢1, ⎜ 1 ⎟⎥ ⎣ ⎝ ⎠⎦ ⎡ ⎛ 1 ⎞⎤ ⎢1, ⎜ 0 ⎟⎥ ⎣ ⎝ ⎠⎦ ⎡ ⎛ 1 ⎞⎤ ⎢1, ⎜ 0 ⎟⎥ ⎣ ⎝ ⎠⎦ ⎡ ⎢1, ⎣

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎝ 0 ⎠⎦

⎡ ⎛ 0 ⎞⎤ ⎢1, ⎜ 1 ⎟⎥ ⎣ ⎝ ⎠⎦ ⎡ ⎢1, ⎣

⎛ 0 ⎞⎤ ⎜ ⎟⎥ ⎝ 1 ⎠⎦

⎡ ⎢2, ⎣

⎛1⎞⎤ ⎜ ⎟⎥ ⎝1⎠⎦

⎡ ⎛ 1 ⎞⎤ ⎢0, ⎜ −1⎟⎥ ⎣ ⎝ ⎠⎦ ⎡ ⎢2, ⎣

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎝ −1⎠⎦

⎡ ⎛ 1⎞ ⎤ ⎢0, ⎜1⎟⎥ ⎣ ⎝ ⎠⎦ ⎡ ⎛ 1 ⎞⎤ ⎢1 + i, ⎜ − i ⎟⎥ ⎣ ⎝ ⎠⎦ ⎡ ⎛1⎞⎤ ⎢1 − i, ⎜ i ⎟⎥ ⎣ ⎝ ⎠⎦ ⎡ ⎛1⎞⎤ ⎢1 + i, ⎜ i ⎟⎥ ⎣ ⎝ ⎠⎦ ⎡ ⎢1 − i, ⎣

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎝ − i ⎠⎦

Time for simple Time for classical algorithm in algorithm in millisecond millisecond

359

375

360

375

359

391

391

406

360

391

421

438

406

422

It can be seen that the time needed for the simple algorithm is shorter than for the classical algorithm.

IRAWATI and TITO WALUYO PURBOYO

198

In the following table, we compare the two algorithms for 3 × 3 matrices

Matrix 3 × 3

Det

The root Time for simple of the Roots in m The eigencouple program in characteristic millisecond polynomial

⎡ ⎢1, ⎢ ⎢⎣ ⎡1 ⎢0 ⎢ ⎢⎣0

⎡5 ⎢0 ⎢ ⎣⎢0

2 4 0

0 4 0

3⎤ 5⎥ ⎥ 6⎥⎦

3⎤ 1⎥ ⎥ 2⎦⎥

16

0

0 1, 5 2, 5

0 Infinite

1 4 6

5 4 2

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎜ 0 ⎟⎥ ⎜ 0 ⎟⎥ ⎝ ⎠⎦

⎡ ⎢4, ⎢ ⎢⎣

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎜1, 5 ⎟⎥ ⎜ 0 ⎟⎥ ⎝ ⎠⎦

⎡ ⎢6, ⎢ ⎣⎢

⎛ 1, 6 ⎞⎤ ⎟⎥ ⎜ ⎜ 2, 5 ⎟⎥ ⎜ 1 ⎟⎥ ⎠⎦ ⎝

⎡ ⎢5, ⎢ ⎢⎣

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎜ 0 ⎟⎥ ⎜ 0 ⎟⎥ ⎝ ⎠⎦

⎡ ⎢4, ⎢ ⎣⎢

⎛ 0 ⎞⎤ ⎜ ⎟⎥ ⎜ 1 ⎟⎥ ⎜ 0 ⎟⎥ ⎝ ⎠⎦

⎡ ⎢−1, ⎢ ⎢⎣ − 2⎤ 7⎥ ⎥ 1 ⎦⎥

9

0 0,333 0,667

–1 0 1

⎡ ⎢0, ⎢ ⎣⎢

−3 0

2⎤ 1⎥ ⎥ − 4⎥⎦

25

0 0,6 0,8

0 –3 –4

⎡ ⎢− 3, ⎢ ⎢⎣ ⎡ ⎢− 4, ⎢ ⎣⎢

547

641

594

640

562

641

⎛ 9, 5 ⎞⎤ ⎟⎥ ⎜ ⎜ 7 ⎟⎥ ⎜ 1 ⎟⎥ ⎠⎦ ⎝

⎡ ⎢0, ⎢ ⎣⎢ −5

672

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎜ 0 ⎟⎥ ⎜ 0 ⎟⎥ ⎝ ⎠⎦

⎛ 1 ⎞⎤ ⎟⎥ ⎜ ⎜ 0, 333 ⎟⎥ ⎜ 0 ⎟⎥ ⎠⎦ ⎝

⎡ ⎢1, ⎢ ⎢⎣

⎡0 ⎢0 ⎢ ⎢⎣0

594

⎛ −1 ⎞⎤ ⎟⎥ ⎜ ⎜ − 0, 5 ⎟⎥ ⎜ 1 ⎟⎥ ⎠⎦ ⎝

⎡ ⎢2, ⎢ ⎢⎣

⎡−1 3 ⎢0 0 ⎢ ⎣⎢ 0 0

Time for classical program in millisecond

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎜ 0 ⎟⎥ ⎜ 0 ⎟⎥ ⎝ ⎠⎦ ⎛ 1 ⎞⎤ ⎟⎥ ⎜ ⎜ 0, 6 ⎟⎥ ⎜ 0 ⎟⎥ ⎠⎦ ⎝

⎛ −1, 75 ⎞⎤ ⎟⎥ ⎜ ⎜ −1 ⎟⎥ ⎜ 1 ⎟⎥ ⎠⎦ ⎝

DEVELOPING COMPUTER PROGRAM FOR COMPUTING … ⎡ ⎢1, ⎢ ⎢⎣ ⎡1 2 0⎤ ⎢ ⎥ ⎢ 0 4 3⎥ ⎢ ⎥ ⎣0 0 5 ⎦

⎡1 0 4⎤ ⎢ ⎥ ⎢0 2 5 ⎥ ⎢ ⎥ ⎣0 0 3 ⎦

⎡1 ⎢0 ⎢ ⎢⎣0

1 5 0

2⎤ −1⎥ ⎥ 7 ⎥⎦

4

0

4

0 1,5 2

0 Infinite

0 4 6

1 4 5

1 2 3

1 5 7

199

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎜ 0 ⎟⎥ ⎜ 0 ⎟⎥ ⎝ ⎠⎦

⎡ ⎢4, ⎢ ⎣⎢

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎜1, 5 ⎟⎥ ⎜ 0 ⎟⎥ ⎝ ⎠⎦

⎡ ⎢5, ⎢ ⎢⎣

⎛1, 5 ⎞⎤ ⎜ ⎟⎥ ⎜ 3 ⎟⎥ ⎜ 1 ⎟⎥ ⎝ ⎠⎦

⎡ ⎢1, ⎢ ⎢⎣

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎜ 0 ⎟⎥ ⎜ 0 ⎟⎥ ⎝ ⎠⎦

⎡ ⎢2, ⎢ ⎣⎢

⎛ 0 ⎞⎤ ⎜ ⎟⎥ ⎜ 1 ⎟⎥ ⎜ 0 ⎟⎥ ⎝ ⎠⎦

⎡ ⎢3, ⎢ ⎢⎣

⎛ 2 ⎞⎤ ⎜ ⎟⎥ ⎜ 5 ⎟⎥ ⎜ 1 ⎟⎥ ⎝ ⎠⎦

⎡ ⎢1, ⎢ ⎢⎣

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎜ 0 ⎟⎥ ⎜ 0 ⎟⎥ ⎝ ⎠⎦

⎡ ⎢5, ⎢ ⎢⎣

⎛ 1 ⎞⎤ ⎜ ⎟⎥ ⎜1, 5 ⎟⎥ ⎜ 0 ⎟⎥ ⎝ ⎠⎦

⎡ ⎢7, ⎢ ⎣⎢

⎛ 1, 6 ⎞⎤ ⎟⎥ ⎜ ⎜ 2, 5 ⎟⎥ ⎜ 1 ⎟⎥ ⎠⎦ ⎝

578

656

562

657

563

656

It also can be seen that the time needed for the simple algorithm is shorter than for the classical algorithm. References [1]

R. B. Ash, A Primer of Abstract Mathematics, The Mathematical Association of America, Washington, 1998, pp. 127-130.

[2]

D. S. Dummit and R. M. Foote, Abstract Algebra, Prentice Hall, New Jersey, 1991, pp. 225-228.

[3]

J. L. Goldberg, Matrix Theory with Application, McGraw-Hill, New York, 1992, pp. 242-249.

200

IRAWATI and TITO WALUYO PURBOYO

[4]

M. Golubitsky and M. Dellnitz, Linear Algebra and Differential Equations using MATLAB, Brooks/Cole Publishing Company, California, 1999, pp. 153-167.

[5]

B. Jacob, Linear Algebra, W. H. Freeman and Company, New York, 1990, pp. 360-364.

[6]

A. Jones, S. A. Morris and K. R. Pearson, Abstract Algebra and Famous Impossibilities, Springer-Verlag, New York, 1991, pp. 24-31.

[7]

S. Lang, Introduction to Linear Algebra, Springer-Verlag, New York, 1985, pp. 233-248.

[8]

S. Lipschutz and M. L. Lipson, Aljabar Linier, Penerbit Erlangga, Jakarta, 2004, pp. 257-268.

[9]

T. A. Newton, A simple algorithm for finding eigenvalues and eigenvectors for 2 × 2 matrices, Amer. Math. Monthly 97(1) (1990).

[10]

S. Roman, Advanced Linear Algebra, Springer-Verlag, New York, Vol. 15, 1992, pp. 135-156.

[11]

D. S. Watkins, Fundamentals of Matrix Computations, John Wiley and Sons, Inc., Canada, 1991, pp. 199-209.