Escolar Documentos
Profissional Documentos
Cultura Documentos
Theme 1: Division
Given two integers, say
but
). Number theory concerns the former case, and discovers criteria upon which one can
such that
and we write
This simple denition leads to many properties of divisibility. For example, let us establish the following lemma. Lemma 1 If and , then
.
Proof. We give a direct proof. From the denition of divisibility and the hypotheses we know that there are integers and such that
Hence
Exercise 5A: Prove the following two facts: 1. If 2. If , then and for all integers . , then .
We already noted that an integer may be or not divisible by another integer. However, when dividing one number by another there is always a quotient and a remainder. More precisely, if are positive integers then there is a unique and such that and
where
values
Theme 2: Primes
Primes numbers occupy very prominent role in number theory. A prime number is an integer greater than that is divisible only by and itself. A number that is not prime is called composite. Example 1: The primes less than are:
How many primes are there? We rst prove that there are innite number of primes. Theorem 1. There are innite number of primes. Proof. We provide a proof by contradiction. Actually, it is due to Euclid and it is more than 2000 years old. Let us assume that there is a nite number of primes, say, Construct another number
where is the
largest prime (there is the largest prime since we assumed there are only nitely many of them).
which is a product of all primes plus one. First, observe that none of the primes
can divide , since the remainder of dividing by any of the primes is equal to . Since every number, including , is divisible by at least two numbers, and itself, there must be another prime, possible itself, that is not among the primes
problem that was solved only in the last century. Basically, there are approximately about primes smaller than . For example, there are primes smaller than , and as the Fundamental Theorem of Arithmetics and we will prove it below. Example 2: Observe that
.
Primes are important since every integer can be represented as a product of primes. This is known
Theorem 2. [Fundamental Theorem of Arithmetics ] Every positive integer can be written uniquely as the product of primes where the prime factors are written in order of increasing size, that is, if is a natural numbers and
where
Proof. We give an indirect proof. Let us assume that there are two different prime factorizations of
, say
where
We rst prove that
, then can not divide any of the primes (we say ). Indeed, since and are primes, none of them equal, then they must be relatively prime. But, then cannot divide which is nonsense since . Thus, we must conclude that . Now we prove that that we just established above. Again, assume provided contrary that . Then after dividing everything by we obtain , say ,
But then the right-hand side of the above is divisible by while the left-hand side is not, which is impossible since there is an equality sign between the left-hand side and the right-hand side of the above. This completes the proof. How to nd out whether an integer is a prime or not? Unfortunately, there is no fast way of doing it (i.e., there is no efcient algorithm), but one can use some properties of primes and composite numbers to speed up the process. Here is one useful result. Lemma 2.If is a composite integer, then has a prime divisor less than or equal to Proof. Since is a composite integer, it must have a factor where
is an integer. Let us now assume contrary that
such that
, that is,
We can use this lemma, in its contrapositive form, to decide whether is a prime or not. Indeed. the above lemma is equivalent to: if has no prime divisor less than or equal to prime number. 3
, then is a
Example 3: Let us show that is a prime number. If would be composite, then it has had prime divisor smaller than
thus it must be a prime number. There were several attempts to nd a systematic way of computing prime numbers. Euclid suggested that -st prime can be computed recursively as follows:
This is an example of a recurrence that we already encountered in the previous module. All numbers computed so far are primes. But, unfortunately,
is not a prime. In the seventeenth century, a French mathematician Marin Marsenne suggested that prime provided is prime. Unfortunately,
is
From now on we shall work under the assumption that there is no easy, simple and fast algorithm to compute prime numbers.
. Formally:
and
Example 4: What is the greatest common divisor of and . One way of nding it is to list all divisors of and and pick up the largest common to both lists. For example, divisors of divisors of
Thus
Thus
where is the minimum of and . Indeed, take the last example to see that
Exercise 5B: Let us dene the least common multiple of and as the smallest positive integer that is divisible by both and . It is denoted as (e.g., any positive integers and
). Prove that for
We need some more denitions. Two integers, say and , may be composite but the only common divisor of both is . In such a case we say that and are relatively prime. More generally:
Unlike nding primes, there is an efcient algorithm (a procedure) that nds the greatest common divisor. We start with an example. Example 5: Find
. We rst divide by to nd
Observe that any divisor of and must also be a divisor of divisor of and so must be a divisor of and such that
. (Indeed, if
and
, hence
is a divisor of and ,
to get
, and vice versa. This means that
But
hence nally
From the last example, we should conclude that the greatest common divisor of and
is the same as the greatest common divisor of and the remainder of the division of by (i.e.,
, where is an integer and ). Indeed, if is a divisor of and , then it must also divides , and vice versa if divides and , then it divides .
Therefore,
where
. This is called modular arithmetic and we will be devoted the next section it. For now, we just use the fact that the remainder can be also written as . Then the last
equation, can be expressed as
(1)
From the example above, we conclude that we can use (1) successively until we reach In summary, we design the following algorithm that computes A LGORITHM: The Euclidean Algorithm 6
while
end
do
.
. According to the Euclidean algorithm we proceed as follows:
Example 6: Find
(ii) Let and be integers and a positive integer. We say that is congruent to modulo
Example 7: We have
if and only if
We also have
. Is
Theorem 3. Let
and
. Then
(2) (3)
Proof. Since
and
Therefore
and
. Then
and
From Theorem 3 we conclude that
. Then
(4) (5)
Identities (4)(5) are useful when one needs to compute modulo over large numbers or products of large numbers. For example, let
and
is a huge number. But let us use (5). We rst represent the exponent as
We now compute
Theme 5: Applications
We shall discuss here some applications of numbers theory, namely, hashing, pseudo random generators, and cryptosystems based on modular arithmetic.
Hashing
Often one needs a fast methods of locating a given record in a huge set of records. Hashing is a possible solution. It works as follows. Every record has a key, , which uniquely identies it. A hashing function maps the set of keys into the available memory locations. In practice, the most common hashing function is
Observe that hashing is not one-to-one function, hence some records may be hashed into the same location. For example,
Thus two records are mapped into the location . Since this location was already occupied by the previous record, the new collided record is moved to the next empty location modulo our case, it is at memory location .
. In
, and
course, this is not good for random generations, and one must select very carefully the parameters , and (which should be large) to obtain a long sequence without a repetition. The following result is known. Theorem 4. [T. Hull and A. Dobel, 1962]The linear congruential generator has a full period (i.e., there is no repetition in the rst generations) if and only if the following three conditions hold: (i) Both and are relatively prime, that is,
.
(ii) If is a prime number that divides , then divides (iii) If divides , then divides
Cryptology
One of the most important application of congruences is in cryptology, which is a study of secret messages. The rst encryption algorithms were very simple. For example, Julius Caesar designed an encryption system by shifting each letter three letters in the alphabet. Mathematically speaking, in this case the encryption function is dened as
The above encryption system is too easy to break. Therefore, in mid-1970 the concept of public key cryptosystem was introduced. In such a system, every person can have a publicly known encryption key to send encrypted message, but only those who have secret key can decrypt the message. We 10
describe below a system known as the RSA encryption system (RSA name is built from the initials of the inventors Rivest, Shamir and Adleman). In the RSA system, the message to be sent is rst transformed into an integer representing it (with some abuse of notation we denote such an integer by ). The RSA is based on modular exponentiation modulo of the product of two large primes, say and . Dene
and
In practice, and have digits each, thus has digits. Dene now an
exponent as
that is,
is relatively prime to
computed as follows
The number is called inverse of modulo . It should be underlined that can be found fast (based on the Euclidean algorithm) only if one knows both primes and , not the product . Then, it can be proved (see below) that
, and one nds since
and
(7)
Example 10: Let us encrypt the message using the RSA with
.
. Thus
,
. . Then (with
Now, to decrypt it, we rst nd the inverse . Using the Euclidean algorithm (and knowing
) we compute that
and
is an inverse of
modulo if
In order to compute the inverse, we must plunge into another aspect of number theory. We claim that for any positive and there exist integers and such that
(8)
We explain how to construct these two numbers on an example. Example 11: Let us use Euclidean algorithm to compute the algorithm as follows:
. We proceed according to
Thus
where
and
. Thus
and
to prove (8) in general terms. Now we can go back to the inverse modulo construction. Let us assume that
Then from the fact just proved we conclude that there must exist integers and such that
This certainly implies that
12
modulo .
(i.e., and are relatively prime), then an inverse of modulo exists and it is equal to in the following representation of
which can be found efciently by the Euclidean algorithm. Example 12: Lets nd the inverse of modulo . Since Euclidean algorithm gives:
, the inverse exists, and the
is equal to .
We need two more results before we can explain the decryption algorithm of RSA. The rst one goes back to ancient Chinese and Hindu mathematicians and it is known as the Chinese Remainder Theorem. Here is the problem: let Find a solution modulo
. . .
We now construct a solution to the above system of congruences. Let us dene for
13
(9)
We claim it is a simultaneous solution of the above system modulo . Indeed, we rst observe that
for
. But
since
congruences. This is called the Chinese Remainder Theorem. Example 13: Solve
We have of
modulo 3,
, and
is an inverse of modulo .
Finally, we quote (without a proof) the Fermat Little Theorem. Theorem 6. [Fermats Little Theorem] If is a prime number and is an integers not divisible by
, then
or equivalently
Now, we are ready to explain the decryption procedure (7) of the RSA algorithm. We recall that is inverse of modulo
, that is,
such that
14
and since
, hence it
as desired.
15
2. Find the prime factorization of . 3. Use the Euclidean algorithm to nd (a) (b)
, .
4. Find an inverse of modulo . 5. Encrypt the message ATTACK using the RSA system with each letter into integers (where did in our Example 10.
,
and
, translating
16
Solutions to Exercises
Solution to Exercise 5A We rst prove that if such that and such that , then and and for all integers . Indeed, since there must be an integer
. This implies
, hence
Now we prove if
, then
. Therefore,
, hence
17