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-167Lcm Gcd
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
    12 min read
    Topic 36 of 67
    Topic Study Note Illustration
    36

    LCM and GCD

    The Least Common Multiple (LCM) and Greatest Common Divisor (GCD) are two fundamental concepts in number theory. They are used to find common multiples and divisors of...

    LCM and GCD

    The Least Common Multiple (LCM) and Greatest Common Divisor (GCD) are two fundamental concepts in number theory. They are used to find common multiples and divisors of integers, and they have important applications in solving problems related to divisibility, fractions, and many other areas of mathematics.


    1. Greatest Common Divisor (GCD)

    The GCD of two integers aaa and bbb is the largest positive integer that divides both aaa and bbb without leaving a remainder. The GCD is also known as the Greatest Common Factor (GCF).

    Formal Definition:

    The GCD of two integers aaa and bbb, denoted by gcd⁡(a,b)\gcd(a, b)gcd(a,b), is the largest integer ddd such that:

    d∣aandd∣bd \mid a \quad \text{and} \quad d \mid bd∣aandd∣b

    This means that ddd divides both aaa and bbb exactly.

    Example:

    Find gcd⁡(12,18)\gcd(12, 18)gcd(12,18):

    • The divisors of 12: 1,2,3,4,6,121, 2, 3, 4, 6, 121,2,3,4,6,12
    • The divisors of 18: 1,2,3,6,9,181, 2, 3, 6, 9, 181,2,3,6,9,18

    The common divisors of 12 and 18 are 1,2,3,61, 2, 3, 61,2,3,6, and the greatest of these is 6. Therefore:

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

    Properties of GCD:

    • Commutative: gcd⁡(a,b)=gcd⁡(b,a)\gcd(a, b) = \gcd(b, a)gcd(a,b)=gcd(b,a)
    • Associative: gcd⁡(a,gcd⁡(b,c))=gcd⁡(gcd⁡(a,b),c)\gcd(a, \gcd(b, c)) = \gcd(\gcd(a, b), c)gcd(a,gcd(b,c))=gcd(gcd(a,b),c)
    • Distributive over LCM: gcd⁡(a,b)×lcm(a,b)=∣a×b∣\gcd(a, b) \times \text{lcm}(a, b) = |a \times b|gcd(a,b)×lcm(a,b)=∣a×b∣

    2. Least Common Multiple (LCM)

    The LCM of two integers aaa and bbb is the smallest positive integer that is divisible by both aaa and bbb. In other words, it is the smallest number that both aaa and bbb divide into exactly.

    Formal Definition:

    The LCM of two integers aaa and bbb, denoted by lcm(a,b)\text{lcm}(a, b)lcm(a,b), is the smallest integer mmm such that:

    a∣mandb∣ma \mid m \quad \text{and} \quad b \mid ma∣mandb∣m

    This means that mmm is divisible by both aaa and bbb.

    Example:

    Find lcm(12,18)\text{lcm}(12, 18)lcm(12,18):

    • The multiples of 12 are 12,24,36,48,60,…12, 24, 36, 48, 60, \dots12,24,36,48,60,…
    • The multiples of 18 are 18,36,54,72,…18, 36, 54, 72, \dots18,36,54,72,…

    The smallest common multiple of 12 and 18 is 36. Therefore:

    lcm(12,18)=36\text{lcm}(12, 18) = 36lcm(12,18)=36

    Properties of LCM:

    • Commutative: lcm(a,b)=lcm(b,a)\text{lcm}(a, b) = \text{lcm}(b, a)lcm(a,b)=lcm(b,a)
    • Associative: lcm(a,lcm(b,c))=lcm(lcm(a,b),c)\text{lcm}(a, \text{lcm}(b, c)) = \text{lcm}(\text{lcm}(a, b), c)lcm(a,lcm(b,c))=lcm(lcm(a,b),c)
    • Distributive over GCD: gcd⁡(a,b)×lcm(a,b)=∣a×b∣\gcd(a, b) \times \text{lcm}(a, b) = |a \times b|gcd(a,b)×lcm(a,b)=∣a×b∣

    3. Relationship Between LCM and GCD

    There is a key relationship between the LCM and GCD of two numbers. It is given by:

    gcd⁡(a,b)×lcm(a,b)=∣a×b∣\gcd(a, b) \times \text{lcm}(a, b) = |a \times b|gcd(a,b)×lcm(a,b)=∣a×b∣

    This means that the product of the GCD and the LCM of two numbers is equal to the product of the numbers themselves.

    Example:

    Let’s verify this relationship for a=12a = 12a=12 and b=18b = 18b=18:

    We know:

    • gcd⁡(12,18)=6\gcd(12, 18) = 6gcd(12,18)=6
    • lcm(12,18)=36\text{lcm}(12, 18) = 36lcm(12,18)=36

    Now, check the relationship:

    gcd⁡(12,18)×lcm(12,18)=6×36=216\gcd(12, 18) \times \text{lcm}(12, 18) = 6 \times 36 = 216gcd(12,18)×lcm(12,18)=6×36=216

    and

    ∣12×18∣=∣216∣=216|12 \times 18| = |216| = 216∣12×18∣=∣216∣=216

    Thus, the equation holds true:

    6×36=12×186 \times 36 = 12 \times 186×36=12×18

    4. Methods to Calculate GCD and LCM

    Euclidean Algorithm (for GCD)

    The Euclidean Algorithm is an efficient method for computing the GCD of two numbers. It works by repeatedly applying the division algorithm and replacing the larger number by the remainder until the remainder is zero. The last non-zero remainder is the GCD.

    Steps:

    1. Divide the larger number by the smaller number.
    2. Replace the larger number with the remainder from the division.
    3. Repeat until the remainder is zero. The GCD is the last non-zero remainder.
    Example: Find gcd⁡(48,18)\gcd(48, 18)gcd(48,18)
    1. Divide 48 by 18:

      48÷18=2(quotient),48−2×18=12(remainder)48 \div 18 = 2 \quad \text{(quotient)}, \quad 48 - 2 \times 18 = 12 \quad \text{(remainder)}48÷18=2(quotient),48−2×18=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−1×12=6(remainder)18 \div 12 = 1 \quad \text{(quotient)}, \quad 18 - 1 \times 12 = 6 \quad \text{(remainder)}18÷12=1(quotient),18−1×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−2×6=0(remainder)12 \div 6 = 2 \quad \text{(quotient)}, \quad 12 - 2 \times 6 = 0 \quad \text{(remainder)}12÷6=2(quotient),12−2×6=0(remainder)

      The remainder is zero, so the GCD is 6.

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

    Finding LCM Using GCD:

    The LCM can be calculated using the formula:

    lcm(a,b)=∣a×b∣gcd⁡(a,b)\text{lcm}(a, b) = \frac{|a \times b|}{\gcd(a, b)}lcm(a,b)=gcd(a,b)∣a×b∣​
    Example:

    Find lcm(12,18)\text{lcm}(12, 18)lcm(12,18):

    We already know that:

    • gcd⁡(12,18)=6\gcd(12, 18) = 6gcd(12,18)=6
    • ∣12×18∣=216|12 \times 18| = 216∣12×18∣=216

    Now, using the formula for LCM:

    lcm(12,18)=2166=36\text{lcm}(12, 18) = \frac{216}{6} = 36lcm(12,18)=6216​=36

    Thus, lcm(12,18)=36\text{lcm}(12, 18) = 36lcm(12,18)=36.


    5. Applications of LCM and GCD

    1. Simplifying Fractions:

      • The GCD is used to simplify fractions. For example, to simplify 1218\frac{12}{18}1812​, divide both the numerator and the denominator by gcd⁡(12,18)=6\gcd(12, 18) = 6gcd(12,18)=6:
      1218=12÷618÷6=23\frac{12}{18} = \frac{12 \div 6}{18 \div 6} = \frac{2}{3}1812​=18÷612÷6​=32​
    2. Finding Common Denominators:

      • When adding or subtracting fractions, the LCM of the denominators is used to find a common denominator.
    3. Solving Diophantine Equations:

      • Diophantine equations, which are equations that seek integer solutions, often involve the GCD and LCM.
    4. Cryptography:

      • In encryption algorithms like RSA, the GCD plays a crucial role in finding keys and ensuring security.
    5. Scheduling Problems:

      • The LCM is used in problems where you need to find common intervals of recurring events (e.g., two events repeating every 12 days and 18 days will both coincide every lcm(12,18)=36\text{lcm}(12, 18) = 36lcm(12,18)=36 days).

    6. Conclusion

    The GCD is the largest divisor shared by two numbers, while the LCM is the smallest multiple shared by the two numbers. The relationship between the GCD and LCM is important, as it helps simplify many number-theoretic problems. The Euclidean algorithm provides an efficient way to compute the GCD, and once the GCD is known, the LCM can be easily calculated. These concepts have wide applications in number theory, cryptography, scheduling, and many other areas.

    ← Previous topic 35
    Modular Arithmetic
    Next topic 37 →
    Euclidean and Extended Euclidean Method

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    12mremaining
    2.0kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Discrete Structures