110 likes | 235 Views
Division in the Integers. Theorem 1. If n and m are integers and n>0 , then m=qn+r for unique integers q and r with 0<=r<n n|m, n divides m, if r=0, that is m=qn Theorem 2. Let a,b,c be integers, (a) if a|b and a|c, then a|(b+c) (b) if a|b and a|c, where b>c, then a|(b-c)
E N D
Division in the Integers Theorem 1. If n and m are integers and n>0, then m=qn+r for unique integers q and r with 0<=r<n • n|m, n divides m, if r=0, that is m=qn Theorem 2. Let a,b,c be integers, (a) if a|b and a|c, then a|(b+c) (b) if a|b and a|c, where b>c, then a|(b-c) (c) if a|b or a|c, then a|bc (d) if a|b and b|c, then a|c • if a|b and a|c, then a|(mb+nc) • A number p>1 in Z+ is prime if the only positive integers that divide p are p and 1
Division in the Integers (cont’) Algorithm to test whether an integer N>1 is prime: Step 1 Check whether N is 2, If so, N is prime. If not, proceed to Step 2 Check whether 2|N. If so, N is not prime; otherwise, proceed to Step 3 Compute the largest integer KN. Then Step 4 Check whether D|N, where D is any odd number such that 1<DK. If D|N, then N is not prime; otherwise (also for the case when there is no such D), N is prime. Theorem 3. Every positive integer n>1 can be written uniquely as p1k1p2k2…psks, where p1<p2<…<ps are distinct primes that divides n and the k’s are positive integers
Greatest Common Divisor If a,b, and k are in Z+, and k|a and k|b, k is a common divisor; if d is the largest such k, d is the greatest common divisor, or GCD of a and b, d=GCD(a,b). Theorem 4. If d is GCD(a,b), then (a) d=sa+tb for some integers s and t (not necessarily positive) (b) if c is any other common divisor of a and b, then c|d.
Greatest Common Divisor (cont’) • Let a,b, and d be in Z+, the integer d is the GCD of a and b if and only if • d|a and d|b • whenever c|a and c|b, then c|d. Euclidean algorithm, a procedure for finding GCD(a,b) Suppose that ab0, then a=k1b+r1 where k1is in Z+, and 0r1b divide b by r1: b=k2 r1+r2 0r2 r1 divide r1 by r2: r1=k3r2+r3 0r3 r2 divide r2 by r3: r2=k4r3+r4 0r4 r3 …
Greatest Common Divisor (cont’) divide rn-2 by rn-1:rn-2=knrn-1+rn 0rn rn-1 divide rn-1 by rn : rn-1=kn+1rn+rn+1 0rn+1 rn and rn+1=0 now rn=GCD(a,b) • If GCD(a,b)=1, we say a and b are relatively prime. Theorem 5. If a and b are in Z+, then GCD(a,b)=GCD(b, b±a).
Least Common Multiple If a,b, and k are in Z+, and a|k and b|k, k is a common multiple; if d is the smallest such k, d is the least common multiple, or LCM of a and b, d=LCM(a,b). Theorem 6. If a and b are two positive integers, then GCD(a,b).LCM(a,b)=ab • For each n in Z+, define a function fn, the mod-n function as follows: if z is a nonnegative integer, fn=r, the remainder when z is divided by n.
Matrices • matrix, rows, columns • A is m (rows) by n (columns) as mn • square matrix, main diagonal, diagonal matrix, zero matrix • aij is the i, jth element (entry) of the matrix • If A=[aij] and B=[bij] are mn matrices, then the sum of A and B is C=[cij] defined by cij = aij+bij, 1i m, 1 j n. • A+B=B+A, (A+B)+C=A+(B+C), A+0=0+A=A
Matrices (cont’) • If A=[aij] is an mp matrix and B=[bij] is a pn matrix, then their product AB is the mn matrix C=[cij] defined by cij= ai1b1j+ai2b2j+… +aipbpj 1i m, 1 j n. • A(BC)=(AB)C, A(B+C)=AB+AC, (A+B)C=AC+BC • identity matrix In, nn diagonal matrix with all of whose diagonal elements 1 • if A is an mn matrix, then ImA=AIn=A • if A is an nn matrix, p is a positive integer, define Ap=A.A. . .A (p factors) and A0=In, then Ap Aq =Ap+q and (Ap)q=Apq if AB=BA, then (AB)p=ApBp
Matrices (cont’) • If A=[aij] is an mn matrix, then the nm matrix AT= [aijT], where aijT =aji, 1i m, 1 j n, is called the transpose of A. Theorem. If A, B are matrices, then (a) (AT)T=A (b) (A+B)T=AT +BT (c) (AB)T = BTAT • A=[aij] is called symmetric if AT =A; A must be a square matrix with aij =aji
Boolean Matrix Operations • A boolean matrix is an mn matrix whose entries are either zero or one • Let A=[aij] and B=[bij] be mn matrices. Define AB=C=[cij], the join of A and B, by cij is 0 if both aij and bij are 0, otherwise cij is 1 • Define AB=D=[dij], the meet of A and B, by dij is 1 if both aij and bij are 1, otherwise dij is 0 • The boolean product of two boolean matrices A (mp) and B (pn), denoted AB, is the mn matrix C=[cij] defined by cij=1 if aik=1 and bkj=1 for some k, 1kp; otherwise cij=0
Boolean Matrix Operations Theorem. If A, B and C are Boolean matrices of compatible sizes, then 1. (a) AB= BA (b) AB= BA 2. (a) (AB)C = A(BC) (b) (AB)C = A(BC) 3. (a) A(BC) = (AB)(AC) (a) A(BC) = (AB)(AC) 4. (AB)C = A(BC)