Divides, Divisor, Multiple - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Divides, Divisor, Multiple

Description:

... a and divisor d0, there is a unique integer quotient q and remainder r ... For any positive integer n and base b and integer 1, we can write n uniquely as ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 10
Provided by: sain9
Category:

less

Transcript and Presenter's Notes

Title: Divides, Divisor, Multiple


1
Divides, Divisor, Multiple
  • Let a,b be integers with a ? 0. We say
  • a divides b, written a b, if there is an
    integer c such that bac.
  • Examples 3 ??12 ? Yes 3 ? 7 ? No
  • If a divides b, then we say a is a factor or a
    divisor of b, and b is a multiple of a.

2
Prime and Composite Numbers
  • An integer pgt1 is prime if the only positive
    factors of a prime p are 1 and p itself. Some
    primes 2,3,5,7,11,13...
  • Non-prime integers greater than 1 are called
    composite (they can be composed by multiplying
    two integers greater than 1.
  • Every positive integer greater than 1has a unique
    representation as the product of a non-decreasing
    series of zero or more primes.
  • 2000 2222555 2001 32329

3
Division Algorithm
  • For any integer dividend a and divisor d?0, there
    is a unique integer quotient q and remainder r ?
    a dq r and 0 ? r lt d.
  • q?a?d? ra?qd.
  • Notation q a div d r a mod d
  • Examples
  • 101 119 2
  • -11 3(-4) 1
  • Note remainder r must be nonnegative.

4
Greatest Common Divisor and Least Common Multiple
  • The greatest common divisor gcd(a,b) of integers
    a,b (not both 0) is the largest (most positive)
    integer d that is a divisor both of a and of b.
  • lcm(a,b) of positive integers a, b, is the
    smallest positive integer that is a multiple both
    of a and of b.
  • Example
  • 842237 223171
  • 96222223 253170
  • gcd(84,96) 223170 223 12
  • lcm(84,96) 253171 672

5
Modular Congruence
  • Let a,b be integers and m a positive integer.
  • Then a is congruent to b modulo m, written a?b
    (mod m), if m a?b .
  • Equivalently, if (a?b) mod m 0.
  • Examples
  • 18 ?12 (mod 3) ? -- Yes
  • 21?13 (mod 3) ? -- No
  • Theorem If a?b (mod m) and c?d (mod m), then
  • ? ac ? bd (mod m), and
  • ? ac ? bd (mod m)

6
Pseudocode for Euclidean GCD algorithm
  • procedure gcd(a, b positive integers)
  • while b ? 0
  • r a mod b
  • a b
  • b r
  • exit the loop when remainder is 0
  • return a final value of a is gcd

7
Base-b number systems
  • For any positive integer n and base b and integer
    gt 1, we can write n uniquely as
  • n akbk ak-1bk-1 a1b a0 where k is a
    nonnegative integer and ak ,ak-1, a1, a0
    nonnegative integers less than b.
  • Example
  • 165 2 82 48 5 (245)8

8
Most useful bases for integers
  • Base b10 (decimal)10 digits
    0,1,2,3,4,5,6,7,8,9.
  • Base b2 (binary)2 digits 0,1
  • Base b8 (octal)8 digits 0,1,2,3,4,5,6,7.
  • Base b16 (hexadecimal)16 digits
    0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

9
Converting Base 10 Integer to Any Other Base b
  • Algorithm to convert any integer n to any base
    bgt1
  • 1. To find the value of the (next) rightmost
    digit of answer, compute n mod b.
  • 2. Replace n with the quotient ?n/b?.
  • 3. Repeat above two steps to find subsequent
    digits, until n 0
Write a Comment
User Comments (0)
About PowerShow.com