Chapter 11: Phi Function

clankjewishΗλεκτρονική - Συσκευές

10 Οκτ 2013 (πριν από 4 χρόνια και 3 μέρες)

88 εμφανίσεις


1


Chapter
11
:
Euler’s

Phi Function


Practice HW

p.
80

#
1
,
2
a
, 3, 5 (Additional Web Exercises)


In
this chapter, we want to look at how to compute efficiently the number
, which
, is the number of integers betwe
en 1 and
m

that are relatively prime to
m
. That is,




We would like to have a method of computing

when
m

is larger. The next theorems
describe some efficient ways of doing this.


Theorem

1
:
If
p

is a prime n
umber, then
.


Proof:



























Example 1
:
Compute

and
.


Solution:




























2

Theorem 2
:
If
p

is a prime number, then
.


Proof:
The only divisors of

are 1 and the powers of
p

less than
k
, that is

for
. Let
a
be an integer where
. If
, then

must have a
factor of
, that is
. Thus, a number
a

is not relatively prime (

when
. Th
us




If
, then

for some integer
k
. The multiples of
p

between 1 and

are


,


which is

multiples of
p
. Hence,

and thus

.
















Example 2
:
Compute
.


Solution:





















We next state
and prove a lemma that will be useful in a later result.



3

Lemma:
For integers
a, m,

and
n,


if and only if

and
.


Proof:

Assume

and suppose
. Then

and
.
Hence
. This contradicts the fa
ct that
. A similar argument can be
made if we assume
.

Thus

and



Now assume

and

and suppo
se
. Then

and
. By the Fundamental Theorem of Arithmetic,
d

must have a prime divisor
p

where
. Thus,

and
. By the p
rime divisibility property, that says that

or
. If
, since

this contradicts the fact that
. Similarly, if
, since

this contradicts the fact that
.
In either case, we have a
contradiction and hence
.

















For example, if
a

= 5,
m =
6, and
c

= 7, the lemma implies




W
e next use the previous lemma to prove a fundamental result.


Theorem 3
:
For two positive integers
m

and
n
, if the
, then
.


Proof:
We rearrange the integers between 1 and
mn

into an

array with
n

rows and
m

columns.




By Lemma 5,




Consider the

column of the array. Each entry in the

column when paired with
m
,
has the same greatest common
divisor.









Continued on Next Page



4

That is, if
,

(This can be seen by
calculating both using the first step of the Euclidean Algorithm). Since all elements in
each column have the same greatest common

divisor,

of the columns will have the
elements in the array that are relatively prime to
m
.


Now, consider the

columns. We must now show that each of these columns has

elements relat
ively prime to
n
, thus giving a total of

total elements
relatively prime to both
m

and
n
and hence

by the previous lemma. Consider the

column




Claim: In modu
lo
n

arithmetic, all entries in this column are just a rearrangement of
, that is, each entry in the column is in a the same distinct congruence class
as one of the integers
. For if not, there would exist inte
gers

such that




This implies that




Since by the Theorem assumption,
, this implies that

which is
impossible since
. Hence, since the

column elements

and

are the same elements with respect to
congruence in modulo
n

arithmetic and there are

elements relatively prime to
n

i
n list
, there are

elements in the

column

relatively prime to
n
. Thus there are

columns in the array containing the elements
relatively p
rime to
n
, and in each of these

columns

entries relatively prime to
n
.
This gives a total of

total elements that are relatively prime to both
m

and
n.

Since, by the previous lemma, the
se are the same elements relatively prime to
, we have
the result

















5

Example 3
:
Compute
.


Solution:





















Theorem 4
:
If
m

has the
prime factorization
, then


.


Proof:
We can prove this result using mathematical induction. For the trivial case, that is,
if
, then using Theorem 13.6 we have


.


Now, assume the result is true if
m

is a product of
r

primes. We want to show the result is
true if
m

is a product of
r
+ 1 primes. Suppose
. Noting that
we have



Hence, by the princi
ple of mathematical induction, the result holds.

















Corollary 1
:
If
p

and
q

are primes where
, then
.


Proof:



















6

Example 4
:
Compute
.


Solution:























Example
5
:
Compute
.


Solution:




























Example 6
:
Compute
.


Solution:





























7

Euler Phi Function w
ith Maple


Note that the
numtheory
package must be loaded to the home directory using the
with

statement before the
phi
command can be used.


> with(numtheory):


Compute
.

> phi(35);



Compute
.

> phi(360);




Compute
.

> phi(1575);







8

Chinese Remainder Theorem


Theorem 5:
Chinese Remainder Theorem.

The system of linear congruences



*


where

(Moduli are pairwise relatively prime
) can be solved for an integer
x

modulus
. Moreover, if
y

is another solution to these congruences, then
.


Proof:
Let

for
.





Then

(Proof Exercise).

By the Linear Congruence Theorem, there exists
an integer

where



(Note

is the multiplicative inverse of

mod


Al
so,

whenever
. (Proof Exercise)


Let


Claim that
x

satisfies every linear congruence. To show, that the
j
th

arbitrary congruence
with modulus
. Then











Continued on Next Page


9

To show there are no other incongruent solutions, suppose
y

is another solution to *. Then
for all
,
. Since
, it follows that




Thus,
. Since

when
, then it follows that




Hence,

and
. This complete
s the proof.


















Chinese Remainder Theorem Summary


To solve t
he system of linear congruences





We compute



where





each

comes from the right had side of the given c
ongruences



,




for
,





is the multiplicative inverse of

mod
, that is,

solves the congruence







for
.


10

Example 7:
Use the Chinese Remainder Theorem to solve
the system of congruences


,
,


Solution:











































11



































12




13

Using the Chinese Remainder Theorem in Maple



To solve
,
,


> chrem( [2, 4, 6], [3, 5, 19] );