Presentation is loading. Please wait.

Presentation is loading. Please wait.

Prime An integer greater than one is called a prime number if its only positive divisors (factors) are one and itself. Examples: The first six primes are.

Similar presentations


Presentation on theme: "Prime An integer greater than one is called a prime number if its only positive divisors (factors) are one and itself. Examples: The first six primes are."— Presentation transcript:

1 Prime An integer greater than one is called a prime number if its only positive divisors (factors) are one and itself. Examples: The first six primes are 2, 3, 5, 7, 11 and 13. The prime divisors of 10 are 2 and 5. The Fundamental Theorem of Arithmetic shows that the primes are the building blocks of the positive integers: every positive integer is a product of prime numbers in one and only one way, except for the order of the factors. (This is the key to their importance: the prime factors of an integer determines its properties.)

2 Prime Algorithm to test whether an integer N>1 is prime: Step1: N = 2 ? If so, N is prime, If not, continue. Step2: 2 | N ? If so, N is not a prime, otherwise cont. Step3: Compute the largest integer K ≤ √N. Then Step4: D | N? where D is any odd number such that 1 < D ≤ K. If D | N, then N is not prime, otherwise, N is prime.

3 Greatest Common Divisor (GCD) Given two numbers not prime to one another, find their greatest common divisor. GCD(a, b) = p 1 min(a 1, b 1 ) p 2 min(a 2,b 2 ) …p k min(a k, b k ) where p 1, p 2, p 3,…., p k are prime factors of either a or b. and some of a i and b i may be zeros. Example: 630 = 2 1. 3 2.5 1.7 1 450 = 2 1. 3 2.5 2.7 0 GCD(630, 450) = 2 min(1, 1). 3 min(2, 2) 5 min(1, 2). 7 min(1, 0). = 2 1. 3 2. 5 1. 7 0 = 90

4 Least Common Multiple (LCM) LCM(a, b) = p 1 max(a 1, b 1 ) p 2 max(a 2,b 2 ) …p k max(a k, b k ) where p 1, p 2, p 3,…., p k are prime factors of either a or b. and some of a i and b i may be zeros. Example: 630 = 2 1. 3 2.5 1.7 1 450 = 2 1. 3 2.5 2.7 0 LCM(630, 450) = 2 max(1, 1). 3 max(2, 2). 5 max(1, 2). 7 max(1, 0). = 2 1. 3 2. 5 2. 7 1 = 3150

5 Euclidean Algorithm The algorithm is based on the following two observations: If b|a then gcd(a, b) = b. This is indeed so because no number (b, in particular) may have a divisor greater than the number itself (I am talking here of non-negative integers.)gcd If a = bt + r, for integers t and r, then gcd(a, b) = gcd(b, r).

6 Euclidean Algorithm Indeed, every common divisor of a and b also divides r. Thus gcd(a, b) divides r. But, of course, gcd(a, b)|b. Therefore, gcd(a, b) is a common divisor of b and r and hence gcd(a, b) = gcd(b, r). The reverse is also true because every divisor of b and r also divides a.

7 Euclidean Algorithm Example Let a = 2322, b = 654. 2322 = 654*3 + 360 gcd(2322, 654) = gcd(654, 360) 654 = 360*1 + 294 gcd(654, 360) = gcd(360, 294) 360 = 294*1 + 66 gcd(360, 294) = gcd(294, 66) 294 = 66*4 + 30 gcd(294, 66) = gcd(66, 30) 66 = 30*2 + 6 gcd(66, 30) = gcd(30, 6) 30 = 6*5 gcd(30, 6) = 6 Therefore, gcd(2322,654) = 6.

8 Euclidean Algorithm The greatest common divisor of 190 and 34 is computed as follows using the Euclidean Algorithm: 190 = 5 * 34 + 20 34 = 1 * 20 + 14 20 = 1 * 14 + 6 14 = 2 * 6 + 2 6 = 3 * 2 + 0 Since it is the next-to-last number appearing on the right-hand side of these equations, the GCD of the two is 2.

9 Euclidean Algorithm The greatest common divisor of 878 and 82 is computed as follows via the Euclidean Algorithm: 878 = 10 * 82 + 58 82 = 1 * 58 + 24 58 = 2 * 24 + 10 24 = 2 * 10 + 4 10 = 2 * 4 + 2 4 = 2 * 2 + 0 Since it is the next-to-last number appearing on the right-hand side of these equations, the GCD of the two is 2.

10 Matrices Consider two families A and B. Every month, the two families have expenses such as: utilities, health, entertainment, food, etc. Let us restrict ourselves to: food, utilities, and health. How would one represent the data collected? Many ways are available but one of them has an advantage of combining the data so that it is easy to manipulate them.

11 Matrices We will write the data as follows: If we have no problem confusing the names and what the expenses are, then we may write This is what we call a Matrix.

12 Matrix: Addition Addition of two matrices: Add entries one by one. For example, we have Multiplication of a Matrix by a Number: In order to multiply a matrix by a number, you multiply every entry by the given number.

13 Matrix: Multiplication

14

15 Matrices The size of the matrix is given by the number of rows and the number of columns. If the two numbers are the same, we called such matrix a square matrix. Consider the matrix: its diagonal is given by a and d.

16 Matrices For the matrix Its diagonal consists of a, e, and k. In general, if A is a square matrix of order n and if a ij is the number in the i th -row and j th -column, then the diagonal is given by the numbers a ii, for i=1,..,n.

17 Upper-triangular and lower-triangular matrices The diagonal of a square matrix helps define two type of matrices: upper-triangular and lower-triangular. The diagonal subdivides the matrix into two blocks: one above the diagonal and the other one below it. If the lower-block consists of zeros, we call such a matrix upper-triangular. If the upper-block consists of zeros, we call such a matrix lower-triangular.

18 Matrices For example, the matrices are upper-triangular, while the matrices are lower-triangular.

19 Transpose of a Matrix Now consider the two matrices The matrices A and B are triangular. But there is something special about these two matrices. If you reflect the matrix A about the diagonal, you get the matrix B. This operation is called the transpose operation. Let A be a n x m matrix defined by the numbers a ij, then the transpose of A, denoted A T is the m x n matrix defined by the numbers b ij where b ij = a ji.

20 Transpose of a Matrix For example, for the matrix we have

21 Matrices Properties of the Transpose operation. If X and Y are m x n matrices and Z is an n x k matrix, then 1. –(X+Y) T = X T + Y T 2. –(XZ) T = Z T X T 3. –(X T ) T = X

22 Symmetric matrix Symmetric matrix is a matrix equal to its transpose. So a symmetric matrix must be a square matrix. For example, the matrices are symmetric matrices.

23 Matrices A diagonal matrix is a symmetric matrix with all of its entries equal to zero except may be the ones on the diagonal. So a diagonal matrix has at most n different numbers. For example, the matrices are diagonal matrices. Identity matrices are examples of diagonal matrices. Diagonal matrices play a crucial role in matrix theory.

24 Invertible Matrices Invertible matrices are very important in many areas of science. For example, decrypting a coded message uses invertible matrices. Definition. An n x n matrix A is called nonsingular or invertible if and only ifthere exists an n x n matrix B such that where I n is the identity matrix. The matrix B is called the inverse matrix of A. Example:


Download ppt "Prime An integer greater than one is called a prime number if its only positive divisors (factors) are one and itself. Examples: The first six primes are."

Similar presentations


Ads by Google