+ All Categories
Home > Documents > CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH...

CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH...

Date post: 24-Dec-2015
Category:
Upload: darcy-anderson
View: 225 times
Download: 4 times
Share this document with a friend
Popular Tags:
26
CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK
Transcript
Page 1: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

CHAPTER 2NUMBER THEORY,

NUMBER SYSTEM & COMPUTER

ARITHMETIC, CRYPTOGRAPHY

BY MISS FARAH ADIBAH ADNANIMK

Page 2: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

CHAPTER OUTLINE - I

• 2.1 INTRODUCTION TO NUMBER THEORY2.1.1 DIVISIBILITY

• PRIME NUMBERS • FACTORIZATION

2.1.2 GREATEST COMMON DIVISOR (GCD)• EUCLIDEAN ALGORITHM

2.1.3 MODULAR ARITHMETIC

• 2.2 NUMBER SYSTEM & COMPUTER ARITHMETIC• 2.3 CRYPTOGRAPHY

Page 3: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

2.1 INTRODUCTION TO NUMBER THEORY • The theory of number is part of discrete

mathematics and involving the integers and their properties.

• The concept of division of integers is fundamental to computer arithmetic.

• This chapter involves algorithms – used to solves many problems; searching a list, sorting finding the shortest path, find greatest common divisor, etc.

Page 4: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

2.1.1 DIVISIBILITY• Number theory is concerned with the properties

of integers.

• One of the most important is divisibility.

Definition 2.1

Let and be integers with We say that

divides if there is an integer such that

This is denoted by Another way to

express this is that

is a multiple of .

a b .0a

a b k

.akb .| ba

and offactor a is ba b

a

Page 5: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

EXAMPLE 2.1Determine whether they are divisible or not.

a) .

b) .

c) .

15|3

60|1518|7

Page 6: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

Basic Properties of Divisibility

Let represent integers. Then

i. .

ii..

iii..

cba ,,

. then , and | If cbacaba

. integers allfor ,b then | If ccaba

.c then , and | If acbba

Page 7: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

2.1.1.1 PRIME NUMBERSDefinition 2.2

A number that is divisible only by 1 and itself is called prime number. An integer that is not prime is called composite, which means that must expressible as a product of integers with

1n

n ab.1 nab

1p

Page 8: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

EXAMPLE 2.2Determine each number is prime number or not.

a)7

b)9

Page 9: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

  2 3 5 7 11 13 17 19 23

29 31 37 41 43 47 53 59 61 67

71 73 79 83 89 97 101 103 107 109

113 127 131 137 139 149 151 157 163 167

173 179 181 191 193 197 199 211 223 227

229 233 239 241 251 257 263 269 271 277

281 283 293 307 311 313 317 331 337 347

349 353 359 367 373 379 383 389 397 401

409 419 421 431 433 439 443 449 457 461

463 467 479 487 491 499 503 509 521 523

541 547 557 563 569 571 577 587 593 599

601 607 613 617 619 631 641 643 647 653

659 661 673 677 683 691 701 709 719 727

733 739 743 751 757 761 769 773 787 797

809 811 821 823 827 829 839 853 857 859

863 877 881 883 887 907 911 919 929 937

941 947 953 967 971 977 983 991 997  

The first 1000 primes are listed below.

Page 10: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

2.1.1.2 FACTORIZATION

• Theorem 2.1: The Fundamental Theorem of Arithmetic

• Any integer is a product of primes uniquely, up to the order of primes. It can be factored in a unique way as:

where are prime numbers and

1a

ttpppa ...21

21

tppp ...21

0i

Page 11: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

EXAMPLE 2.3Find prime factorizations of:

a)91

b)11011

Page 12: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

Definition 2.3

• The greatest common divisor of and is the largest positive integer dividing both and and is denoted by either . When

, we say and are relatively primes.

2.1.2 GREATEST COMMON DIVISOR (GCD)

a ba b

ba, gcda b 1, gcd ba

Page 13: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

Steps to Find the Gcd• If you can factor and into primes, do so.

For each prime number, look at the powers that it appears in the factorizations of and . Take the smaller of the two. Put these prime powers together to get the gcd. This is easiest understand by examples:

gcd (576,135) =

a b

a b

,32576 i) 26

,53135 323 9

Page 14: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

ii) gcd

Note that if prime does not appear in factorization, then it cannot appear in the gcd.

• Suppose and are large numbers, so it might not be easy to factor them. The gcd can be calculated by a procedure known as the Euclidean algorithm. It goes back to what everyone learned in grade school: division with remainder.

,732( 245 .2872)7532,752 200235

Steps to Find the Gcd

Page 15: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

• Suppose that is greater than . If not, switch

and . The first step is divide the larger of the two integers by the smaller; let is larger than , hence represent in the form

Where is called the dividend, is called the divisor, is called the quotient, and is called the remainder.

2.1.2.1 THE EUCLIDEAN ALGORITHM

a b

a b

ab a

11 rbqa a b

1q 1r

Page 16: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

• If then continue by representing in

the form

• Continue this way until the remainder that is

zero.

2.1.2.1 THE EUCLIDEAN ALGORITHM

,01 r b

.22 rbqb

Page 17: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

• The following sequence of steps:

•Hence, the greatest common divisor is the last nonzero remainder in the sequence of divisions

krba ),gcd(

0 ar . 1 br • Let and

Page 18: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

• There are two important aspects to this algorithm:

It does not require factorization of the

numbers. It is fast.

Page 19: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

EXAMPLE 2.4Compute . 1180,482gcd

Page 20: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

• Sometimes we care about the remainder of an integer when it is divided by some specified positive integer.

Definition 2.4

Let be a fixed positive integer. For any integer

, is the remainder upon dividing by

.

Eg:

2.1.3 MODULAR ARITHMETIC

a

n

ana mod

n

8 mod 3 2

Page 21: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

• One of the most basic and useful in number theory is modular arithmetic, or known as congruence.

Definition 2.5

If and are integers and is a positive integer, then and are said to be congruent modulo if . This is written

.

2.1.3 MODULAR ARITHMETIC

a b na b

) mod () mod ( nbna ) mod( nba

Page 22: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

a) Determine whether 32 is congruent to 7 modulo 5.

EXAMPLE 2.5

Page 23: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

2.1.3.1 PROPERTIES OF MODULO OPERATOR.

To demonstrate the first point, if then

for some So we can write

)( if mod bannba

nbanbna mod implies )mod() mod (

nabnba mod implies mod ncancbnba mod implies mod implies mod

ban knba )(

.k .knba

Page 24: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

a) .

b) .

EXAMPLE 2.6)5(mod823 )8(mod511

Page 25: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

2.1.3.2 MODULAR ARITHMETIC OPERATIONS.

Page 26: CHAPTER 2 NUMBER THEORY, NUMBER SYSTEM & COMPUTER ARITHMETIC, CRYPTOGRAPHY BY MISS FARAH ADIBAH ADNAN IMK.

• Given . Prove the properties above.

EXAMPLE 2.778mod15 and 38mod11


Recommended