Least common multiple: lowest common multiple of A & B
Multiple of A Multiple of B Example 1 : Is 392(n) divisible by 4(a) & 6(b)? Step 1 : find LCM (A&B) Step 2: use division algorithm to write 392=32x12+8 r 392 / 12 =32 remainder 8 Step 3: 392 not divisible by both 4 and 6
Example 2: How many numbers between 142 and 388 are not divisible by either 5 or 7? Step 1 : how many numbers are there between 142 and 388? Subtraction principle: 388-142+1=247 (MUST ADD 1) * number line, add 1 Step 2 : how many are divisible by 5? For all number numbers between 142 and 388 what are the multiples of 5? Lowest multiple = 145 = 29x5 Highest multiple = 385 = 77x5 So the multiple of 5 correspond to the numbers 29 up to 77. (77-29+1= 49) * subtraction principle Step 3: how many are divisible by 7? Lowest multiple = 147 = 21x7 Highest multiple = 385 = 55x7 So the multiple of 7 correspond to the number 21 up to 55 (55-21+1= 35) *subtraction principle Step 4 : how many are divisible by LCM (5,7)=35? Lowest number = 175 =5x35 Highest number = 385 =11x35 The multiple correspond to 5 to 11, total number 11-5+1 =7 Step 5: therefore, the total number of integers between 142 and 388 not divisible by 5 and not divisible by 7 is: (247 49 35 + 7 = 170)
Exercise 8.4.4 What saw that LCM is useful. Want to compute it, the method we have now is not efficient for big numbers. Using the timetables of numbers to find LCM becomes harder as the numbers grows. Well use Greatest common dominator GCD GCD (a,b) = the largest number that is a divisor of both A&B Relation to LCM 1) Compare A&B and LCM (A&B) A = 2 B= 5 Then AB =10 , LCM (2,5)=10 ratio AB/LCM AB = 10/10 = 1 GCD (2,5) Note: The ratio in each example is exactly GCD (AB) General principle : GCD(AB) = AB/LCM(AB) Or rearrange LCM(AB) = AB/GCD(AB)
Small number Example: GCD(8,12) Step 1: write all divisors of both numbers Divisor of 8: 1,2,4,8 Divisor of 12: 1,2,3,4,6,12 Step 2: find the common ones 1,2,4 Step 3: take the largest among those GCD(8,12) = 4
Large number example *special case GCD (5,15)=5 GCD (4,8)=4 GCD (11,77) = 11 In general if A divide by B, we have GCD of A & B Euclid algorithm - Euclid : ancient Greece, one mathematician or collection - Algorithm : named after Arab mathematician Al-Kwanisi(8 th C) - A process which answers a problem or a question - Fixed process - Finish Example: find GCD of 33 and 78 Solution: lets try to divide 78 by 33 (78=2x33+12) GCD (33,78) divide 33 and 78 any number that divide 33 and 78 also divides 12 and 33 . Why? 78=2x33+12 The conclusion : GCD (33,78) = GCD (12,33) Weve made progress because now we have smaller numbers 78=2x33+12 GCD(33,78) = GCD (12,33) Same trick: 33=3x12+9 GCD (12,33) = GCD (9,12) 12=1x9+3 GCD (9,12) = GCD (3,9) 9=3x3+0 * zero means stop We have: GCD (33,78)=GCD(3,9)=3