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-167Finding Solutions Cong…
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 38 of 67
    Topic Study Note Illustration
    38

    Finding Solutions to Congruence

    A congruence is a mathematical statement that expresses a relationship between two numbers with respect to a modulus. The general form of a congruence is:

    Finding Solutions to Congruences

    A congruence is a mathematical statement that expresses a relationship between two numbers with respect to a modulus. The general form of a congruence is:

    a≡b(modm)a \equiv b \pmod{m}a≡b(modm)

    which reads as "a is congruent to b modulo m", meaning that when aaa and bbb are divided by mmm, they leave the same remainder. In other words, mmm divides a−ba - ba−b. Solving congruences involves finding values of aaa that satisfy the given congruence.

    1. Linear Congruences

    A linear congruence is an equation of the form:

    ax≡b(modm)ax \equiv b \pmod{m}ax≡b(modm)

    where aaa, bbb, and mmm are given integers, and xxx is the unknown we need to solve for. To solve a linear congruence, we want to find all values of xxx that satisfy this equation modulo mmm.

    Steps to Solve a Linear Congruence ax≡b(modm)ax \equiv b \pmod{m}ax≡b(modm):

    1. Check if a solution exists: A solution to the linear congruence ax≡b(modm)ax \equiv b \pmod{m}ax≡b(modm) exists if and only if the greatest common divisor gcd⁡(a,m)\gcd(a, m)gcd(a,m) divides bbb. That is, the equation has a solution if and only if:

      gcd⁡(a,m)∣b\gcd(a, m) \mid bgcd(a,m)∣b

      If this condition is not satisfied, then the congruence has no solution.

    2. Simplify the equation (if possible): If gcd⁡(a,m)=d\gcd(a, m) = dgcd(a,m)=d, then we can divide the entire equation by ddd to simplify it. After dividing, the modulus will be reduced by dividing by ddd, and the new congruence will be:

      adx≡bd(modmd)\frac{a}{d} x \equiv \frac{b}{d} \pmod{\frac{m}{d}}da​x≡db​(moddm​)
    3. Use the Extended Euclidean Algorithm: If gcd⁡(a,m)=1\gcd(a, m) = 1gcd(a,m)=1, the linear congruence ax≡b(modm)ax \equiv b \pmod{m}ax≡b(modm) can be solved using the Extended Euclidean Algorithm. This method will help find the multiplicative inverse of aaa modulo mmm, denoted by a−1a^{-1}a−1, such that:

      a⋅a−1≡1(modm)a \cdot a^{-1} \equiv 1 \pmod{m}a⋅a−1≡1(modm)

      Once the inverse is found, multiply both sides of the congruence ax≡b(modm)ax \equiv b \pmod{m}ax≡b(modm) by a−1a^{-1}a−1 to solve for xxx:

      x≡a−1⋅b(modm)x \equiv a^{-1} \cdot b \pmod{m}x≡a−1⋅b(modm)
    4. General Solution: If gcd⁡(a,m)=d>1\gcd(a, m) = d > 1gcd(a,m)=d>1, after dividing by ddd, we find the solution to the reduced congruence. The general solution will be given by:

      x=x0+k⋅mdx = x_0 + k \cdot \frac{m}{d}x=x0​+k⋅dm​

      where x0x_0x0​ is a particular solution, and kkk is any integer.

    2. Example 1: Solving a Linear Congruence

    Solve the congruence 3x≡12(mod15)3x \equiv 12 \pmod{15}3x≡12(mod15).

    1. Check if a solution exists: First, compute gcd⁡(3,15)\gcd(3, 15)gcd(3,15):

      gcd⁡(3,15)=3\gcd(3, 15) = 3gcd(3,15)=3

      Since 3∣123 \mid 123∣12, a solution exists.

    2. Simplify the equation: Divide the entire congruence by gcd⁡(3,15)=3\gcd(3, 15) = 3gcd(3,15)=3:

      33x≡123(mod153)\frac{3}{3} x \equiv \frac{12}{3} \pmod{\frac{15}{3}}33​x≡312​(mod315​)

      This simplifies to:

      x≡4(mod5)x \equiv 4 \pmod{5}x≡4(mod5)
    3. Solve the simplified congruence: The simplified congruence is x≡4(mod5)x \equiv 4 \pmod{5}x≡4(mod5), which has the solution x=4+5kx = 4 + 5kx=4+5k for any integer kkk.

    4. General solution: The general solution to the original congruence is:

      x=4+5kfor any integer kx = 4 + 5k \quad \text{for any integer} \, kx=4+5kfor any integerk

      This means x=4,9,14,19,…x = 4, 9, 14, 19, \dotsx=4,9,14,19,….


    3. Solving Systems of Congruences: Chinese Remainder Theorem (CRT)

    The Chinese Remainder Theorem (CRT) is a method used to solve a system of simultaneous linear congruences, where each congruence has the same modulus or different moduli. The CRT guarantees that if the moduli are pairwise coprime (i.e., their pairwise GCDs are 1), then there is a unique solution modulo the product of the moduli.

    General Form:

    Solve the system of congruences:

    x≡a1(modm1)x \equiv a_1 \pmod{m_1}x≡a1​(modm1​) x≡a2(modm2)x \equiv a_2 \pmod{m_2}x≡a2​(modm2​) ⋮\vdots⋮ x≡an(modmn)x \equiv a_n \pmod{m_n}x≡an​(modmn​)

    where m1,m2,…,mnm_1, m_2, \dots, m_nm1​,m2​,…,mn​ are pairwise coprime.

    Steps to Solve Using the Chinese Remainder Theorem:

    1. Find the product of all moduli: Let M=m1×m2×⋯×mnM = m_1 \times m_2 \times \dots \times m_nM=m1​×m2​×⋯×mn​.

    2. Compute partial products: For each iii, calculate Mi=MmiM_i = \frac{M}{m_i}Mi​=mi​M​, which is the product of all moduli except mim_imi​.

    3. Find the modular inverses: For each iii, find the inverse of MiM_iMi​ modulo mim_imi​, denoted by yiy_iyi​, such that:

      Mi⋅yi≡1(modmi)M_i \cdot y_i \equiv 1 \pmod{m_i}Mi​⋅yi​≡1(modmi​)
    4. Form the solution: The solution to the system of congruences is:

      x=∑i=1nai⋅Mi⋅yi(modM)x = \sum_{i=1}^{n} a_i \cdot M_i \cdot y_i \pmod{M}x=i=1∑n​ai​⋅Mi​⋅yi​(modM)

      where MMM is the product of all the moduli.


    4. Example 2: Solving a System Using the Chinese Remainder Theorem

    Solve the system of congruences:

    x≡2(mod3)x \equiv 2 \pmod{3}x≡2(mod3) x≡3(mod5)x \equiv 3 \pmod{5}x≡3(mod5)
    1. Find the product of the moduli:

      M=3×5=15M = 3 \times 5 = 15M=3×5=15
    2. Compute the partial products:

      • M1=153=5M_1 = \frac{15}{3} = 5M1​=315​=5
      • M2=155=3M_2 = \frac{15}{5} = 3M2​=515​=3
    3. Find the modular inverses:

      • Find y1y_1y1​ such that 5⋅y1≡1(mod3)5 \cdot y_1 \equiv 1 \pmod{3}5⋅y1​≡1(mod3):

        5≡2(mod3)so2⋅y1≡1(mod3)5 \equiv 2 \pmod{3} \quad \text{so} \quad 2 \cdot y_1 \equiv 1 \pmod{3}5≡2(mod3)so2⋅y1​≡1(mod3)

        The inverse of 2 modulo 3 is 2, so y1=2y_1 = 2y1​=2.

      • Find y2y_2y2​ such that 3⋅y2≡1(mod5)3 \cdot y_2 \equiv 1 \pmod{5}3⋅y2​≡1(mod5):

        3⋅2=6≡1(mod5)soy2=23 \cdot 2 = 6 \equiv 1 \pmod{5} \quad \text{so} \quad y_2 = 23⋅2=6≡1(mod5)soy2​=2
    4. Form the solution: The solution is:

      x=(2⋅5⋅2)+(3⋅3⋅2)(mod15)x = (2 \cdot 5 \cdot 2) + (3 \cdot 3 \cdot 2) \pmod{15}x=(2⋅5⋅2)+(3⋅3⋅2)(mod15) x=(20)+(18)=38(mod15)x = (20) + (18) = 38 \pmod{15}x=(20)+(18)=38(mod15) x≡8(mod15)x \equiv 8 \pmod{15}x≡8(mod15)

    Thus, the solution to the system is x≡8(mod15)x \equiv 8 \pmod{15}x≡8(mod15).


    5. Conclusion

    • To solve a linear congruence ax≡b(modm)ax \equiv b \pmod{m}ax≡b(modm), check if gcd⁡(a,m)\gcd(a, m)gcd(a,m) divides bbb. If it does, simplify the equation and use the Extended Euclidean Algorithm to solve for xxx.
    • The Chinese Remainder Theorem provides a method for solving systems of simultaneous congruences when the moduli are pairwise coprime.
    • Solving congruences is important in number theory and has applications in cryptography, computer science, and coding theory.
    ← Previous topic 37
    Euclidean and Extended Euclidean Method
    Next topic 39 →
    Primes: Fundamental Theorem of Arithmetic

    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.1kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Discrete Structures