ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalGE-167Euclidean Extended Euc…
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    GE-167

    Discrete Structures

    Progress0 / 67 done
    Topics67
    1Propositional and Predicate Logic
    2Logical Operators3Translations Between Symbolic Expressions and Formal English Expression4Logical Equivalences
    5Quantifiers6Nested Quantification7Equivalences in Predicate Logic8Translations Between Symbolic Forms and Formal English
    9Proof Methods and Strategies10Direct Proof11Proof by Contraposition12Proof by Induction13Proof by Implication14Existence Proof15Uniqueness Proofs16Trivial Proofs17Vacuous Proofs
    18Notations and Set Operations19Venn Diagrams20Countable and Uncountable Sets
    21Equivalence Relations and Partitions22Partial Orderings23Recurrence Relations51Reflexive, Symmetric, Transitive, and Antisymmetric52Equivalence Relations and Equivalence Classes53Partial Orders
    24Injective, Surjective, Bijective25Special Types of Functions26Function Composition27Inverse Functions28Recursive Functions29Compositions
    30Sequences and Series
    31Inclusion and Exclusion Principle32Pigeonhole Principle33Permutations and Combinations46Product Rule and Sum Rule47Principle of Inclusion-Exclusion48Binomial Coefficients49Pascal's Identity and Pascal’s Triangle50Binomial Theorem
    34Division Theorem35Modular Arithmetic36LCM and GCD37Euclidean and Extended Euclidean Method38Finding Solutions to Congruence
    39Fundamental Theorem of Arithmetic40Characterizations of Primes41Mersenne Primes
    42Weak Induction43Strong Induction
    44Formulation of Recurrences45Closed Formulas
    54Terminologies55Elements of Graph Theory56Planar Graphs57Graph Coloring58Euler Graph59Hamiltonian Path60Rooted Trees61Graph Traversals62Handshaking Lemma and Corollary63Special Families of Graphs64Graph Isomorphism65Planarity in Graphs66Eulerian and Hamiltonian Graphs67Trees in Graph Theory
    10 min read
    Topic 37 of 67
    Topic Study Note Illustration
    37

    Euclidean and Extended Euclidean Method

    The Euclidean Algorithm and Extended Euclidean Algorithm are two fundamental methods in number theory used to compute the Greatest Common Divisor (GCD) of two integers. The Euclidean...

    Euclidean Algorithm and Extended Euclidean Algorithm

    The Euclidean Algorithm and Extended Euclidean Algorithm are two fundamental methods in number theory used to compute the Greatest Common Divisor (GCD) of two integers. The Euclidean Algorithm is a classic, efficient method for finding the GCD, while the Extended Euclidean Algorithm also computes additional information, such as the coefficients of the linear combination of the integers involved.


    1. Euclidean Algorithm

    The Euclidean Algorithm is an efficient method for finding the GCD of two integers aaa and bbb. It works by repeatedly applying the division algorithm (dividing the larger number by the smaller one and replacing the larger number with the remainder) until the remainder is zero. The last non-zero remainder is the GCD of the two numbers.

    Steps to Apply the Euclidean Algorithm:

    1. Given two numbers aaa and bbb, where a>ba > ba>b, divide aaa by bbb and obtain the quotient and remainder:

      a=b×q+ra = b \times q + ra=b×q+r

      where qqq is the quotient and rrr is the remainder.

    2. Replace aaa with bbb and bbb with rrr, and repeat the process until r=0r = 0r=0.

    3. When the remainder becomes zero, the GCD is the last non-zero remainder.

    Example: Finding gcd⁡(48,18)\gcd(48, 18)gcd(48,18)

    Let’s use the Euclidean algorithm to find gcd⁡(48,18)\gcd(48, 18)gcd(48,18):

    1. Divide 48 by 18:

      48÷18=2(quotient),48−18×2=48−36=12(remainder)48 \div 18 = 2 \quad \text{(quotient)}, \quad 48 - 18 \times 2 = 48 - 36 = 12 \quad \text{(remainder)}48÷18=2(quotient),48−18×2=48−36=12(remainder)

      So, gcd⁡(48,18)=gcd⁡(18,12)\gcd(48, 18) = \gcd(18, 12)gcd(48,18)=gcd(18,12).

    2. Divide 18 by 12:

      18÷12=1(quotient),18−12×1=18−12=6(remainder)18 \div 12 = 1 \quad \text{(quotient)}, \quad 18 - 12 \times 1 = 18 - 12 = 6 \quad \text{(remainder)}18÷12=1(quotient),18−12×1=18−12=6(remainder)

      So, gcd⁡(18,12)=gcd⁡(12,6)\gcd(18, 12) = \gcd(12, 6)gcd(18,12)=gcd(12,6).

    3. Divide 12 by 6:

      12÷6=2(quotient),12−6×2=12−12=0(remainder)12 \div 6 = 2 \quad \text{(quotient)}, \quad 12 - 6 \times 2 = 12 - 12 = 0 \quad \text{(remainder)}12÷6=2(quotient),12−6×2=12−12=0(remainder)

      The remainder is now 0, so the GCD is 6.

    Thus, gcd⁡(48,18)=6\gcd(48, 18) = 6gcd(48,18)=6.


    2. Extended Euclidean Algorithm

    The Extended Euclidean Algorithm not only computes the GCD of two integers aaa and bbb, but also finds the coefficients xxx and yyy (called Bezout coefficients) such that:

    a×x+b×y=gcd⁡(a,b)a \times x + b \times y = \gcd(a, b)a×x+b×y=gcd(a,b)

    In other words, the Extended Euclidean Algorithm expresses the GCD of aaa and bbb as a linear combination of aaa and bbb.

    This is particularly useful in many areas, such as modular arithmetic, where we need to find the modular inverse of a number.

    Steps to Apply the Extended Euclidean Algorithm:

    1. Use the Euclidean algorithm to find the GCD of aaa and bbb.
    2. While performing the steps of the Euclidean algorithm, also keep track of the coefficients of aaa and bbb in the linear combinations.
    3. After completing the Euclidean algorithm, backtrack through the steps to express the GCD as a linear combination of aaa and bbb.

    Example: Extended Euclidean Algorithm for gcd⁡(48,18)\gcd(48, 18)gcd(48,18)

    We will use the Extended Euclidean Algorithm to find the GCD and the Bezout coefficients for gcd⁡(48,18)\gcd(48, 18)gcd(48,18).

    1. Start by applying the Euclidean algorithm:

      48÷18=2(quotient),48−18×2=12(remainder)48 \div 18 = 2 \quad \text{(quotient)}, \quad 48 - 18 \times 2 = 12 \quad \text{(remainder)}48÷18=2(quotient),48−18×2=12(remainder)

      So, gcd⁡(48,18)=gcd⁡(18,12)\gcd(48, 18) = \gcd(18, 12)gcd(48,18)=gcd(18,12).

      18÷12=1(quotient),18−12×1=6(remainder)18 \div 12 = 1 \quad \text{(quotient)}, \quad 18 - 12 \times 1 = 6 \quad \text{(remainder)}18÷12=1(quotient),18−12×1=6(remainder)

      So, gcd⁡(18,12)=gcd⁡(12,6)\gcd(18, 12) = \gcd(12, 6)gcd(18,12)=gcd(12,6).

      12÷6=2(quotient),12−6×2=0(remainder)12 \div 6 = 2 \quad \text{(quotient)}, \quad 12 - 6 \times 2 = 0 \quad \text{(remainder)}12÷6=2(quotient),12−6×2=0(remainder)

      The remainder is now 0, so the GCD is 6.

    2. Now, backtrack to express 6 as a linear combination of 48 and 18:

      • From 18−12×1=618 - 12 \times 1 = 618−12×1=6, we have: 6=18−12×16 = 18 - 12 \times 16=18−12×1
      • From 48−18×2=1248 - 18 \times 2 = 1248−18×2=12, we substitute 121212 from the previous step: 12=48−18×212 = 48 - 18 \times 212=48−18×2 Substituting this into the equation for 6: 6=18−(48−18×2)×16 = 18 - (48 - 18 \times 2) \times 16=18−(48−18×2)×1 Simplifying: 6=18−48+18×26 = 18 - 48 + 18 \times 26=18−48+18×2 6=3×18−486 = 3 \times 18 - 486=3×18−48

    Thus, we have expressed 6 as a linear combination of 48 and 18:

    6=3×18−1×486 = 3 \times 18 - 1 \times 486=3×18−1×48

    So, the Bezout coefficients are x=−1x = -1x=−1 and y=3y = 3y=3.

    This means that:

    48×(−1)+18×3=648 \times (-1) + 18 \times 3 = 648×(−1)+18×3=6

    General Formula:

    If you run the Extended Euclidean Algorithm on integers aaa and bbb, you will get gcd⁡(a,b)=ax+by\gcd(a, b) = ax + bygcd(a,b)=ax+by, where xxx and yyy are the coefficients of aaa and bbb in the linear combination.


    3. Applications of the Extended Euclidean Algorithm

    • Modular Inverse: One of the most common applications of the Extended Euclidean Algorithm is finding the modular inverse of a number. If aaa and mmm are coprime (i.e., gcd⁡(a,m)=1\gcd(a, m) = 1gcd(a,m)=1), then the modular inverse of aaa modulo mmm is the xxx-coefficient in the equation ax+my=1ax + my = 1ax+my=1. The modular inverse is useful in cryptographic algorithms like RSA.

    • Diophantine Equations: The Extended Euclidean Algorithm is used to find integer solutions to linear Diophantine equations of the form ax+by=cax + by = cax+by=c.

    • Cryptography: In RSA and other cryptographic systems, the Extended Euclidean Algorithm is used to compute the private key from the public key.

    • Solving Linear Systems: The algorithm can be used to solve systems of linear equations where the coefficients are integers.


    4. Conclusion

    • The Euclidean Algorithm is a fast method for computing the GCD of two integers by repeated division and finding remainders.
    • The Extended Euclidean Algorithm not only computes the GCD but also finds the coefficients (Bezout coefficients) that express the GCD as a linear combination of the two integers. This is crucial for solving problems like finding modular inverses and solving Diophantine equations.
    ← Previous topic 36
    LCM and GCD
    Next topic 38 →
    Finding Solutions to Congruence

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    10mremaining
    1.7kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Discrete Structures