The Integers and Division - PowerPoint PPT Presentation

About This Presentation
Title:

The Integers and Division

Description:

The Integers and Division Outline Division: Factors, multiples Exercise 2.3 Primes: The Fundamental Theorem of Arithmetic. The Division Algorithm Greatest Common ... – PowerPoint PPT presentation

Number of Views:233
Avg rating:3.0/5.0
Slides: 20
Provided by: cseMsuEd4
Learn more at: http://www.cse.msu.edu
Category:

less

Transcript and Presenter's Notes

Title: The Integers and Division


1
The Integers and Division
2
Outline
  • Division Factors, multiples
  • Exercise 2.3
  • Primes The Fundamental Theorem of Arithmetic.
  • The Division Algorithm
  • Greatest Common Divisors Relatively prime
  • Least Common Multiples
  • Modular Arithmetic Congruence
  • Applications of Congruence Cryptology

3
Division
  • Definition Let a and b be integers with a?0.
  • Then, we say that a divides b (and we note a
    b) if there is an integer c such that b ac.
  • a is called a factor of b, and b is multiple of
    a.
  • We note a b when a does not divide b
  • I used above notation for lack of strike vertical
    in PP.
  • Examples 3 12, but 3 14
  • Note P(a, b) a b is a predicate, with values
    True or False.
  • Theorem Let a, b, c be integers with a ? 0. Then,
  • if a b and a c, then a (bc)
  • if a b, then a bc
  • if a b and b c, then a c.

4
Exercise 2.3a
5
Primes
  • Definition 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.
  • Examples 7 is prime. 9 is composite.
  • Note 1 is not prime, nor composite.
  • Some primes 2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
    31, 37, 41, 43, 47
  • The Fundamental Theorem of Arithmetic
  • Every positive integer can be written uniquely
    as the product of primes, in increasing order.
  • Examples. 100 22 ? 52, 641 641, 999 33 ?
    37, and 1024 210.

6
Primes Cont.
  • Theorem If n is a composite integer, then n has
    a prime divisor less than or equal to ?n.
  • An integer n is prime if it is not divisible by
    any prime less than or equal to ?n.
  • 101 is prime, since 101 is not divisible by 2, 3,
    5, or 7 (the only primes less or equal than
    ?101.)
  • Prime factorization of 7007
  • Divide 7007 by primes, starting with 2, 3, 7
    7007/7 1001.
  • Divide 1001 by primes, starting with 7 1001/7
    143.
  • Divide 143 by primes, starting with 7 143/11
    13.
  • Stop, since 13 is prime. 7007 72 ? 11 ? 13

7
The Division Algorithm
  • The Division Algorithm Let a be an integer and d
    a positive integer. Then there are unique
    integers q and r, with 0 ? r lt d, such that a
    dq r.
  • d is called the divisor,
  • a is called the dividend,
  • q is called the quotient,
  • r is called the reminder.
  • Examples 101 11 ? 9 2. How about 101 11 ?
    8 13?
  • -11 3(-4) 1. How about -11 3(-3) -
    2?

8
Greatest Common Divisors
  • Definition Let a and b be integers, not both
    zero. The largest integer d such that d a and d
    b , denoted by gcd(a, b), is called the
    greatest common divisor of a and b.
  • Examples gcd(24, 36) 12.
  • gcd(17, 22) 1.

9
Greatest Common Divisors -Cont
  • Procedure to find gcd(a, b)
  • Find the prime factorization of a and b.
  • If a p1a1 p2a2 pnan, b p1b1 p2b2 pnbn,
    then
  • gcd(a, b) p1min(a1,b1) p2min(a2,b2)
    pnmin(an,bn)
  • Examples
  • 120 23 ? 3 ? 5 and 500 22 ? 53 22 ? 30 ?
    53
  • gcd(120, 500) 22 ? 30 ? 51 20.

10
Relatively Prime Integers
  • Definition The integers a and b are relatively
    prime if gcd(a, b) 1.
  • Example 17 and 22 are relatively prime.
  • Definition The integers a1, a2, , an are
    pairwise relatively prime if gcd(ai, aj)1
    whenever 1?iltj?n.
  • Examples
  • 10, 17 and 21 are pairwise relatively prime.
  • 10, 17 and 24 are not pairwise relatively prime.

11
Least Common Multiples
  • Definition Let a and b be positive integers. The
    least common multiple of a and b is the smallest
    positive integer that is divisible by both a and
    b.
  • It is denoted by lcm(a, b).
  • If a p1a1 p2a2 pnan, b p1b1 p2b2 pnbn,
    then
  • lcm(a, b) p1max(a1,b1) p2max(a2,b2)
    pnmax(an,bn)
  • Example lcm(233572, 2433) 243572.
  • Theorem ?a?? ?b??
  • ab gcd(a, b) ? lcm(a, b)

12
Modular Arithmetic
  • Definition Let a be an integer and m a positive
    integer. a mod m denotes the reminder when a is
    divided by m.
  • a mod m r, where 0 ? r lt m and a qm r.
  • Examples
  • 17 mod 5 2 (since 17 3 ? 5 2.)
  • -133 mod 9 2
  • 2001 mod 101 82
  • The function fm Z ? 0, 1, 2, , m-1, where
    fm(a) a mod m is onto, but not one-to-one.

13
Congruence
  • Definition If a and b are integers and m a
    positive integer, then a is congruent to b modulo
    m (a ? b (mod m)) if m divides (a b).
  • Note a ? b (mod m) ? a mod m b mod m
  • Examples
  • 17 ? 5 (mod 6), since 17-5 12 6 ? 2 is a
    multiple of 6.
  • Note also that 17 mod 6 5 mod 6 5.
  • 24 ? 14 (mod 6)
  • I used above notation for lack of strike ? in PP.

14
Congruence Cont.
  • Theorem ?m?Z ?a?Z ?b?Z
  • a?b (mod m) ? ?k?Z a b km
  • Theorem
  • If a?b (mod m) and c?d (mod m), then
  • ac ? bd (mod m), and
  • ac ? bd (mod m).

15
Applications of Congruence
  • Hashing Functions
  • Pseudorandom Numbers
  • Linear congruential method
  • Cryptology
  • Caesar cipher

16
Hashing Functions
  • Records are identified by a key (integer k).
  • For example, using Social Security number
  • To record k, assign memory location
  • h(k) k mod m, where m is the number of
    available memory locations.
  • h(k) is easily evaluated it is also onto.
  • Example. If m111, the record with k064212848 is
    assigned to location 14 since h(064212848)
    064212848 mod 111 14.
  • Collision may occur since h(k) is not one-to-one.
  • Resolve by assigning next free location.

17
Pseudorandom Numbers
  • Linear congruential method
  • Choose modulus m, multiplier a, increment c, and
    seed x0, with 2 ? a lt m, 0 ? c, x0 lt m
  • Generate the sequence xn
  • xn1 (a xn c) mod m.
  • Example m 9, a 7, c 4, and x0 3
  • x1 7x04 mod 9 7 ? 3 4 mod 9 25 mod 9 7
  • x28, x36, x41, x52, x60, x74, x85, x93.
  • Usually, a pure multiplicative generator is used
  • Increment c0, modulus m231 1, multiplier
    a7516,807.

18
Cryptology
  • Caesars encryption process
  • Represent each letter by an integer from 0 to 25
  • Replace a letter represented by p by the letter
    represented by f(p) (p 3) mod 26.
  • Example
  • M ? 12, f (12) (123) mod 26 15 ? P
  • Meet you in the park is replaced by Phhw brx
    lq wkh sdun
  • Decryption. To recover the original message, use
    the inverse function f -1(p) (p - 3) mod 26.

19
Cryptology Cont.
  • Caesar cipher can be generalized
  • Shift cipher
  • f(p) (p k) mod 26.
  • Affine transformation
  • f(p) (ap b) mod 26, where a and be are
    integers chosen so that f is a bijection.
  • Example f(p) (7p 3) mod 26, K?
  • K ? 10, f (10) (7 ? 10 3) mod 26 73 mod 26
    21 ? V.
  • K is replaced by V in the encrypted message.
Write a Comment
User Comments (0)
About PowerShow.com