07.01.2015 Views

9. Euclid’s Algorithm

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>9.</strong> <strong>Euclid’s</strong> <strong>Algorithm</strong><br />

<br />

<strong>Euclid’s</strong> algorithm is a technique for finding the greatest common<br />

divisor ( a , b)<br />

of two integers or polynomials a and b .<br />

Proposition (2.18, page 48)<br />

Let a and b be two positive integers (or polynomials)<br />

Then if a = q1b<br />

+ r1<br />

for<br />

0 ≤ r1 < b ( 0 ≤ deg( r1 ) ≤ deg(<br />

b)<br />

)<br />

One has a , b)<br />

= ( b , r )<br />

(<br />

1<br />

where ( a , b)<br />

denotes greatest common divisor.<br />

b = q2r1<br />

+ r<br />

M<br />

rn-2<br />

= q r<br />

r = q<br />

n-1<br />

2<br />

+ r<br />

⇒<br />

( b , r ) = ( r<br />

n n-1 n<br />

n+ 1rn<br />

⇒ ( a , b)<br />

1<br />

= r<br />

n<br />

1<br />

, r )<br />

2<br />

Example:<br />

Suppose a = 186, b = 66 ,<br />

then<br />

186 = 66 ∗ 2<br />

66 = 54 ∗1<br />

54 = 12 ∗4<br />

12 = 6 ∗ 2<br />

+ 54<br />

+ 12<br />

+ 6<br />

+ 0<br />

the greatest common divisor is 6 .


<strong>Euclid’s</strong> Division <strong>Algorithm</strong> for Polynomials<br />

Given two polynomials a(x)<br />

and b(x)<br />

Their greatest common divisor can be computed by an iterative<br />

application of the division algorithm. If the degree of a(x)<br />

is<br />

greater than the degree of b (x)<br />

, the computation of GCD<br />

( a(<br />

x)<br />

, b(<br />

x)<br />

)<br />

is<br />

a(<br />

x)<br />

= q<br />

b(<br />

x)<br />

= q<br />

( x)<br />

( x)<br />

⋅ b(<br />

x)<br />

+ r<br />

r1 ( x)<br />

= q3<br />

( x)<br />

⋅ r2<br />

( x)<br />

+ r<br />

M<br />

r<br />

n-1<br />

( x)<br />

= q<br />

1<br />

2<br />

n+<br />

1<br />

( x)<br />

⋅ r<br />

⋅ r ( x)<br />

+ r<br />

1<br />

n<br />

( x)<br />

1<br />

2<br />

3<br />

( x)<br />

( x)<br />

( x)<br />

where the iterative process stops when a remainder of zero is<br />

obtained.<br />

Then the greatest common divisor of a(x)<br />

and b(x)<br />

is<br />

r n<br />

( x)<br />

= GCD( a(<br />

x)<br />

, b(<br />

x)<br />

)<br />

Example:<br />

a(<br />

x)<br />

=<br />

b(<br />

x)<br />

=<br />

x<br />

x<br />

3<br />

2<br />

+ 1<br />

+ 1<br />

x<br />

x<br />

3<br />

2<br />

2<br />

+ 1 = ( x + 1)<br />

⋅ x + ( x + 1)<br />

+ 1 = ( x + 1)<br />

⋅ x<br />

∴GCD of a ( x)<br />

and b(<br />

x)<br />

is x + 1


m<br />

10. Arithmetic Operations in GF( 2 )<br />

<br />

Primitive Elements<br />

m<br />

Consider the Galois field GF( 2 ) generated by the primitive<br />

polynomial<br />

p ( x)<br />

+<br />

2<br />

m-1 m<br />

= p0 + p1x<br />

+ p2<br />

x + L+<br />

pm−1x<br />

x<br />

Definition:<br />

The element α (a root of p (x)<br />

) whose powers<br />

m<br />

generate all the non-zero elements of GF( 2 )iscalleda<br />

m<br />

primitive element of GF( 2 ).<br />

In fact, any element β<br />

m<br />

in GF( 2 ) whose powers generate all<br />

m<br />

the nonzero elements of GF( 2 ) is a primitive element.<br />

Example:<br />

α<br />

4<br />

and<br />

7<br />

α<br />

4<br />

are also primitive elements of GF( 2 ).


Minimum Polynomial<br />

m<br />

(1) Consider the Galois field GF( 2 ) generated by a primitive<br />

polynomial p(x)<br />

of degree m. Let β be a non-zero<br />

m<br />

element of GF( 2 )<br />

Consider the powers<br />

β,<br />

β<br />

2<br />

,<br />

β<br />

2<br />

2<br />

,<br />

2<br />

L , β ,<br />

i<br />

L<br />

If e is the smallest nonnegative integer for which<br />

2<br />

β e<br />

= β<br />

Then the integer “ e ” is called the exponent of β .<br />

(2) consider the product,<br />

φ(<br />

x)<br />

= ( x + β )( x + β<br />

= a + a x + a x<br />

0<br />

1<br />

2<br />

e−1<br />

2<br />

2<br />

) L ( x + β )<br />

2<br />

e-1<br />

+ L+<br />

ae-1x<br />

+ x<br />

e<br />

is a polynomial of e degree.<br />

We can see that φ(x)<br />

is binary and irreducible over<br />

GF( 2 ). φ(x)<br />

is called the minimal polynomial of the<br />

element β .

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!