Chapter 5   Introduction to Number Theory


그림입니다.
원본 그림의 이름: CLP000113980010.bmp
원본 그림의 크기: 가로 783pixel, 세로 303pixel

                             그림입니다.
원본 그림의 이름: CLP000113980011.bmp
원본 그림의 크기: 가로 225pixel, 세로 182pixel

[References]

1. Discrete Math - 7th Edition , Richard Johnsonbaugh, Pearson



5   Introduction to Number Theory



5.1 Divisors


5.2 Representations of Integers and Integer Algorithms


5.3 The Euclidean Algorithm


5.4 The RSA Public-Key Cryptosystem (Skipped)



5.1 Divisors


 Definition  1.1

 

  , .

         divides .

    is divisor or factor,   is the quotient.

 

    divides        is divisor or factor of .

    divides        .

    does not divide        .



Example  1.2

 

 Since         divides        .

 The quotient is .  We call  a divisor or factor of .

 

 

그림입니다.
원본 그림의 이름: CLP00005554153e.bmp
원본 그림의 크기: 가로 451pixel, 세로 158pixel

  and        .

        where 







 Theorem 1.3

 

 Let ,  and .

  (a)  and        .

  (b)  and        .

  (c)        .

 

Proof

그림입니다.
원본 그림의 이름: CLP000055540001.bmp
원본 그림의 크기: 가로 593pixel, 세로 95pixel   그림입니다.
원본 그림의 이름: CLP000113980012.bmp
원본 그림의 크기: 가로 23pixel, 세로 22pixel

 

Definition  1.4

 

 is prime       if  then either  and  or  and .

 is composite     is not a prime 

                  (   such that  and  and . )

 

 


 Example  1.5

 

  only divisors are itself and        is prime.

  and  divide        is composite.

       *  and  are neither prime nor composite. 

Theorem  1.7

 

,  is composite      has a divisor  satisfying .

 

 

그림입니다.
원본 그림의 이름: CLP000055540002.bmp
원본 그림의 크기: 가로 691pixel, 세로 213pixel

 

그림입니다.
원본 그림의 이름: CLP000055540003.bmp
원본 그림의 크기: 가로 727pixel, 세로 70pixel

 

그림입니다.
원본 그림의 이름: CLP000055540004.bmp
원본 그림의 크기: 가로 719pixel, 세로 131pixel




 Algorithm  1.8

Testing Whether an Integer Is Prime

This algorithm determines whether the integer  is prime.

If  is prime, the algorithm returns .

If  is composite, the algorithm returns a divisor  satisfying .

 To test whether  divides , the algorithm checks whether the remainder when  is  divided by   is zero.

        Input : 

      Output : 

   

     

        

          

     

     

Example  1.9

 

To determine whether  is prime, Algorithm 1.8 checks whether any of

divides . Since none of these numbers divides , the condition

is always false. Therefore, the algorithm returns  to indicate that  is prime.




Fundamental Theorem of Arithmetic or the unique factorization theorem.

Except for the order of the prime factors, the prime factors are unique.


그림입니다.
원본 그림의 이름: CLP000055540005.bmp
원본 그림의 크기: 가로 416pixel, 세로 40pixel

 


Theorem  1.11

Fundamental Theorem of Arithmetic

그림입니다.
원본 그림의 이름: CLP000113980014.bmp
원본 그림의 크기: 가로 797pixel, 세로 341pixel 

 

 


 Theorem  1.12

 

   There are infinitely many prime numbers.

 

Proof

그림입니다.
원본 그림의 이름: CLP000055540006.bmp
원본 그림의 크기: 가로 716pixel, 세로 192pixel 그림입니다.
원본 그림의 이름: CLP000113980012.bmp
원본 그림의 크기: 가로 23pixel, 세로 22pixel  

 

   그림입니다.
원본 그림의 이름: CLP000055540007.bmp
원본 그림의 크기: 가로 635pixel, 세로 137pixel  

 

    

Definition  1.14

 

그림입니다.
원본 그림의 이름: CLP000113980015.bmp
원본 그림의 크기: 가로 804pixel, 세로 151pixel

 


Example  1.15

 

그림입니다.
원본 그림의 이름: CLP000113980016.bmp
원본 그림의 크기: 가로 572pixel, 세로 148pixel

그림입니다.
원본 그림의 이름: CLP000113980017.bmp
원본 그림의 크기: 가로 763pixel, 세로 115pixel

 

그림입니다.
원본 그림의 이름: CLP000055540008.bmp
원본 그림의 크기: 가로 559pixel, 세로 101pixel

 Example  1.16

 

Find 

 Using prime factorization

  is a common divisors of  and .

  is the greatest  common divisors of  and .   그림입니다.
원본 그림의 이름: CLP000113980012.bmp
원본 그림의 크기: 가로 23pixel, 세로 22pixel

 







 COROLLARY

 

 If ,  and  are integers, where , such that  and , then  whenever  and  are integers.

 


 Transitivity of Divisibility

 

Prove that for all integers ,  and , if  and  then .

 

Proof

Show that       

        for some integer .

        for some integer .

      .    그림입니다.
원본 그림의 이름: CLP000113980012.bmp
원본 그림의 크기: 가로 23pixel, 세로 22pixel

 

Theorem  1.17

 

The prime factorizations of the positive integers  and  are

,

.

 where each exponent is a nonnegative integer, and where all primes occurring in the    prime factorization of either  and  are included in both factorizations, with zero      exponents if necessary.

 Then  is

.

 


 Example  1.18

 

그림입니다.
원본 그림의 이름: CLP000113980018.bmp
원본 그림의 크기: 가로 536pixel, 세로 70pixel

그림입니다.
원본 그림의 이름: CLP000113980019.bmp
원본 그림의 크기: 가로 801pixel, 세로 221pixel

 

그림입니다.
원본 그림의 이름: CLP000055540009.bmp
원본 그림의 크기: 가로 368pixel, 세로 101pixel




Definition  1.19

 

그림입니다.
원본 그림의 이름: CLP00011398001a.bmp
원본 그림의 크기: 가로 802pixel, 세로 139pixel

 


Example  1.20

 

  is divisible by both  and .

 

 


Example  1.21

 

그림입니다.
원본 그림의 이름: CLP00011398001b.bmp
원본 그림의 크기: 가로 802pixel, 세로 272pixel

 

그림입니다.
원본 그림의 이름: CLP00005554000a.bmp
원본 그림의 크기: 가로 638pixel, 세로 105pixel




Theorem  1.22

 

그림입니다.
원본 그림의 이름: CLP00011398001c.bmp
원본 그림의 크기: 가로 796pixel, 세로 280pixel

 


Example  1.23

 

그림입니다.
원본 그림의 이름: CLP00011398001d.bmp
원본 그림의 크기: 가로 800pixel, 세로 306pixel

 

그림입니다.
원본 그림의 이름: CLP00005554000b.bmp
원본 그림의 크기: 가로 656pixel, 세로 69pixel




Example  1.24

 

 

 

 

 

Theorem  1.25

 

그림입니다.
원본 그림의 이름: CLP00011398001e.bmp
원본 그림의 크기: 가로 796pixel, 세로 289pixel

 


그림입니다.
원본 그림의 이름: CLP00005554000c.bmp
원본 그림의 크기: 가로 629pixel, 세로 183pixel그림입니다.
원본 그림의 이름: CLP000113980012.bmp
원본 그림의 크기: 가로 23pixel, 세로 22pixel


 

Exercises  11, 24, 29, 31




5.2 Representations of Integers and Integer Algorithms

 


bit is a binary digit. A bit has a  and a .


The binary Number System consists of   symbols(bit).

The octal Number System consists of  symbols.

The decimal Number System consists of  symbols.

The hexadecimal Number System consists of  symbols.



The system is based the base of the number system.



Decimal Number System

               그림입니다.
원본 그림의 이름: CLP00011398001f.bmp
원본 그림의 크기: 가로 542pixel, 세로 303pixel

그림입니다.
원본 그림의 이름: CLP00005554000d.bmp
원본 그림의 크기: 가로 1014pixel, 세로 138pixel

 


Integer form is

      based 

where  and each  is one of the decimal digits ,.


Place

place

place

place

place

Decimal Digit

Symbol

 

The decimal number system.

Binary Number System


Integer form is

      based 


where each  and each  is one of the binary digits .

그림입니다.
원본 그림의 이름: CLP00005554000e.bmp
원본 그림의 크기: 가로 768pixel, 세로 125pixel


             그림입니다.
원본 그림의 이름: CLP000113980020.bmp
원본 그림의 크기: 가로 581pixel, 세로 412pixel


Place

place

place

place

place

place

Decimal Digit

Symbol

 

 

The binary number system.

Example  2.1  Computer Representation of Integers

Example  2.1

 Computer Representation of Integers

   express form

,      base  expansion of 

where  are non-negative integers less than , and .

 

The base  expansion of  is denoted by .

 


Example  2.2

Binary to Decimal

 그림입니다.
원본 그림의 이름: CLP000113980021.bmp
원본 그림의 크기: 가로 802pixel, 세로 277pixel




Algorithm  2.3

 Converting an Integer from Base  to Decimal

This algorithm returns the decimal value of the base  integer .

      Input:  

    Output:  dec_val

    base_b_to_dec (

       dec_val 

       power 

       for  to  

          dec_val  dec_val *power

          power  power * 

    

    return dec_val

 

Algorithm  runs is time .

 

 Example  2.4

 

We show how Algorithm  converts the binary number  to decimal.

 

 

Solution

Here  and

,   ,   ,   .

First,  is set to , and power is set to .

We then enter the for loop.

Since  and ,

 * *.

Thus  becomes . Executing

 * 

sets  to . We return to the top of the for loop.

Since  and ,

 * *.

Thus  becomes . Executing

 * 

sets  to .

We return to the top of the for loop.

Since  and ,

 * *.

Thus  becomes . Executing

 * 

sets  to .

We return to the top of the for loop.

Since  and ,

 * *.

Thus  becomes . Executing

 * 

sets  to .

The for loop terminates and the algorithm returns , the decimal value of the binary number .                                                그림입니다.
원본 그림의 이름: CLP000113980012.bmp
원본 그림의 크기: 가로 23pixel, 세로 22pixel




● Octal number system


Integer form is

      based 

where  and each  is one of the octal digits ,.


Place

place

place

place

place

Decimal Digit

Symbol

 

The octal number system.



● Hexadecimal number system

               그림입니다.
원본 그림의 이름: CLP000113980022.bmp
원본 그림의 크기: 가로 483pixel, 세로 303pixel

Integer form is

      based 

where  and each  is one of the hexadecimal digits ,,  ,  ,  ,  ,  .

Place

place

place

place

place

place

Decimal Digit

Symbol

 

The hexadecimal number system.



 Example  2.5

Hexadecimal to Decimal

그림입니다.
원본 그림의 이름: CLP000113980023.bmp
원본 그림의 크기: 가로 801pixel, 세로 137pixel

 


Example  2.6

Decimal to Binary

그림입니다.
원본 그림의 이름: CLP000113980024.bmp
원본 그림의 크기: 가로 805pixel, 세로 473pixel

 



 

Algorithm  2.7

Converting a Decimal Integer into Base 

 This algorithm convert the positive integer  into the base  integer .    The variable  is used as an index in the sequence .

 The value of   is the remainder when  is divided by .

 The value of  is the quotient when  is divided by .

      Input:  

    Output:  

    dec_to_base_b(

       

       while ()

          

          

          

      

    




Example  2.9

 Decimal to Hexadecimal

그림입니다.
원본 그림의 이름: CLP000113980025.bmp
원본 그림의 크기: 가로 802pixel, 세로 294pixel

그림입니다.
원본 그림의 이름: CLP000113980026.bmp
원본 그림의 크기: 가로 803pixel, 세로 99pixel

 


 Addition Binary Number,       Binary addition table

 

                        

       

       

      

 



Example  2.10

 Binary Addition

 Add the binary numbers  and .

 

Solution

                                         

                                        

                                        

We begin from the right, adding  and . This sum is .

We write  and carry . At this point the computation is

                                           

                                         

                                        

                                            

Next, we add  and  and . This sum is .

We write  and carry . At this point the computation is

                                          

                                         

                                        

                                                                                      

Continuing in this way, we obtain

                                         

                                        

                                                  그림입니다.
원본 그림의 이름: CLP000113980012.bmp
원본 그림의 크기: 가로 23pixel, 세로 22pixel



 

 Algorithm  2.12

Adding Binary Numbers

 This algorithm add the binary numbers  and  and stores the sum in .

      Input:  , , 

    Output:  

    binary_addition(, , , ) 

       carry 

       for  to  

          

          

      

       

   







Example  2.13

 Hexadecimal Addition

 Add the hexadecimal numbers  and .

 

Solution

     

                                       

                                      

We begin from the right, adding  and . This sum is .

We write . At this point the computation is

     

                                       

                                              

Next, we add  and . This sum is .

We write  and carry . At this point the computation is

                                             

     

                                       

                                             

Continuing in this way, we obtain

     

                                       

                                                    


The straightforward way to compute this power is to repeatedly multiply by 

’s

which uses  multiplications. We can do better using repeated squaring



Compute .

          uses  multiplication

         uses  addition multiplication

         uses  addition multiplication

         uses  addition multiplication

         uses  addition multiplication

The expansion of  is power of , that is the binary expansion, is

.

We can compute  as

which  additional multiplications for a total of  multiplications.

The straightforward technique uses  multiplication.  그림입니다.
원본 그림의 이름: CLP000113980012.bmp
원본 그림의 크기: 가로 23pixel, 세로 22pixel


Example  2.15

Binary representation of the exponent

그림입니다.
원본 그림의 이름: CLP000113980027.bmp
원본 그림의 크기: 가로 800pixel, 세로 107pixel

그림입니다.
원본 그림의 이름: CLP000113980028.bmp
원본 그림의 크기: 가로 799pixel, 세로 52pixel

그림입니다.
원본 그림의 이름: CLP000113980029.bmp
원본 그림의 크기: 가로 602pixel, 세로 260pixel

 

                         For example 


Theorem  2.17

 

그림입니다.
원본 그림의 이름: CLP00011398002a.bmp
원본 그림의 크기: 가로 754pixel, 세로 482pixel

 

 

      그림입니다.
원본 그림의 이름: CLP00005554000f.bmp
원본 그림의 크기: 가로 449pixel, 세로 171pixel


 

     그림입니다.
원본 그림의 이름: CLP000055540010.bmp
원본 그림의 크기: 가로 883pixel, 세로 467pixel

 Example  2.18

 

 그림입니다.
원본 그림의 이름: CLP00011398002b.bmp
원본 그림의 크기: 가로 721pixel, 세로 196pixel

그림입니다.
원본 그림의 이름: CLP00011398002c.bmp
원본 그림의 크기: 가로 766pixel, 세로 246pixel

          

 

    Exercises  31, 38, 56, 59

 

 

5.3   The Euclidean Algorithm


그림입니다.
원본 그림의 이름: CLP000055540011.bmp
원본 그림의 크기: 가로 887pixel, 세로 300pixel

 

Euclidean Algorithm is algorithm for finding the greatest common divisor of two integers.

The Euclidean Algorithm

Let , where  and  are integers. Then .



Example  3.1

 

       divided by .

.

       divided by .

.

 By inspection .

 Therefore,

.

 




Theorem  3.2

 

 If  , and   (), then

.

 

Proof

The common divisors of  and  are the same as the common divisors of  and .

Show that .    We have the same greatest common divisor.

 divides both  and .

 divides .

Any common divisor of  and  is a common divisor of  and .

 divides both  and .

 divides .

Any common divisor of  and  is a common divisor of  and .

Hence, .    그림입니다.
원본 그림의 이름: CLP000113980012.bmp
원본 그림의 크기: 가로 23pixel, 세로 22pixel

 

그림입니다.
원본 그림의 이름: CLP000055540012.bmp
원본 그림의 크기: 가로 852pixel, 세로 273pixel그림입니다.
원본 그림의 이름: CLP000113980012.bmp
원본 그림의 크기: 가로 23pixel, 세로 22pixel

 


 

 Algorithm  3.3

  Euclidean Algorithm

 This algorithm finds the greatest common divisor of the nonnegative integer  and , where not both  and  are zero.

      Input :   and (nonnegative integer, not both zero)

    Output :  Greatest common divisor of  and 

 1.     

 2.       // make a largest

 3.       

 4.        ()

 5.      while

그림입니다.
원본 그림의 이름: CLP000055540013.bmp
원본 그림의 크기: 가로 345pixel, 세로 179pixel 6.          

 7.          

 8.          

 9.      

 10.     return 

 11.   

 



그림입니다.
원본 그림의 이름: CLP000055540014.bmp
원본 그림의 크기: 가로 844pixel, 세로 158pixel




그림입니다.
원본 그림의 이름: CLP000113980013.bmp
원본 그림의 크기: 가로 159pixel, 세로 183pixel  ÉTIENNE BÉZOUT (1730–1783)  Reading the writings of the great mathematician Leonhard Euler enticed him to become a mathematician. In 1758 he was appointed to a position at the Académie des Sciences in Paris. Bézout is also credited with inventing the determinant.



Theorem 3.7

BÉZOUT’'S THEOREM

If  and , then there  such that

.

 

그림입니다.
원본 그림의 이름: CLP000055540015.bmp
원본 그림의 크기: 가로 780pixel, 세로 538pixel

 

Example  3.8

 

 그림입니다.
원본 그림의 이름: CLP00011398002d.bmp
원본 그림의 크기: 가로 804pixel, 세로 278pixel

그림입니다.
원본 그림의 이름: CLP00011398002e.bmp
원본 그림의 크기: 가로 809pixel, 세로 439pixel

그림입니다.
원본 그림의 이름: CLP00011398002f.bmp
원본 그림의 크기: 가로 800pixel, 세로 275pixel

그림입니다.
원본 그림의 이름: CLP000113980030.bmp
원본 그림의 크기: 가로 801pixel, 세로 158pixel

 

 

● Computing  an Inverse Modulo an Integer 

 

그림입니다.
원본 그림의 이름: CLP000055540016.bmp
원본 그림의 크기: 가로 770pixel, 세로 124pixel

For  and  such that .

Find  such that .

 is the inverse of .

 


그림입니다.
원본 그림의 이름: CLP000055540017.bmp
원본 그림의 크기: 가로 874pixel, 세로 154pixel

그림입니다.
원본 그림의 이름: CLP000055540018.bmp
원본 그림의 크기: 가로 876pixel, 세로 460pixel

 

그림입니다.
원본 그림의 이름: CLP00005554001a.bmp
원본 그림의 크기: 가로 849pixel, 세로 230pixel

그림입니다.
원본 그림의 이름: CLP00005554001b.bmp
원본 그림의 크기: 가로 627pixel, 세로 76pixel 그림입니다.
원본 그림의 이름: CLP000113980012.bmp
원본 그림의 크기: 가로 23pixel, 세로 22pixel

 

Example  3.11

 

 Let  and .

  and  where  and .

 Thus,

.

 Here .

 The inverse of  is .

 

 

                Exercises  4, 11, 36

 


5.4 The RSA Public-Key Cryptosystem (Skip)


그림입니다.
원본 그림의 이름: CLP00005554001c.bmp
원본 그림의 크기: 가로 1192pixel, 세로 198pixel


그림입니다.
원본 그림의 이름: CLP00005554001d.bmp
원본 그림의 크기: 가로 1411pixel, 세로 469pixel


그림입니다.
원본 그림의 이름: CLP00005554001e.bmp
원본 그림의 크기: 가로 1405pixel, 세로 496pixel


 

그림입니다.
원본 그림의 이름: CLP00005554001f.bmp
원본 그림의 크기: 가로 505pixel, 세로 76pixel

그림입니다.
원본 그림의 이름: CLP000055540020.bmp
원본 그림의 크기: 가로 1194pixel, 세로 410pixel


그림입니다.
원본 그림의 이름: CLP000113980031.bmp
원본 그림의 크기: 가로 512pixel, 세로 316pixel

그림입니다.
원본 그림의 이름: CLP000055540021.bmp
원본 그림의 크기: 가로 1197pixel, 세로 327pixel

 

 

Q & A

 

 

 

            Exercises  1, 4, 8, 11, 14, 16, 19, 25        [End of Ch. 3]

 

Copyright by SGLee, SKKU  sglee@skku.edu 

http://matrix.skku.ac.kr/sglee/vita/LeeSG.htm




Copyright @ 2018 SKKU Matrix Lab. All rights reserved.
Made by Manager: Prof. Sang-Gu Lee and Dr. Jae Hwa Lee
*This research was supported by Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education (2017R1D1A1B03035865).