# विस्तारित यूक्लिडीय एल्गोरिद्म

विस्तारित यूक्लिडीय एल्गोरिद्म, यूक्लिडीय एल्गोरिद्म का एक संशोधित रूप है। यह दो पूर्णांकों का महत्तम समापवर्तक निकालने के साथ-साथ ऐसे पूर्णांक s और t भी निकालता है जो बेज़ू सर्वसमिका \( \gcd(a,b) = s \cdot a + t \cdot b \) को संतुष्ट करते हैं।<sup>[1](https://courses.cs.washington.edu/courses/cse311/20sp/lectures/lecture14.html)</sup> गुणांक s और t बेज़ू गुणांक कहलाते हैं और इन्हें निकालने की मानक संगणनात्मक विधि यही एल्गोरिद्म है।<sup>[2](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Number_Theory_%28Barrus_and_Clark%29/01%3A_Chapters/1.10%3A_Computing_Coefficients_for_Bezout%27s_Lemma)</sup> इसका प्रमुख व्यावहारिक उपयोग मॉड्यूलर गुणात्मक प्रतिलोम निकालना है, जिस पर कूटलेखन के महत्त्वपूर्ण चरण आधारित हैं।<sup>[3](https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=934860)</sup>

| मुख्य तथ्य | विवरण |
|---|---|
| परिणाम | \( \gcd(a,b) \) के साथ ऐसे पूर्णांक s, t कि \( \gcd(a,b) = s \cdot a + t \cdot b \)<sup>[1](https://courses.cs.washington.edu/courses/cse311/20sp/lectures/lecture14.html)</sup> |
| आधार | बेज़ू प्रमेय: धनात्मक पूर्णांकों a और b के लिए ऐसे पूर्णांक s और t सदैव मौजूद होते हैं<sup>[1](https://courses.cs.washington.edu/courses/cse311/20sp/lectures/lecture14.html)</sup> |
| हल किया हुआ उदाहरण | \( \gcd(803,154) = 11 = 5 \cdot 803 - 26 \cdot 154 \)<sup>[2](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Number_Theory_%28Barrus_and_Clark%29/01%3A_Chapters/1.10%3A_Computing_Coefficients_for_Bezout%27s_Lemma)</sup> |
| प्रतिलोम में उपयोग | यदि \( \gcd(a,m) = 1 \) और \( s \cdot a + t \cdot m = 1 \), तो \( s \bmod m \), मॉड्यूलो m में a का गुणात्मक प्रतिलोम है<sup>[1](https://courses.cs.washington.edu/courses/cse311/20sp/lectures/lecture14.html)</sup> |
| निष्पादन समय | \( O(\log n) \) भाग-चरण; सबसे खराब स्थिति में संख्याएँ क्रमागत फिबोनाची संख्याएँ होती हैं<sup>[4](https://www.usna.edu/Users/cs/wcbrown/courses/S17SI335/notes/03/notes.html)</sup> |
| बहुपद रूप | किसी क्षेत्र \( \mathbf{k} \) के लिए \( R = \mathbf{k}[x] \) पर बेज़ू गुणांकों की घात रैखिक रूप से बढ़ती है: \( \deg s_i = n_1 - n_{i-1} \) और \( \deg t_i = n_0 - n_{i-1} \)<sup>[5](https://www.csd.uwo.ca/~mmorenom/CS424/Lectures/EuclideanMethods.html/node4.html)</sup> |
| सॉफ्टवेयर | Sage यह गणना `xgcd(a,b)` के रूप में उपलब्ध कराता है; GMP में `mpz_gcdext` उपलब्ध है<sup>[6](https://math-cs.gordon.edu/ntic/ntic2017/section-bezout-id.html)</sup><sup> • </sup><sup>[7](https://gmplib.org/gmp-man-6.2.1.pdf)</sup> |

## विस्तार से क्या जुड़ता है

साधारण यूक्लिडीय एल्गोरिद्म केवल महत्तम समापवर्तक निकालता है: यह युग्म \((a, b)\) को बार-बार \((b, a \bmod b)\) से बदलता है, जब तक शेषफल शून्य न हो जाए। उस बिंदु पर अंतिम अशून्य भाजक ही महत्तम समापवर्तक होता है।<sup>[3](https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=934860)</sup> विस्तारित विधि इन्हीं चरणों के दौरान अतिरिक्त हिसाब रखती है, ताकि महत्तम समापवर्तक को दोनों मूल संख्याओं के पूर्णांक रैखिक संयोजन के रूप में भी लिखा जा सके।<sup>[8](https://www.math.cmu.edu/~bkell/21110-2010s/extended-euclidean.html)</sup>

ऐसे संयोजन का अस्तित्व ही बेज़ू प्रमेय का कथ्य है: यदि a और b धनात्मक पूर्णांक हैं, तो ऐसे पूर्णांक s और t मौजूद हैं जिनके लिए \( \gcd(a,b) = s \cdot a + t \cdot b \)।<sup>[1](https://courses.cs.washington.edu/courses/cse311/20sp/lectures/lecture14.html)</sup> चूँकि महत्तम समापवर्तक प्रायः a और b दोनों से छोटा होता है, इसलिए दोनों गुणांकों में से एक प्रायः ऋणात्मक होता है।<sup>[8](https://www.math.cmu.edu/~bkell/21110-2010s/extended-euclidean.html)</sup> यह निरूपण अद्वितीय नहीं है।<sup>[6](https://math-cs.gordon.edu/ntic/ntic2017/section-bezout-id.html)</sup>

## गणना कैसे होती है

**पश्च प्रतिस्थापन।** गुणांक निकालने का एक तरीका है मानक एल्गोरिद्म चलाते हुए भाग के हर चरण को दर्ज करना, फिर दर्ज समीकरणों को उनके शेषफलों के लिए हल करना और पीछे की ओर प्रतिस्थापन करना।<sup>[1](https://courses.cs.washington.edu/courses/cse311/20sp/lectures/lecture14.html)</sup> भाग के किसी चरण का प्रत्येक शेषफल \( r \), \( r = n - q \cdot d \) को संतुष्ट करता है, जहाँ n भाज्य, q भागफल और d भाजक है। इसलिए हर शेषफल को पहले के शेषफलों के रूप में फिर से लिखा जा सकता है।<sup>[8](https://www.math.cmu.edu/~bkell/21110-2010s/extended-euclidean.html)</sup>

LibreTexts में a = 803 और b = 154 वाला उदाहरण यह विधि दिखाता है। यूक्लिडीय एल्गोरिद्म से \( 803 = 154 \cdot 5 + 33 \), \( 154 = 33 \cdot 4 + 22 \), \( 33 = 22 \cdot 1 + 11 \), और \( 22 = 11 \cdot 2 + 0 \) प्राप्त होते हैं, इसलिए महत्तम समापवर्तक 11 है। अंतिम समीकरण को छोड़कर बाकी सबको पुनर्व्यवस्थित करने और पीछे की ओर प्रतिस्थापन करने पर पहले \( 11 = 5 \cdot 33 - 1 \cdot 154 \), फिर \( 11 = 5 \cdot 803 - 26 \cdot 154 \) मिलता है। इस प्रकार s = 5 और t = −26 हैं।<sup>[2](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Number_Theory_%28Barrus_and_Clark%29/01%3A_Chapters/1.10%3A_Computing_Coefficients_for_Bezout%27s_Lemma)</sup>

**आगे की ओर हिसाब रखना।** इसके बजाय एल्गोरिद्म हर चरण पर वर्तमान शेषफल को मूल a और b के रूप में व्यक्त कर सकता है और भाग की प्रक्रिया के साथ गुणांकों के युग्मों को अद्यतन करता चल सकता है। UWO के व्याख्यान-नोट्स की संकेतन पद्धति में प्रत्येक शेषफल \( r_i = s_i \cdot a + t_i \cdot b \) को संतुष्ट करता है। गुणांक पुनरावृत्ति संबंधों \( s_k = s_{k-2} - q_k \cdot s_{k-1} \) और \( t_k = t_{k-2} - q_k \cdot t_{k-1} \) से अद्यतन होते हैं, जहाँ \( q_k \), चरण k का भागफल है; अंतिम \( s_k \) और \( t_k \) ही बेज़ू गुणांक होते हैं।<sup>[5](https://www.csd.uwo.ca/~mmorenom/CS424/Lectures/EuclideanMethods.html/node4.html)</sup> इससे संबंधित एक सारणीबद्ध रूप, जिसमें पीछे लौटने की आवश्यकता नहीं होती, ब्लैंकिनशिप की विधि कहलाता है।<sup>[2](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Number_Theory_%28Barrus_and_Clark%29/01%3A_Chapters/1.10%3A_Computing_Coefficients_for_Bezout%27s_Lemma)</sup>

## अनुप्रयोग

**मॉड्यूलर प्रतिलोम।** जब \( \gcd(a, m) = 1 \) हो, तो बेज़ू प्रमेय से ऐसे पूर्णांक s और t मिलते हैं जिनके लिए \( s \cdot a + t \cdot m = 1 \)। मॉड्यूलो m लेने पर दिखता है कि \( s \bmod m \), मॉड्यूलो m में a का गुणात्मक प्रतिलोम है, क्योंकि \( (s \bmod m) \cdot a \equiv 1 \pmod{m} \)।<sup>[1](https://courses.cs.washington.edu/courses/cse311/20sp/lectures/lecture14.html)</sup> इन प्रतिलोमों की सहायता से मॉड्यूलर समीकरण हल किए जा सकते हैं।<sup>[1](https://courses.cs.washington.edu/courses/cse311/20sp/lectures/lecture14.html)</sup> कूटलेखन के एक ग्रंथ के अनुसार, उस क्षेत्र में यूक्लिडीय एल्गोरिद्म का अधिकांश उपयोग मॉड्यूलो a में b का गुणात्मक प्रतिलोम निकालने के लिए होता है और इस तरह इसका उपयोग करना भी कभी-कभी विस्तारित यूक्लिडीय एल्गोरिद्म कहलाता है।<sup>[3](https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=934860)</sup>

**रैखिक डायोफैंटीय समीकरण।** विस्तारित विधि से रैखिक डायोफैंटीय समीकरण, अर्थात पूर्णांकों में \( s \cdot a + t \cdot b = c \) के रूप वाले समीकरण, हल किए जा सकते हैं।<sup>[8](https://www.math.cmu.edu/~bkell/21110-2010s/extended-euclidean.html)</sup>

**बहुपद और क्षेत्र।** यह एल्गोरिद्म पूर्णांकों से आगे बहुपद वलयों जैसे अन्य यूक्लिडीय प्रांतों तक विस्तारित होता है। \( R = \mathbf{k}[x] \) पर, जहाँ \( \mathbf{k} \) एक क्षेत्र है, बेज़ू गुणांकों की घात निवेशों की घात के साथ रैखिक रूप से बढ़ती है और गुणांकों की घात पर्याप्त छोटी होने पर वे मूलतः अद्वितीय होते हैं।<sup>[5](https://www.csd.uwo.ca/~mmorenom/CS424/Lectures/EuclideanMethods.html/node4.html)</sup> विस्तारित यूक्लिडीय एल्गोरिद्म के बहुपदीय रूपों का उपयोग \( \mathrm{GF}(2^m) \) जैसे परिमित क्षेत्रों में प्रतिलोम निकालने के लिए होता है।<sup>[9](https://arxiv.org/abs/quant-ph/0407095)</sup>

## दक्षता

सबसे खराब स्थिति क्रमागत फिबोनाची संख्याओं के लिए आती है: चूँकि \( f_n \bmod f_{n-1} = f_{n-2} \), इसलिए \( \gcd(f_n, f_{n-1}) \) की गणना समाप्त होने से पहले पूरी फिबोनाची श्रेणी में पीछे की ओर चलती है।<sup>[4](https://www.usna.edu/Users/cs/wcbrown/courses/S17SI335/notes/03/notes.html)</sup>

इस निष्पादन समय का ऐतिहासिक विश्लेषण अपने आप में एक विषय है। वाटरलू विश्वविद्यालय के कंप्यूटर वैज्ञानिक जेफ़्री शैलिट, जिनका अध्ययन 1994 में *हिस्टोरिया मैथेमैटिका* में प्रकाशित हुआ था, बताते हैं कि पहले विश्लेषण का श्रेय परंपरागत रूप से गाब्रिएल लामे को उनके 1844 के शोधपत्र के लिए दिया जाता है। लेकिन आंत्वान-आंद्रे-लुई रेनो ने 1811 में ही एक कमजोर सीमा दी थी, एमिल लेजे को 1837 में लामे का मूल परिणाम ज्ञात था और पियेर-जोसेफ-एत्येन फिंक ने 1841 में अलग तरीके से एक पूर्ण और वैध प्रमाण दिया था।<sup>[10](https://www.sciencedirect.com/science/article/pii/S0315086084710317)</sup> यह अवलोकन कि क्रमागत फिबोनाची संख्याओं के लिए निष्पादन समय विशेष रूप से लंबा होता है, कम से कम 16वीं शताब्दी से मिलता है।<sup>[11](https://arxiv.org/abs/1409.0729)</sup>

## इतिहास और सॉफ्टवेयर

यूक्लिडीय एल्गोरिद्म और शेषफल की समस्याओं को हल करने के बीच संबंध काफी पहले देख लिया गया था: 1624 में बाशे द मेज़िरियाक पहले व्यक्ति थे जिन्होंने इन विधियों को यूक्लिडीय एल्गोरिद्म और डायोफैंटीय विश्लेषण से जोड़ा।<sup>[12](https://www.sciencedirect.com/science/article/pii/S0315086008000670)</sup> डी. ई. नुथ ने यूक्लिडीय एल्गोरिद्म को “सबसे पुराना अतुच्छ एल्गोरिद्म जो आज तक चला आया है” कहा है।<sup>[10](https://www.sciencedirect.com/science/article/pii/S0315086084710317)</sup>

कंप्यूटर बीजगणित प्रणालियाँ और लाइब्रेरी विस्तारित गणना सीधे उपलब्ध कराती हैं। Sage में यह `xgcd(a,b)` के रूप में लागू है; यह नाम “eXtended Euclidean algorithm” को प्रतिबिंबित करता है।<sup>[6](https://math-cs.gordon.edu/ntic/ntic2017/section-bezout-id.html)</sup> GMP लाइब्रेरी का `mpz_gcdext`, g का मान \( \gcd(a,b) \) रखता है और s, t को ऐसे गुणांक निर्धारित करता है जिनके लिए \( a \cdot s + b \cdot t = g \)। इन्हें इस तरह चुना जाता है कि सामान्यतः \( |s| < |b|/(2g) \) और \( |t| < |a|/(2g) \) हों; इससे कुछ अपवादों को छोड़कर s और t अद्वितीय रूप से निर्धारित हो जाते हैं।<sup>[7](https://gmplib.org/gmp-man-6.2.1.pdf)</sup>

## References

1. [CSE 311 Lecture 14: Euclidean Algorithm and Modular Equations, University of Washington](https://courses.cs.washington.edu/courses/cse311/20sp/lectures/lecture14.html)
2. [1.10: Computing Coefficients for Bezout's Lemma, Mathematics LibreTexts](https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Elementary_Number_Theory_%28Barrus_and_Clark%29/01%3A_Chapters/1.10%3A_Computing_Coefficients_for_Bezout%27s_Lemma)
3. [Network Security: Private Communication in a Public World, 3rd Edition (NIST copy)](https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=934860)
4. [SI 335, Unit 3: Number-Theoretic Computations, United States Naval Academy](https://www.usna.edu/Users/cs/wcbrown/courses/S17SI335/notes/03/notes.html)
5. [The Extended Euclidean Algorithm, University of Western Ontario CS 424 lecture notes](https://www.csd.uwo.ca/~mmorenom/CS424/Lectures/EuclideanMethods.html/node4.html)
6. [NTIC: The Bezout Identity, Gordon College](https://math-cs.gordon.edu/ntic/ntic2017/section-bezout-id.html)
7. [GNU MP 6.2.1 Manual, Chapter 5: Integer Functions](https://gmplib.org/gmp-man-6.2.1.pdf)
8. [21-110: The extended Euclidean algorithm, Carnegie Mellon University](https://www.math.cmu.edu/~bkell/21110-2010s/extended-euclidean.html)
9. [Optimized quantum implementation of elliptic curve arithmetic over binary fields, arXiv](https://arxiv.org/abs/quant-ph/0407095)
10. [Jeffrey Shallit (1994). Origins of the analysis of the Euclidean algorithm. Historia Mathematica 21(4), 401–419.](https://www.sciencedirect.com/science/article/pii/S0315086084710317)
11. [A rigorous version of R. P. Brent's model for the binary Euclidean algorithm, arXiv](https://arxiv.org/abs/1409.0729)
12. [Modular arithmetic before C.F. Gauss, Historia Mathematica](https://www.sciencedirect.com/science/article/pii/S0315086008000670)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: भौतिक जगत और गणित › गणित और सांख्यिकी › संख्याएँ और बीजगणित › Number theory › Elementary number theory › Divisibility, GCD, and the integers

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/hi/extended-euclidean-algorithm

English original: https://www.edgepedia.org/extended-euclidean-algorithm
