 Hello friends, so welcome again to yet another session on rail numbers having seen Euclid's division algorithms geometrical interpretation and And having understood the meaning of greatest common divisor and or highest common factor and also understanding co-primes now it's time to find out a way to Determine the GCD of any two positive integers So in today's session, we are going to learn the way of finding GCD GCD of GCD of two positive positive integers Integers GCD of two positive integers using Euclid's Euclid's Division algorithm division Algorithm and Euclid's division algorithm friends is depending on Euclid's another very famous Contribution to mathematics or number three which was Euclid's Euclid's division Euclid's division lemma, so what was Euclid's division lemma? Euclid's division lemma said that if there are two numbers a and b Two numbers again. I mean two positive integers a and b. So a can be expressed as b q plus r Where q and r are unique q and r are unique integers unique positive integers unique positive integers for for every pair of every for every pair of every pair of a and b for every pair of a and b and our condition was Zero is less than equal to r less than b. This was Euclid's division lemma So we will be using this division lemma to find out GCD which we also explained in our previous video where we used geometric interpretation of Euclid's division algorithm now for this We will go first with examples and then we'll try to prove The method using a particular theorem later on so first let us find out GCD of our two numbers 30 and 42 which we Found out using the geometrical interpretation if you remember if you have not seen that video I would recommend you please go to our previous video where we had explained how to find out GCD of 30 and 42 using Euclid's division algorithm, but through Geometrical method now So here what is my a so a is clearly the bigger of the two that is 42 and B is 30. Okay. Let's now try and find out the GCD using The algorithm so let us put 42 here. So this is 42 and 42 is equal to let's say b value is 30 So let us find out the q value now q is clearly 40 30 into 1 because 30 into 2 will be 60 Which is more than 42. So hence 30 goes 1 times into 42 and hence the remainder is 12 This is the first step. So if you remember if you see we express 42 and 30 Using Euclid's division lemma where q is 1 and r is 12 which is clearly less than 30 the b Okay. Now what you need to do is you have to shift you have to shift 30 now the b the first b Goes to a that means 30 comes here So I will put 30 here and 30 equals to an and this r comes into B's position. So 12 you keep 12 here Okay, and then multiply so how many times does 12 go into 30 two times because 12 into 22 is 24 which is less than 30 12 into 3 is 36, which is more than 30. So hence 12 into 2 Okay, and then what will be the remainder remainder will be 6 Right 12 into 22 24 plus 6 30. So this is how it is now again check is the remainder 0 The remainder is not equal to 0. So hence we will repeat the process How so now the new b will become new a the previous b. Sorry will become the new a so hence you This is the new a 12 And the previous r will become the new b. Okay. So this is 6 now. How many times does 6 go into 12? So 2 times So 6 into 12 6 into 2 is 12 and then remainder is 0. So did we Did we arrive at 0? Yes, we arrived at 0 hence The moment we arrive at 0 as remainder the course the divisor or in that step becomes my Gcd. So if you see 6 is the 6 is the gcd here. So hence we can write gcd of 42 comma 30 is 6 Okay, guys, let us take another example to understand it better So in this case, we have two integers 81 and 24 where a is 81 So, how do we decide which one is a and which one is b? So the bigger of the two will become a first So, let me put 81 here and now this is equal to b b is what 24 Now how many times does 24 go into 81? So 24 2 is a 48 3 times 24 is 72 and 4 times in 96 So clearly I'll have to take 24 into 3 which is 72 and then what is the remainder? So if you see remainder is 9 Isn't it? So 24 into 3 is 72 Plus 9 gives me 81. So what's the next step next step is the previous step b becomes the a So 24 comes here Now and the previous step r. So this was previous step r 9 So 9 comes to b's position and repeat the process So hence now 9 into 2 is 18 and 9 into 3 is 27. So hence it will be 2 here So 9 into 2 is 18 18 plus 6 is 24 Now do we get 0 as the remainder finally? No, so repeat the process So 9 comes to a's position and 6 comes to b's position. So 6 into 1 is 6 plus 3 is the remainder 0. No repeat the process 6 goes to 9's position. So 6 is here and r goes to b's position here. So 3 into 2 Is plus now we get 0 so finally we ended up getting 0 as the Reminder so hence what will be the gcd the gcd is nothing but the moment you get 0 in that step Whatever is the value of b? Whatever is the value of b is the gcd. So what should I write? I should write gcd of 81 comma 24 is 3 Okay, so this would be the highest common factor or gcd of 24 and 81 This is how for any given two pair of integers you can find the gcd by Euclid's division So finally and what is the last Terminating step the moment you get 0 As the remainder in that step whatever is the value of divisor that becomes the highest common factor or greatest common divisor Hope you understood the process I would recommend you to take some random pairs of integers and do it for yourself And if you see if two numbers are co-prime actually It will be the gcd will come out to be one. So I would recommend you to take these cases as practice Problems and try and understand how algorithm or euclid's division algorithm works for finding gcd of any two positive integers Thank you for watching this video