320 likes | 669 Views
The Integers and Division. Number theory is the branch of mathematics involving the integers and their properties. Division
E N D
The Integers and Division • Number theory is the branch of mathematics involving the integers and their properties. • Division • when one integer is divided by a second , nonzero integer ,the quotient may or may not be an integer . For example, 12/3 = 4 is an integer, whereas 11/4 = 2.75 is not. This leads to the following definition. • Definition 1. If a and b are integers with a ≠ 0,we say that a divides b if there is an integer c such that b=ac.When a divides b we say that a is a factor of b and that b is a multiple of a. The notation a∣b denotes that a divides b. We write a|b when a does not divide b.
Example 1. • Determine whether 3 ∣7 and whether 3 ∣12. • Solution:It follows that 3 |7,since 7/3 is not an integer.On the other hand , 3 ∣12 since 12/3=4. • -3d -2d -d 0 d 2d 3d • Figure 1 Integers Divisible by the Positive Integer d.
Example 2 • Let n and d be positive integers. How many positive integers not exceeding n are divisible by d? • Solution :The positive integers divisible by d are all the integers of the form dk,where k is a positive integer.Hence ,the number of positive integers divisible by d that do not exceed n equals the number of integers k with 0<dk≤n,or with 0<k ≤n/d. • Therefore ,there are [n/d]positive integers not exceeding n that are divisible by d.
Theorem 1 • Theorem 1 Let b,and c be integers , Then • 1. If a ∣b and a ∣c,then a ∣(b+c) ; • 2. If a ∣b ,then a ∣bc for all integers c; • 3. If a ∣b and b∣c,then a ∣c. • Proof: Suppose that a ∣b and a ∣c. Then,from the definition of divisibility,it follows that there are integers s and t with b=as and c=at.Hence, • b+c=as + at = a(s+t). • Therefore,a divides b+c. This establishes part (1) of the theorem.The proofs of parts (2)and (3)are left as exercises for the reader.
定理2 设a、b是正整数,则存在整数s、t,满足 • s·a + t · b = gcd(a,b) • s · a+t · b:gcd(a,b)的线性组合表达/ • linear combination • 证明:此结论可以直接从Euclid算法得到。下面通过一个实例一说明s和t的求法。
例2、 求gcd(252,198)的线性组合表达。 • 252=198+54 198=3·54+36 • 54=36+18 36=2 ·18 • 因而gcd(252,198)=18,从上式回去溯得到: • 18=54 – 36 = 54 – (198 – 3·54) • = 4 ·54 – 198 = 4 ·(252 – 198)-198 • =4 ·252 – 5 ·198 因此,t=4, s= -5 • 推论:如果整数a,b互质,则存在s,t 使得s · a+t · b=1
Primes • Primes Every positive integer greater than 1 is divisible by at least two integers,since a positive integer is divisible by 1 and by itself .Integers that have exactly two different positive integer factors are called primes. • Definition 2. A positive integer p greater than 1 is called prime if the only positive factors of p are 1 and p. A positive integer that is greater than 1 and is not prime is called composite.
Example 3 • The integer 7 is prime since its only positive factors are 1 and 7,whereas the integers 9 is composite since it is divisible by 3. • The primes less than 100 are 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,and 97. • The primes are the building blocks of positive integers ,as the Fundamental Theorem of Arithmetic shows. The proof will be given in Section 3.2 .
Theorem 3 • THE FUNDAMENTAL THEOREM OF ARITHMETIC Every positive integer can be written uniquely as the product of primes ,where the prime factors are written in order of increasing size .(Here ,a product can have zero ,one ,or more than one prime factor.)
定理3(算术基本定理)任意一个正整数n(n≠1)可以唯一地表示为若干个质数的乘积。这里唯一的意义表示为不考虑质因子的次序。定理3(算术基本定理)任意一个正整数n(n≠1)可以唯一地表示为若干个质数的乘积。这里唯一的意义表示为不考虑质因子的次序。 • 推论1任意一个正整数n(n≠0,n≠1)可以唯一地表示为 • n = p1 p2 …pk ( k>=1 ) • 这里p1 ,p2, …,pk是质数。 • 推论2(质数分解定理) 任意一个正整数n(n≠0,n≠±1)可以唯一地表示为 • n = p1r1 p2r2 …pkrk • 这里p1<p2<…<pk是质数,r1,r2,…,rk是正整数。
质数的性质 • 定理 2 设p,a,b是整数,且p是质数。 • 如果p| ab ,则有 • p| a 或 p|b • 证明 如果p|a,则 (p,a)=1, 存在整数s,t 使得sp+ta=1 • 从而 spab+tab=b,p整除此式的左边因而整除此式的右边。 • 设p,a1,a2,…,an是整数,且p是质数。 • 推论: 如果p| a1a2…an ,则有 • p| a1 p| a2 … p| an
Example 4 • The prime factorizations of 100,641,999,and 1024 are given by • 100=2·2·5·5=2252, • 641=641 • 999=3·3·3·37=33·37, • 1024=2·2·2·2·2·2·2·2·2·2=210 • It is often important to show that a given integer is prime.For instance,in cryptology large primes are used in some methods for making messages secret.One procedure for showing that an integer is prime is based on the following observation.
The integers and Division • Theorem 3 if n is a composite integer, then n has prime divisor less than or equal to • proof: if n is composite, it must has a factor a with 1<a<n. hence n=ab. We see that 1<a< or • 1<b< , otherwise, ab>n. • Finding the prime factorization of n. Begin by dividing n by successive primes,starting with the
The smallest prime 2 to largest prime • If no prime factor is found, then n is prime, otherwise, if a prime factor p is found, continue by factoring n/p. Note that n/p has no prime factors less than p. Again by dividing n by successive primes, starting with the prime p to largest prime • And so on.
example • Example 6 Find the prime factorization of 7007. • Solution: first perform divisions of 7007 by successive primes,beginning with 2. None of 2,3 and 5 divides 7007. However,7 divides 7, with 7007/7=1001. Next,divide 1001 by successive prime beginning with 7, 7 also divides 1001,since 1001/7 =143 . Continue by dividing 143 by successive prime beginning with 7, 7 does not divide 143, 11 does divide 143,143/11=13, 13 is a prime so • 7007=7×7 ×11 ×13=7 2× 11×13
定理4(欧几里德定理) • 所有质数组成的集合是一个无限集。 • 证明:若质数是有限的,则可将它们按顺序一个不漏地记为 • p1<p2<...<pk, 令n= p1·p2 ·... · pk+1, 则n或者是个质数, 如果n不是质数,则由算术基本定理,则它可以表示成质数的积,它的质因子不可能是p1,p2,...,pk之一,这与p1,p2,...,pk是所有的质数矛盾。
Definition 4 • Let a and b be integers ,not both zero .The largest integer d such that d ∣a and d ∣b is called the greatest common divisor of a and b .The greatest common divisor of a and b is denoted by gcd(a,b). Usually simply denoted by (a,b) • The greatest common divisor of two integers ,not both zero,exists because the set of common divisors of these integers is finite. One way to find the greatest common divisor of two integers is to find all the positive common divisors of both integers and then take the largest divisor.This is done in the following examples.Later,a more efficient method of finding greatest common divisors will be given .
Definition 5 • The integers a and b are relatively prime if their greatest common divisor is 1 • for example 7,12 and 105,106 • But 105 and 45 are not relatively prime • Definition 6 The integers a1,a2,…an are pairwise relatively prime ,if gcd(ai,aj)=1 whenever 1≦i<j ≦n
Gcd(a,b) • Another way to find gcd(a,b) is to use the prime factorizations of a and b. Suppose that the prime factorization of integers a and b,neither eaual to zero, are • Where each exponent is zero or positive integer. • Gcd(a,b)= (2.3.1) • 120=23·3 ·5, 500=22 ·53,=22 · 30 · 53
Gcd(120,500)=2min(3,2)3min(1,0)5min(1,3)=223051=20 • 例 金库内有3根同样粗细的金条,分别长135、243和558(单位英寸)。现在要把它们截成相等的小段,要求小段要最长。问一共可以把这些金条分成几段,每段几英寸。 • 解:135=33 · 5, 243=33,558=2 ·32 ·31 • gcd(135,243,558)=20 ·32 ·50 ·310=9
Definition 7 • The least common multiple of the positive integer a and b is the smallest integer that is divisible by both a and b. it is denoted by lcm(a,b). Simply denote by [a,b] • It is obviously that lcm(a,b) ≦ab. • Example lcm(4,6)=12 • Like gcd(a,b),if have got the prime factorization of a and b, then lcm(a,b) is given by
Lcm(a,b)= (2.3.2) • Theorem 5 Let a and b be positive integers, • Then ab = gcd(a,b) ×lcm(a,b) • Proof: from the formula (2.3.1) and (2.3.2), this conclusion is obvious. • 注:另一种证法: 首先a/(a,b), b/(a,b), 及[a,b]/a, [a,b]/b 都是整数.
由于ab/(a,b)=a·b/(a,b),因此a| ab/(a,b),b| ab/(a,b), 从而ab/(a,b)是a,b的公倍数,而[a,b]是a,b的最小公倍数,故ab/(a,b) ≧[a,b]. 即 • ab≧[a,b] (a,b) . (2.3.3) • 而另一方面,ab/[a,b] | a, ab/[a,b] | b, 说明ab/[a,b]是a和b的公约数, 而(a,b)是a,b的最大公约数, 因此 • (a,b) ≧ab/[a,b],即 • ab≦(a,b)[a,b] (2.3.4)
Modular arithmetic (同余) • Definition 8. Let a be an integer and m be a positive integer, we denote by a mod m the remainder when a is divided by m. • For example 5 mod 3 = 2 • Definition 9. If a and b are integers and m is a positive integer, then a is congruent to b modulo m if m divides a-b,we denote it by a≡b(mod m)
Theorem 6 • Let m be a positive integer. The integers a and b are congruent modulo m if and only if there is an integer k such that a=b+km. • Proof: If a≡b(mod m),then m ∣(a – b).This means that there is an integer k such that a – b=km,so that a=b+km.Conversely,if there is an integer k such that a=b+km,then km=a – b.Hence,m divides a – b,so that a≡b(mod m).
Theorem 7 • Let m be a positive integer. If a≡b(mod m)and c≡d(mod m), then a+c ≡b+d(mod m) and ac≡bd(mod m). • Proof: Since a≡b(mod m)and c≡d(mod m),there are integers s and t with b=a+sm and d=c+tm.Hence, • b+d=(a+sm)+(c+tm)=(a+c)+m(s+t) and • bd=(a+sm)(c+tm)=ac+m(at+cs+stm). • Hence, • a+c ≡b+d(mod m) and ac≡bd (mod m).
同余的应用 • 1 Hashing Function / 哈希函数 • 设一个查找表S有n个数据元素S={R1, R2, …, Rn}。对于每个指定的Ri,设key是其关键字的值。则建立一个从Ri.key到Ri的存贮地址函数H为 • H(Ri. key)=addr(Ri) • 称H为哈希函数(Hash),函数值H(Ri. key)称为哈希地址。按该方法所建立的表称为哈希表。最常用的哈希函数是同余函数: h(k)=kmodm
2. 密码学 • 密码学是研究信息隐藏的科学,一开始主要用于军事目的,两次世界大战期间,都起到了关键的作用。现在由于计算机广泛应用于商业目的,信息安全是电子商务的关键核心,而密码学是信息和网络安全的核心。同余理论可以用于非常简单的信息保密目的。比如一个英文字母可以用另一个英文字母来代替,如最早的Caesar加密技术,
将英文字母用它在字母表中的位置来代替,如A←→0, B ←→1, Z ←→25. 令 • F(p)=(p+3) mod 26 • 那么 MEETYOU IN THE PARK 的Caesar密码是什么? • 解:这个句子对应的编码为 12 4 4 9 24 14 20 8 13 19 7 4 15 0 17 10 用上面的函数计算得到: 15 7 7 22 1 17 23 11 16 22 10 7 18 3 20 13 对应到英文字母为 • PHHW BRX LQ WKH SDUN
解密函数: • F-1(p)=(p-3) mod 26 • 这种加密技术过于简单,很容易被攻破,实际上只要f(p)是一个I→I一个双射函数即可。由Caesar密码体制直接推广的一种密码技术是仿射密码: • F(p)=(ap+b)mod 26, 这里a是一个质数。
Exercises • Pp125. 5, 15, 21