Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 29

Lecture 10

C H A PT E R # 0 4 . PAG E N U M B E R 2 7 7 TO 3 0 1
K E N N E T H H . RO S E N
D I S C R E T E M AT H E M AT I C S A N D I TS
A P P L I C ATI O N S _ 7 T H E D I TI O N
The Chinese Remainder Theorem

The Chinese remainder theorem, named after the


Chinese heritage of problems involving systems of
linear congruence's, states that when the moduli of a
system of linear congruence's are pairwise relatively
prime, there is a unique solution of the system
modulo the product of the moduli.
Cont.

Systems of linear congruence's arise in many


contexts. For example, as we will see later, they are
the basis for a method that can be used to perform
arithmetic with large integers. Such systems can
even be found as word puzzles in the writings of
ancient Chinese and Hindu mathematicians, such as
that given in Example 4.
Example 4
Cont.
Example 5

Example 5 illustrates how to use the construction


given in our proof of the Chinese remainder theorem
to solve a system of congruence's.
We will solve the system given in Example 4, arising
in Sun-Tsu’s puzzle.
Cont.
Back Substitution Method

Although the construction in Theorem 2 provides a


general method for solving systems of linear
congruence's with pairwise relatively prime moduli,
it can be easier to solve a system using a different
method.
Example 6 illustrates the use of a method known as
back substitution.
Example 6
Applications of Congruence's

Congruence's have many applications to discrete


mathematics, computer science, and many other
disciplines. We will introduce three applications in
this section: the use of congruence's to assign
memory locations to computer files, the generation
of pseudorandom numbers, and check digits.
Cont.

Suppose that a customer identification number is ten


digits long. To retrieve customer files quickly, we do
not want to assign a memory location to a customer
record using the ten-digit identification number.
Instead, we want to use a smaller integer associated
to the identification number. This can be done using
what is known as a hashing function.
Hashing Functions

The central computer at an insurance company


maintains records for each of its customers.
How can memory locations be assigned so that customer
records can be retrieved quickly? The solution to this
problem is to use a suitably chosen hashing function.
Records are identified using a key, which uniquely
identifies each customer’s records. For instance,
customer records are often identified using the Social
Security number of the customer as the key. A hashing
function h assigns memory location h(k) to the record
that has k as its key.
Cont.

In practice, many different hashing functions are used.


One of the most common is the function h(k) = k mod
m, where m is the number of available memory locations.
Hashing functions should be easily evaluated so that files
can be quickly located. The hashing function h(k) = k
mod m meets this requirement; to find h(k), we need
only compute the remainder when k is divided by m.
Furthermore, the hashing function should be onto, so
that all memory locations are possible.
The function h(k) = k mod m also satisfies this property.
Example 1
Cont.

Because a hashing function is not one-to-one


(because there are more possible keys than memory
locations), more than one file may be assigned to a
memory location.
When this happens, we say that a collision occurs.
One way to resolve a collision is to assign the first
free location following the occupied memory location
assigned by the hashing function.
Example 2
Cryptography

Number theory plays a key role in cryptography, the


subject of transforming information so that it cannot
be easily recovered without special knowledge.
Number theory is the basis of many classical ciphers,
first used thousands of years ago, and used
extensively until the 20th century.
These ciphers encrypt messages by changing each
letter to a different letter, or each block of letters to a
different block of letters.
Cont.

Number theory is also important in public key


cryptography, a type of cryptography invented in the
1970s. In public key cryptography, knowing how to
encrypt does not also tell someone how to decrypt.
The most widely used public key system, called the
RSA cryptosystem, encrypts messages using modular
exponentiation, where the modulus is the product of
two large primes.
Classical Cryptography

One of the earliest known uses of cryptography was


by Julius Caesar. He made messages secret by
shifting each letter three letters forward in the
alphabet (sending the last three letters of the
alphabet to the first three). For instance, using this
scheme the letter B is sent to E and the letter X is
sent to A.
This is an example of encryption, that is, the
process of making a message secret.
Cont.
Example 1
Example 2
Example 3
Public Key Cryptography
The RSA Cryptosystem

In 1976, three researchers at the Massachusetts


Institute of Technology—Ronald Rivest, Adi Shamir,
and Leonard Adleman—introduced to the world a
public key cryptosystem, known as the RSA
system, from the initials of its inventors.
RSA Encryption

Example 8 illustrates how RSA encryption is


performed. For practical reasons we use small
primes p and q in this example, rather than primes
with 200 or more digits. Although the cipher
described in this example is not secure, it does
illustrate the techniques used in the RSA cipher.
Example 8
RSA Decryption

Example 9 illustrates how to decrypt messages sent


using the RSA cryptosystem.
Example 9

You might also like