prime an integer greater than one is called a prime number if its only positive divisors (factors)...
TRANSCRIPT
![Page 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/1.jpg)
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.)
![Page 2: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/2.jpg)
PrimeAlgorithm 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.
![Page 3: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/3.jpg)
Greatest Common Divisor (GCD)• Given two numbers not prime to one another, find their
greatest common divisor.
• GCD(a, b) = p1 min(a1
, b1
) p2 min(a2
,b2
) …pk min(ak
, bk
)
where p1, p2, p3,…., pk are prime factors of either a or b. and some of a
i and b
i may be zeros.
• Example: 630 = 21. 3 2.5 1.7 1
450 = 2 1. 3 2.5 2.7 0
GCD(630, 450) = 2min(1, 1). 3 min(2, 2) 5min(1, 2). 7min(1, 0).
= 2 1. 3 2. 51. 7 0 = 90
![Page 4: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/4.jpg)
Least Common Multiple (LCM)
• LCM(a, b) = p1 max(a1
, b1
) p2 max(a2
,b2
) …pk max(ak, b
k)
where p1, p2, p3,…., pk are prime factors of either a or b.
and some of ai and
bi may be zeros.
Example:
630 = 21. 3 2.5 1.7 1
450 = 2 1. 3 2.5 2.7 0
LCM(630, 450) = 2max(1, 1). 3 max(2, 2). 5max(1, 2). 7max(1, 0).
= 2 1. 3 2. 52. 7 1
= 3150
![Page 5: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/5.jpg)
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.)
• If a = bt + r, for integers t and r, then gcd(a, b) = gcd(b, r).
![Page 6: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/6.jpg)
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.
![Page 7: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/7.jpg)
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.
![Page 8: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/8.jpg)
Euclidean Algorithm
• The greatest common divisor of 190 and 34 is computed as follows using the Euclidean Algorithm:
190 = 5 * 34 + 2034 = 1 * 20 + 1420 = 1 * 14 + 614 = 2 * 6 + 26 = 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.
![Page 9: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/9.jpg)
Euclidean Algorithm
• The greatest common divisor of 878 and 82 is computed as follows via the Euclidean Algorithm:
878 = 10 * 82 + 5882 = 1 * 58 + 2458 = 2 * 24 + 1024 = 2 * 10 + 410 = 2 * 4 + 24 = 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.
![Page 10: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/10.jpg)
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.
![Page 11: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/11.jpg)
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.
![Page 12: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/12.jpg)
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.
![Page 13: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/13.jpg)
Matrix: Multiplication
![Page 14: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/14.jpg)
Matrix: Multiplication
![Page 15: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/15.jpg)
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.
![Page 16: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/16.jpg)
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 aij is the number in the ith-row and jth-column, then the diagonal is given by the numbers aii, for i=1,..,n.
![Page 17: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/17.jpg)
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.
![Page 18: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/18.jpg)
Matrices
• For example, the matrices
are upper-triangular, while the matrices
are lower-triangular.
![Page 19: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/19.jpg)
Transpose of a MatrixNow 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 aij, then the transpose of A, denoted AT is the m x n matrix defined by the numbers bij where bij = aji.
![Page 20: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/20.jpg)
Transpose of a Matrix• For example, for the matrix
we have
![Page 21: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/21.jpg)
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 = XT + YT
• 2. – (XZ)T = ZT XT
• 3. – (XT)T = X
![Page 22: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/22.jpg)
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.
![Page 23: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/23.jpg)
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 rolein matrix theory.
![Page 24: 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](https://reader035.vdocument.in/reader035/viewer/2022062313/56649d015503460f949d3e47/html5/thumbnails/24.jpg)
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 In is the identity matrix. The matrix B is called the inverse matrix of A. Example: