Euclid的除法算法是一种计算两个给定正整数的最高公共因子(HCF)的技术。两个正整数a和b的HCF是最大的正整数d划分a和b。要了解Euclid的除法算法,我们首先需要了解Euclid的除法引理。
欧几里得司引理
Euclid的Division Lemma给出了Division的所有组件之间的关系。让我们看一下Euclid的Lemma部门的陈述:
For any 2 positive integer a & b there exists a unique integers q & r,
Such that: a = b x (q + r),
where 0 <= r < b
让我们从视觉上了解Euclid的Division Lemma。在下图中,股息27为a ,除数8为b。
商3是q ,余数3是r
如您在下图中所看到的:
因此,除法引理:a = bx(q + r)可以写成:
Divident = (Divisor x Quotient) + Remainder
- Euclid的Divison引理有许多与整数可除性有关的应用
- 它可以用来寻找 两个数字的HCF。
- HCF代表最高公因子。
使用除法引理找出两个数的HCF
The process of finding the HCF of two numbers using EUCLID’S DIVISION LEMMA is called “EUCLID’S DIVISION ALGORITHM”.
示例1:让我们找到135和255的HCF吗?
解决方案:
步骤1:通过将255除以135,将除法引数应用于255和135。
第2步:现在,余数变为除数,前一个除数变为除数
步骤3:再次将除法引理应用于这对新的股利和除数
步骤4:现在15是我们的新除数,120是新的股息。
使余数为零的除数是两个数的HCF。
因此15是255和135的HCF。
示例2:使用Euclid的Divison算法查找867和255的HCF?
解决方案:
Step 1: Since 867 > 255, we apply the Division Lemma to 867 and 255, to get
867 = 255 x 3 + 102
Step 2: Since the Remainder 102 ≠ 0, we apply the divison lemma to 867 and 255, to get
255 = 102 x 2 + 51
Step 3: We consider the new divisor 102 and the new Remainder 51 and apply the divison lemma to get
102 = 51 x 2 + 0
The remainder has now become zero, so our procedure stops. Since the divisor at this stage is 51, the HCF of 255 and 867 is 51 .
示例3:使用Euclid的Divison算法查找4052和12576的HCF?
解决方案:
Step 1: Since 12576 > 4052 , we apply the Division Lemma to 867 and 255, to get
12576 = 4052 x 3 + 420
Step 2: Since the Remainder 420 ≠ 0 , we apply the divison lemma to 12576 and 4052, to get
4052 = 420 x 9 + 272
Step 3: We consider the new divisor 420 and the new Remainder 272 and apply the divison lemma to get
420 = 272 x 1 + 148
We consider the new divisor 272 and the new Remainder 148 and apply the divison lemma to get
272 = 148 x 1 + 124
We consider the new divisor 148 and the new Remainder 124 and apply the divison lemma to get
148 = 124 x 1 + 24
We consider the new divisor 124 and the new Remainder 24 and apply the divison lemma to get
124 = 24 x 5 + 4
We consider the new divisor 24 and the new Remainder 4 and apply the divison lemma to get
24 = 4 x 6 + 0
The remainder has now become zero, so our procedure stops . Since the divisor at this stage is 4, the HCF of 4052 and 12576 is 4.