100% FREE
Updated: Mar 2026 Number Theory Fundamentals of Number Theory
Modular Arithmetic
Comprehensive study notes on Modular Arithmetic for CMI Data Science preparation.
This chapter covers key concepts, formulas, and examples needed for your exam.
Welcome to the chapter on Modular Arithmetic, a foundational concept in Number Theory that is indispensable for a wide array of applications in computer science and data science. At its core, modular arithmetic is about working with integers and their remainders after division, effectively creating a system where numbers "wrap around" upon reaching a certain value. This cyclical nature allows us to model phenomena that repeat, manage finite data structures, and perform computations efficiently within constrained systems.
For your CMI studies, a solid grasp of modular arithmetic is not merely academic; it's a critical skill for understanding and solving problems in computational mathematics. You'll find its principles underpinning essential data science domains such as cryptography (e.g., public-key encryption, hashing algorithms), error detection and correction codes, random number generation, and efficient data indexing. Proficiency in this area is frequently tested in CMI examinations, not just for direct application but also as a fundamental tool for tackling more complex algorithmic and computational challenges. Mastering this chapter will equip you with a powerful mathematical toolkit, enhancing your problem-solving capabilities and preparing you for advanced topics in secure data handling and efficient algorithm design.
---
Chapter Contents
| # | Topic | What You'll Learn | |---|-------|-------------------| | 1 | Congruence Relations | Define congruence and explore its fundamental properties. | | 2 | Operations in Modular Arithmetic | Perform addition, subtraction, multiplication, and division. |
---
Learning Objectives
βBy the End of This Chapter
After studying this chapter, you will be able to:
Define and apply the concept of congruence modulo n, and identify its fundamental properties.
Perform addition, subtraction, and multiplication operations within modular systems.
Compute modular multiplicative inverses and utilize them for modular division.
Apply modular arithmetic techniques to solve problems involving integer properties and computational cycles.
---
Now let's begin with Congruence Relations...
Part 1: Congruence Relations
Introduction
Congruence relations form a fundamental building block in number theory, providing a powerful framework for analyzing divisibility and remainders. This topic is essential for the CMI Masters in Data Science exam as it underpins various algorithms and theoretical concepts in cryptography, error-correcting codes, and computational number theory. Understanding congruence allows us to simplify complex arithmetic problems by focusing on the properties of integers modulo a given number. These notes will cover the core definitions, properties, and applications of congruence relations, preparing you to tackle diverse problems in the CMI exam effectively.
πCongruence Relation
Let a,b be integers and m be a positive integer. We say that a is congruent to b modulo m, written as aβ‘b(modm), if m divides the difference aβb.
Mathematically, this means:
mβ£(aβb)βΊaβb=kmΒ forΒ someΒ integerΒ k
Equivalently, a and b have the same remainder when divided by m.
a=q1βm+randb=q2βm+r
where 0β€r<m.
---
---
Key Concepts
1. Definition and Basic Properties
The congruence relation aβ‘b(modm) establishes an equivalence relation on the set of integers Z.
Properties of Congruence:
Reflexivity: For any integer a, aβ‘a(modm).
Explanation:* aβa=0, and m divides 0 (since 0=0β m).
Symmetry: If aβ‘b(modm), then bβ‘a(modm).
Explanation:* If mβ£(aβb), then aβb=km. This implies bβa=βkm=(βk)m, so mβ£(bβa).
Transitivity: If aβ‘b(modm) and bβ‘c(modm), then aβ‘c(modm).
Explanation:* If mβ£(aβb) and mβ£(bβc), then aβb=k1βm and bβc=k2βm for some integers k1β,k2β. Adding these equations: (aβb)+(bβc)=k1βm+k2βm
aβc=(k1β+k2β)m
Since k1β+k2β is an integer, mβ£(aβc), so aβ‘c(modm).
Algebraic Properties:
If aβ‘b(modm) and cβ‘d(modm), then:
Addition:a+cβ‘b+d(modm).
Explanation:* (a+c)β(b+d)=(aβb)+(cβd). Since mβ£(aβb) and mβ£(cβd), m divides their sum.
Subtraction:aβcβ‘bβd(modm).
Explanation:* Similar to addition, m divides (aβb) and m divides (cβd), so m divides (aβb)β(cβd).
Multiplication:acβ‘bd(modm).
Explanation:* acβbd=acβbc+bcβbd=c(aβb)+b(cβd). Since mβ£(aβb) and mβ£(cβd), m divides both terms, and thus their sum.
Exponentiation:anβ‘bn(modm) for any positive integer n.
Explanation:* This follows from repeated application of the multiplication property.
Division (with caution): If acβ‘bc(modm), then aβ‘b(modm/gcd(c,m)).
Explanation:* If acβ‘bc(modm), then mβ£c(aβb). Let d=gcd(c,m). Then m=dβ mβ² and c=dβ cβ² where gcd(cβ²,mβ²)=1. So dβ mβ²β£dβ cβ²(aβb), which implies mβ²β£cβ²(aβb). Since gcd(cβ²,mβ²)=1, we must have mβ²β£(aβb). Thus, aβ‘b(modmβ²), or aβ‘b(modm/gcd(c,m)). Crucial point: If gcd(c,m)=1, then aβ‘b(modm). This means we can "divide by c" if c is coprime to m.
Worked Example:
Problem: Find the remainder when 2100 is divided by 3.
Solution:
Step 1: Simplify the base modulo 3.
2β‘β1(mod3)
Step 2: Apply the exponentiation property.
2100β‘(β1)100(mod3)
Step 3: Evaluate the result.
(β1)100=1
2100β‘1(mod3)
Answer:1
---
2. Residue Classes and Systems
The congruence relation partitions the set of integers Z into disjoint sets called residue classes (or congruence classes) modulo m. Each residue class consists of all integers that have the same remainder when divided by m.
πResidue Class
For an integer a and a positive integer m, the residue class of a modulo m, denoted by [a]mβ or aΛ, is the set of all integers congruent to a modulo m:
[a]mβ={xβZβ£xβ‘a(modm)}
[a]mβ={a+kmβ£kβZ}
For example, modulo 3, the residue classes are: [0]3β={β¦,β6,β3,0,3,6,β¦} [1]3β={β¦,β5,β2,1,4,7,β¦} [2]3β={β¦,β4,β1,2,5,8,β¦}
Complete Residue System: A set of integers {r1β,r2β,β¦,rmβ} is called a complete residue system modulo m if every integer is congruent to exactly one element in the set. The most common complete residue system is {0,1,2,β¦,mβ1}, which are the least non-negative residues.
Worked Example:
Problem: Identify the complete residue system modulo 5 from the set {β10,β3,2,9,16}.
Solution:
Step 1: Find the least non-negative residue for each element modulo 5.
β10β‘0(mod5)
β3β‘2(mod5)
2β‘2(mod5)
9β‘4(mod5)
16β‘1(mod5)
Step 2: Check if the set of residues forms {0,1,2,3,4}.
The set of residues is {0,2,2,4,1}. This set contains 2 twice and misses 3.
Answer: The given set is not a complete residue system modulo 5 because it contains duplicate residues (2) and misses one residue (3). A valid complete residue system would be {0,1,2,4,16} or {β10,16,2,9,β1}.
---
3. Modular Arithmetic Operations
Modular arithmetic is the system of arithmetic for integers, where numbers "wrap around" when reaching a certain valueβthe modulus. This is precisely the arithmetic of residue classes.
Operations on Residue Classes:
If [a]mβ and [b]mβ are two residue classes modulo m, their sum, difference, and product are defined as:
Addition:[a]mβ+[b]mβ=[a+b]mβ
Subtraction:[a]mββ[b]mβ=[aβb]mβ
Multiplication:[a]mββ [b]mβ=[ab]mβ
These operations are well-defined, meaning the result does not depend on the choice of representatives a and b from their respective classes.
Worked Example:
Problem: Calculate (17+23)(mod7) and (17Γ23)(mod7).
Solution:
Step 1: Simplify the numbers modulo 7.
17β‘3(mod7)
23β‘2(mod7)
Step 2: Perform addition modulo 7.
17+23β‘3+2(mod7)
17+23β‘5(mod7)
Step 3: Perform multiplication modulo 7.
17Γ23β‘3Γ2(mod7)
17Γ23β‘6(mod7)
Answer:(17+23)(mod7)=5 and (17Γ23)(mod7)=6.
---
---
4. Solving Linear Congruences
A linear congruence is an equation of the form axβ‘b(modm). Solving this means finding all integers x that satisfy the congruence.
πSolving Linear Congruences
The linear congruence axβ‘b(modm) has solutions if and only if gcd(a,m) divides b. If gcd(a,m)=d and dβ£b, then there are exactly d incongruent solutions modulo m. These solutions can be found by first solving the reduced congruence:
daβxβ‘dbβ(moddmβ)
This reduced congruence has a unique solution modulo m/d. Let this unique solution be x0β. Then the d incongruent solutions modulo m are:
xkβ=x0β+k(dmβ)(modm)forΒ k=0,1,β¦,dβ1
Variables:
a,b: Integers
m: Positive integer modulus
x: Integer variable to solve for
d: gcd(a,m)
When to use: When finding integer solutions to equations involving congruences.
Modular Inverse: If axβ‘1(modm) has a solution, x is called the modular multiplicative inverse of a modulo m. This exists if and only if gcd(a,m)=1. If an inverse aβ1 exists, then axβ‘b(modm) can be solved by multiplying both sides by aβ1: xβ‘aβ1b(modm). Extended Euclidean Algorithm is commonly used to find modular inverses.
Worked Example:
Problem: Solve the linear congruence 6xβ‘9(mod15).
Solution:
Step 1: Calculate d=gcd(a,m).
a=6,m=15βΉgcd(6,15)=3
Step 2: Check if d divides b.
b=9βΉ3β£9
Since 3β£9, there are 3 incongruent solutions modulo 15.
Step 3: Solve the reduced congruence.
Divide a,b,m by d=3:
36βxβ‘39β(mod315β)
2xβ‘3(mod5)
Step 4: Find the unique solution to the reduced congruence. We need to find x such that 2xβ‘3(mod5). By inspection or trial and error: If x=0, 2(0)=0ξ β‘3(mod5). If x=1, 2(1)=2ξ β‘3(mod5). If x=2, 2(2)=4ξ β‘3(mod5). If x=3, 2(3)=6β‘1ξ β‘3(mod5). If x=4, 2(4)=8β‘3(mod5). So, x0β=4 is the unique solution modulo 5.
Step 5: Find the d solutions modulo m.
The solutions modulo 15 are xkβ=x0β+k(dmβ) for k=0,1,2. For k=0:
x0β=4+0β (315β)=4(mod15)
For k=1:
x1β=4+1β (315β)=4+5=9(mod15)
For k=2:
x2β=4+2β (315β)=4+10=14(mod15)
Answer: The solutions are xβ‘4,9,14(mod15).
---
5. Modular Exponentiation
Calculating ak(modm) for large k can be done efficiently using the method of binary exponentiation (also known as exponentiation by squaring).
π‘Binary Exponentiation Algorithm
To compute ak(modm):
Initialize result=1 and base=a(modm).
While k>0:
a. If k is odd, result=(resultΓbase)(modm). b. base=(baseΓbase)(modm). c. k=βk/2β.
Return result.
This algorithm has a time complexity of O(logk).
Fermat's Little Theorem:
πFermat's Little Theorem
If p is a prime number, then for any integer a not divisible by p:
apβ1β‘1(modp)
Also, for any integer a:
apβ‘a(modp)
Variables:
a: Integer
p: Prime number
When to use: When the modulus is a prime number and the exponent is large, to simplify ak(modp).
Euler's Totient Theorem:
πEuler's Totient Theorem
If a and m are coprime positive integers (gcd(a,m)=1), then:
aΟ(m)β‘1(modm)
where Ο(m) is Euler's totient function, which counts the number of positive integers less than or equal to m that are relatively prime to m.
Variables:
a: Integer
m: Positive integer modulus
Ο(m): Euler's totient function
When to use: When the modulus is composite and gcd(a,m)=1, to simplify ak(modm).
Worked Example:
Problem: Calculate 722(mod11).
Solution:
Step 1: Identify the values and check conditions for Fermat's Little Theorem.
a=7,k=22,m=11
Since 11 is a prime number and 7 is not divisible by 11, we can use Fermat's Little Theorem.
Step 2: Apply Fermat's Little Theorem.
711β1β‘710β‘1(mod11)
Step 3: Rewrite the exponent using the result from Fermat's Little Theorem.
722=(710)2
Step 4: Substitute and calculate modulo 11.
722β‘(1)2(mod11)
722β‘1(mod11)
Answer:1
---
6. Pigeonhole Principle (applied to number theory)
The Pigeonhole Principle (PHP) is a simple yet powerful combinatorial principle often used in number theory proofs, especially in problems involving remainders and divisibility.
πPigeonhole Principle
If n items are put into m containers, with n>m, then at least one container must contain more than one item.
In number theory, the "items" are often numbers, and the "containers" are residue classes modulo some integer m.
Worked Example:
Problem: Show that among any set of 6 distinct integers, there must exist 2 integers whose difference is divisible by 5.
Solution:
Step 1: Define the "pigeons" and "pigeonholes".
Pigeons: The 6 distinct integers. Pigeonholes: The possible remainders when an integer is divided by 5. These are {0,1,2,3,4}. There are 5 pigeonholes.
Step 2: Apply the Pigeonhole Principle.
Since there are 6 integers (pigeons) and 5 possible remainders (pigeonholes), by the Pigeonhole Principle, at least two integers must have the same remainder modulo 5. Let these two integers be a and b.
Step 3: Conclude based on the definition of congruence.
If aβ‘r(mod5) and bβ‘r(mod5) for some remainder r, then by the properties of congruence:
aβbβ‘rβr(mod5)
aβbβ‘0(mod5)
This means aβb is divisible by 5.
Answer: This demonstrates that among any set of 6 distinct integers, there are always two whose difference is divisible by 5.
---
---
7. Applications of Congruences
Congruence relations have wide-ranging applications in various fields, including:
Divisibility Tests: Many common divisibility rules (e.g., by 3, 9, 11) are based on modular arithmetic.
Parity Analysis: Determining whether a number is even or odd is equivalent to working modulo 2. Analyzing numbers modulo 4 is useful for properties of squares.
* An even number:
nβ‘0(mod2)βΉn2β‘0(mod4)
* An odd number:
nβ‘1(mod2)βΉn2β‘1(mod4)
* An odd number:
nβ‘3(mod2)βΉn2β‘9β‘1(mod4)
Thus, any square is congruent to 0 or 1(mod4). This is crucial for problems involving sums of squares (like Pythagorean triples).
Clock Arithmetic: Time calculations (hours on a clock, days of the week) naturally use modular arithmetic. A 12-hour clock works modulo 12, and days of the week work modulo 7.
* Modeling Clock Hands: The position of clock hands can be represented by angles or units on the clock face. Let t be time in minutes from 12:00. * Minute hand angle:
ΞΈMβ(t)=6t(mod360)Β degrees
* Hour hand angle:
ΞΈHβ(t)=2tβ(mod360)Β degrees
Problems involving identical clock hands often require finding times t1β,t2β such that the set of angles {ΞΈHβ(t1β),ΞΈMβ(t1β)} is the same as {ΞΈHβ(t2β),ΞΈMβ(t2β)}, where t1βξ =t2β and the hands are effectively swapped. This leads to solving systems of congruences.
Worked Example:
Problem: Determine if a right-angled triangle can have integer side lengths a,b,c where both a and b are odd.
Solution:
Step 1: State the Pythagorean theorem.
a2+b2=c2
Step 2: Analyze the parities of a and b.
Given a is odd,
aβ‘1(mod2)
Given b is odd,
bβ‘1(mod2)
Step 3: Analyze the squares modulo 4.
If n is odd, then n=2k+1 for some integer k.
n2=(2k+1)2=4k2+4k+1=4(k2+k)+1
So, for any odd integer n,
n2β‘1(mod4)
Step 4: Apply this to a2 and b2.
Since a is odd,
a2β‘1(mod4)
Since b is odd,
b2β‘1(mod4)
Step 5: Calculate a2+b2(mod4).
a2+b2β‘1+1(mod4)
a2+b2β‘2(mod4)
Step 6: Analyze c2(mod4).
From the Pythagorean theorem, c2=a2+b2. So
c2β‘2(mod4)
However, we know that any perfect square n2 must be congruent to 0(mod4) (if n is even) or 1(mod4) (if n is odd). If n is even:
n=2kβΉn2=4k2β‘0(mod4)
If n is odd:
n=2k+1βΉn2=4k2+4k+1β‘1(mod4)
Thus,
c2ξ β‘2(mod4)
This is a contradiction.
Step 7: Conclude.
Since c2β‘2(mod4) is impossible for any integer c, there are no right-angled triangles with integer side lengths where both a and b are odd.
Answer: \boxed{No such right-angled triangles exist.}
---
Problem-Solving Strategies
π‘CMI Strategy
Reduce first, then operate: Before performing arithmetic operations, reduce numbers modulo m to their smallest non-negative residues (or smallest absolute value residues like β1,0,1). This keeps calculations manageable.
Look for patterns: For modular exponentiation, look for cycles in the powers of the base modulo m. Fermat's Little Theorem or Euler's Totient Theorem are powerful shortcuts.
Use definitions: When proving divisibility, convert the statement into a congruence relation:
Aβ£BβΊBβ‘0(modA)
Parity and Modulo 4: For problems involving squares or sums of squares, consider the properties of numbers modulo 2 or modulo 4. n2(mod4) is a very common tool (always 0 or 1).
Pigeonhole Principle: For problems asking "show that there must exist" or involving a specific number of items that guarantee a property, consider using the Pigeonhole Principle with residue classes as pigeonholes.
---
Common Mistakes
β οΈAvoid These Errors
β Incorrect Division: Dividing by c in acβ‘bc(modm) to get aβ‘b(modm) without checking gcd(c,m)=1.
β Correct Approach: Divide by d=gcd(c,m) to get aβ‘b(modm/d).
β Ignoring Modulo in Exponent: Applying akβ‘ak(modΟ(m))(modm) when k is not reduced modulo Ο(m) for Euler's Theorem. (The exponent should be reduced modulo Ο(m) if kβ₯Ο(m)). For Fermat's Little Theorem, akβ‘ak(modpβ1)(modp) (if kβ₯pβ1).
β Correct Approach: Use akβ‘ak(modΟ(m))(modm)only ifkβ₯Ο(m) and gcd(a,m)=1. If k<Ο(m), use the original exponent. If k=0, a0β‘1(modm).
β Confusing axβ‘b(modm) with ax=b+km: While equivalent, solving directly with the congruence notation is often more efficient.
β Correct Approach: Manipulate congruences directly using their algebraic properties.
β Misapplying Pigeonhole Principle: Incorrectly identifying the number of pigeons or pigeonholes, or failing to define what property makes them "share" a hole.
β Correct Approach: Clearly define pigeons and pigeonholes, then state the property that implies two pigeons are in the same hole (e.g., same remainder modulo m).
---
Practice Questions
:::question type="MCQ" question="Let N=72023+32023. What is the remainder when N is divided by 10?" options=["0","2","4","6"] answer="0" hint="Consider N(mod2) and N(mod5) separately, then use the Chinese Remainder Theorem concept, or directly calculate N(mod10)." solution="Step 1: Calculate 72023(mod10). The powers of 7(mod10) cycle: 71β‘7(mod10) 72β‘49β‘9(mod10) 73β‘9Γ7=63β‘3(mod10) 74β‘3Γ7=21β‘1(mod10) The cycle length is 4. We need 2023(mod4). 2023=4Γ505+3. So, 72023β‘73β‘3(mod10).
Step 2: Calculate 32023(mod10). The powers of 3(mod10) cycle: 31β‘3(mod10) 32β‘9(mod10) 33β‘9Γ3=27β‘7(mod10) 34β‘7Γ3=21β‘1(mod10) The cycle length is 4. Again, 2023(mod4)=3. So, 32023β‘33β‘7(mod10).
Step 3: Calculate N(mod10).
N=72023+32023β‘3+7(mod10)
Nβ‘10(mod10)
Nβ‘0(mod10)
Answer: \boxed{0}" :::
:::question type="NAT" question="A digital clock displays time in 24-hour format. If the clock is currently displaying 14:35, what time will it display exactly 100 hours from now? (Provide the answer in HHMM format, e.g., 0530 for 05:30)." answer="1835" hint="Use modular arithmetic for hours. Minutes remain unchanged." solution="Step 1: The current time is 14 hours and 35 minutes. We need to find the time 100 hours from now. The minutes part will not change. New hour will be (14+100)(mod24).
Step 2: Calculate the sum of hours.
14+100=114
Step 3: Calculate the result modulo 24.
114(mod24)
We can divide 114 by 24: 114=4Γ24+18 So, 114β‘18(mod24).
Step 4: Combine with the minutes. The new time will be 18:35.
Step 5: Format the answer as HHMM. Answer: \boxed{1835}" :::
:::question type="MSQ" question="Which of the following statements are true for integers a,b,c and modulus m>1?" options=["If aβ‘b(modm), then a+cβ‘b+c(modm).","If acβ‘bc(modm), then aβ‘b(modm).","If a2β‘b2(modm), then aβ‘b(modm).","If aβ‘b(modm) and cβ‘d(modm), then acβ‘bd(modm). "] answer="A,D" hint="Carefully review the properties of congruence, especially division and exponentiation." solution="Option A: If aβ‘b(modm), then a+cβ‘b+c(modm). This is a basic property of congruence (addition). It is true.
Option B: If acβ‘bc(modm), then aβ‘b(modm). This is false. Division in modular arithmetic requires gcd(c,m)=1. For example, 2Γ3β‘4Γ3(mod6) (6β‘12(mod6)), but 2ξ β‘4(mod6). The correct statement is aβ‘b(modm/gcd(c,m)).
Option C: If a2β‘b2(modm), then aβ‘b(modm). This is false. For example, 22β‘(β2)2(mod6) (4β‘4(mod6)), but 2ξ β‘β2(mod6) (since 2ξ β‘4(mod6)). Also, 22β‘42(mod12) (4β‘16(mod12)), but 2ξ β‘4(mod12).
Option D: If aβ‘b(modm) and cβ‘d(modm), then acβ‘bd(modm). This is a basic property of congruence (multiplication). It is true. Answer: \boxed{A,D}" :::
:::question type="SUB" question="Prove that n5βn is divisible by 5 for any integer n." answer="Proof relies on Fermat's Little Theorem or checking cases modulo 5." hint="Consider using Fermat's Little Theorem or checking all possible residues of n modulo 5." solution="We want to prove that n5βnβ‘0(mod5) for any integer n.
Method 1: Using Fermat's Little Theorem
Step 1: State Fermat's Little Theorem. Fermat's Little Theorem states that if p is a prime number, then for any integer n, npβ‘n(modp). In this case, p=5.
Step 2: Apply the theorem. According to Fermat's Little Theorem, for p=5, we have:
n5β‘n(mod5)
Step 3: Rearrange the congruence. Subtract n from both sides:
n5βnβ‘nβn(mod5)
n5βnβ‘0(mod5)
Step 4: Conclude. Since n5βnβ‘0(mod5), it means n5βn is divisible by 5 for any integer n.
Method 2: Checking all residues modulo 5
Step 1: Consider all possible residues of n modulo 5. The possible residues are 0,1,2,3,4.
Step 2: Check each case. Case 1: nβ‘0(mod5)
n5βnβ‘05β0(mod5)
n5βnβ‘0β0(mod5)
n5βnβ‘0(mod5)
Case 2: nβ‘1(mod5)
n5βnβ‘15β1(mod5)
n5βnβ‘1β1(mod5)
n5βnβ‘0(mod5)
Case 3: nβ‘2(mod5)
n5βnβ‘25β2(mod5)
n5βnβ‘32β2(mod5)
n5βnβ‘30(mod5)
n5βnβ‘0(mod5)
Case 4: nβ‘3(mod5)
n5βnβ‘35β3(mod5)
n5βnβ‘243β3(mod5)
n5βnβ‘240(mod5)
n5βnβ‘0(mod5)
Case 5: nβ‘4(mod5)
n5βnβ‘45β4(mod5)
n5βnβ‘1024β4(mod5)
n5βnβ‘1020(mod5)
n5βnβ‘0(mod5)
Step 3: Conclude. In all possible cases, n5βnβ‘0(mod5). Therefore, n5βn is divisible by 5 for any integer n. Answer: \boxed{Proven}" :::
:::question type="NAT" question="Consider an analogue clock with only an hour hand. If it currently points exactly at 3, and moves continuously, what number will it point to 1000 hours later? (Assume a 12-hour cycle for the clock face. Provide the answer as a plain number from 1 to 12)." answer="11" hint="Use modular arithmetic for hours, adjusting for the 1-12 range." solution="Step 1: The clock is a 12-hour clock. We are interested in the hour hand's position modulo 12. Current position: 3.
Step 2: Calculate the total hours passed. Total hours = 1000.
Step 3: Find the position modulo 12. The new position will be (3+1000)(mod12).
Step 4: Perform the addition.
3+1000=1003
Step 5: Calculate the remainder modulo 12.
1003(mod12)
Divide 1003 by 12: 1003=12Γ83+7 So, 1003β‘7(mod12).
Step 6: Interpret the result for a 12-hour clock. A remainder of 0 usually corresponds to 12 on a clock face. For remainders 1 through 11, they correspond directly to the numbers 1 through 11. Since the remainder is 7, the hour hand will point to 7. Answer: \boxed{11}" :::
---
π‘Moving Forward
Now that you understand Congruence Relations, let's explore Operations in Modular Arithmetic which builds on these concepts.
---
Part 2: Operations in Modular Arithmetic
Introduction
Modular arithmetic is a fundamental branch of number theory that deals with integers and their remainders when divided by a fixed positive integer, known as the modulus. It provides a powerful framework for analyzing properties of numbers and has widespread applications in Data Science, including cryptography (e.g., RSA algorithm relies heavily on modular exponentiation), hashing functions, error detection and correction codes, and pseudo-random number generation. For the CMI exam, understanding operations within modular arithmetic is crucial for solving problems involving number theory, discrete mathematics, and algorithmic analysis. This section will cover the core definitions, properties, and applications of modular arithmetic, including number representation in different bases and polynomial congruences.
πCongruence Modulo n
Two integers a and b are said to be congruent modulo n if their difference aβb is an integer multiple of n. This is denoted by:
aβ‘b(modn)
Equivalently, a and b have the same remainder when divided by n. That is, if a=q1βn+r and b=q2βn+r for some integers q1β,q2β and 0β€r<n, then aβ‘b(modn).
---
---
Key Concepts
1. Basic Properties of Congruence
Modular congruence is an equivalence relation and possesses several key properties that simplify arithmetic operations.
πProperties of Congruence
If a,b,c,d are integers and n is a positive integer:
Reflexive Property:
aβ‘a(modn)
Symmetric Property:
aβ‘b(modn)βΉbβ‘a(modn)
Transitive Property:
aβ‘b(modn)Β andΒ bβ‘c(modn)βΉaβ‘c(modn)
Addition/Subtraction Property: If aβ‘b(modn) and cβ‘d(modn), then:
a+cβ‘b+d(modn)
aβcβ‘bβd(modn)
Multiplication Property: If aβ‘b(modn) and cβ‘d(modn), then:
acβ‘bd(modn)
Exponentiation Property: If aβ‘b(modn), then for any non-negative integer k:
akβ‘bk(modn)
Cancellation Property (with caveats): If acβ‘bc(modn), then aβ‘b(modgcd(c,n)nβ). If gcd(c,n)=1, then acβ‘bc(modn)βΉaβ‘b(modn).
Worked Example: Applying Basic Properties
Problem: Find the remainder when 13100 is divided by 7.
Solution:
Step 1: Simplify the base modulo 7.
13β‘6(mod7)
Also, 6β‘β1(mod7).
Step 2: Apply the exponentiation property.
13100β‘6100(mod7)
13100β‘(β1)100(mod7)
Step 3: Evaluate the power.
(β1)100=1
Step 4: State the final congruence.
13100β‘1(mod7)
Answer: The remainder is 1.
---
2. Polynomial Congruences
An important property in modular arithmetic is how polynomials behave under congruence. This is directly tested in CMI.
βPolynomial Congruence Property
Let p(x) be a polynomial with integer coefficients, i.e., p(x)=cmβxm+cmβ1βxmβ1+β―+c1βx+c0β, where ciββZ. If a and b are integers such that aβ‘b(modn), then it is true that p(a)β‘p(b)(modn).
Proof:
Step 1: Given the congruence aβ‘b(modn).
Step 2: Apply the exponentiation property for each term xk. Since aβ‘b(modn), we have akβ‘bk(modn) for any non-negative integer k.
Step 3: Apply the multiplication property for each coefficient ckβ. Since ckββ‘ckβ(modn) and akβ‘bk(modn), we can multiply these congruences:
ckβakβ‘ckβbk(modn)
Step 4: Apply the addition property for all terms in the polynomial. Summing up the congruences for each term from k=0 to m:
Step 5: Conclude the result. The left side is p(a) and the right side is p(b). Therefore, p(a)β‘p(b)(modn).
Worked Example:
Problem: Let p(x)=3x3β2x+5. If aβ‘4(mod5), show that p(a)β‘p(4)(mod5).
Solution:
Step 1: Use the given congruence aβ‘4(mod5).
Step 2: Apply the polynomial congruence property. Since p(x) is a polynomial with integer coefficients and aβ‘4(mod5), we directly apply the property that p(a)β‘p(4)(mod5).
Step 3: Calculate p(4)(mod5).
p(4)=3(4)3β2(4)+5
p(4)=3(64)β8+5
p(4)=192β8+5
p(4)=189
Step 4: Find the remainder of p(4) when divided by 5.
189=37Γ5+4
So, 189β‘4(mod5).
Step 5: Conclude. Thus, p(a)β‘4(mod5). This demonstrates that p(a)β‘p(4)(mod5).
Answer:p(a)β‘p(4)(mod5).
---
3. Number Representation in Different Bases
Numbers can be represented in various bases (radix systems), not just base 10 (decimal). A number in base k is represented by a sequence of digits (ntβntβ1ββ¦n1βn0β)kβ, where each digit niβ satisfies 0β€niβ<k.
πBase k Representation
An integer N can be uniquely represented in base k (where k is an integer greater than 1) as:
N=ntβkt+ntβ1βktβ1+β―+n1βk1+n0βk0
where niβ are the digits, 0β€niβ<k for all i, and ntβξ =0 if N>0. This is denoted as (ntβntβ1ββ¦n0β)kβ.
#### 3.1. Converting from Base k to Base 10
To convert a number (ntβntβ1ββ¦n0β)kβ to its base 10 equivalent, simply evaluate the polynomial expression:
Step 1: Write out the positional value expression.
(312)4β=3Γ42+1Γ41+2Γ40
Step 2: Calculate each term.
3Γ16+1Γ4+2Γ1
48+4+2
Step 3: Sum the terms.
54
Answer:(312)4β=5410β.
#### 3.2. Converting from Base 10 to Base k
To convert a base 10 number N10β to base k, use the repeated division algorithm:
Divide N10β by k. The remainder is the last digit (n0β).
Take the quotient from step 1 and divide it by k. The remainder is the next digit (n1β).
Repeat until the quotient is 0. The digits are read in reverse order of their calculation.
Worked Example:
Problem: Convert 7510β to base 5.
Solution:
Step 1: Divide 75 by 5.
75Γ·5=15Β remainderΒ 0(n0β)
Step 2: Divide the quotient 15 by 5.
15Γ·5=3Β remainderΒ 0(n1β)
Step 3: Divide the quotient 3 by 5.
3Γ·5=0Β remainderΒ 3(n2β)
Step 4: Read the remainders from bottom to top.
(300)5β
Answer:7510β=(300)5β.
#### 3.3. Converting Between Arbitrary Bases
To convert a number from base k1β to base k2β:
Convert the number from base k1β to base 10.
Convert the resulting base 10 number to base k2β.
Special Case: Bases that are Powers of Each Other If k2β=k1mβ (e.g., base 2 to base 8, where 8=23), you can group digits. To convert from base k1β to base k1mβ:
Group m digits of the base k1β number, starting from the right. Pad with leading zeros if necessary.
Convert each group of m digits into a single digit in base k1mβ.
Worked Example:
Problem: Convert (1101101)2β to base 8.
Solution:
Step 1: Group the binary digits into sets of three from the right (since 8=23). Pad with leading zeros if needed.
(001Β 101Β 101)2β
Step 2: Convert each group of three binary digits to its decimal equivalent (which will be the base 8 digit).
0012β=110β
1012β=510β
1012β=510β
Step 3: Combine the base 8 digits.
(155)8β
Answer:(1101101)2β=(155)8β.
---
---
# ## 4. Modular Multiplicative Inverse
The concept of division in modular arithmetic is handled using the multiplicative inverse.
πModular Multiplicative Inverse
An integer x is a modular multiplicative inverse of a modulo n if axβ‘1(modn). The inverse exists if and only if gcd(a,n)=1. If it exists, the inverse is unique modulo n.
Finding the Inverse:
* Extended Euclidean Algorithm: For general a and n where gcd(a,n)=1, this algorithm can find integers x and y such that ax+ny=gcd(a,n)=1. Taking this equation modulo n, we get axβ‘1(modn), so x is the inverse. * Fermat's Little Theorem: If n is a prime number, then for any integer a not divisible by n, we have anβ1β‘1(modn). This implies anβ2 is the inverse of a modulo n.
Worked Example:
Problem: Find the modular multiplicative inverse of 5 modulo 13.
Solution:
Step 1: Check if an inverse exists. gcd(5,13)=1, so an inverse exists.
Step 2: Use the Extended Euclidean Algorithm or trial and error for small numbers. We want to find x such that 5xβ‘1(mod13). This means 5x=13k+1 for some integer k. Let's test values for x: If x=1, 5Γ1=5ξ β‘1(mod13) If x=2, 5Γ2=10ξ β‘1(mod13) If x=3, 5Γ3=15β‘2(mod13) If x=4, 5Γ4=20β‘7(mod13) If x=5, 5Γ5=25β‘12(mod13) If x=6, 5Γ6=30β‘4(mod13) If x=7, 5Γ7=35β‘9(mod13) If x=8, 5Γ8=40β‘1(mod13)
Step 3: Identify the inverse. The inverse is 8.
Answer: The modular multiplicative inverse of 5 modulo 13 is 8.
---
# ## 5. Applications: Parity and Modulo 2 Arithmetic
Many problems, especially those involving "on/off" states, toggling, or counts of even/odd items, can be modeled using modular arithmetic modulo 2. In modulo 2 arithmetic: * 0 represents "off" or "even". * 1 represents "on" or "odd". * Addition is equivalent to XOR. * 0+0β‘0(mod2) * 0+1β‘1(mod2) * 1+0β‘1(mod2) * 1+1β‘0(mod2) * Toggling a switch means changing its state s to s+1(mod2).
A common strategy is to look for invariants modulo 2. For example, if an operation always changes the state of an even number of items, then the parity of the total number of "on" items remains invariant.
Worked Example:
Problem: You have a row of 5 lights, initially (off, on, off, on, off). In one move, you can pick any two adjacent lights and toggle both of them. Is it possible to turn all 5 lights on?
Solution:
Step 1: Represent the states as numbers modulo 2. Let siββ{0,1} be the state of light i (0 for off, 1 for on). Initial state: (s1β,s2β,s3β,s4β,s5β)=(0,1,0,1,0). Target state: (1,1,1,1,1).
Step 2: Analyze the effect of the operation on the sum of states modulo 2. Let S=βi=15βsiβ(mod2). Initial sum: 0+1+0+1+0=2β‘0(mod2). Target sum: 1+1+1+1+1=5β‘1(mod2).
Step 3: Consider the effect of toggling two adjacent lights. If we pick lights i and i+1, their states change from (siβ,si+1β) to (siβ+1(mod2),si+1β+1(mod2)). The change in the sum of states is (siβ+1+si+1β+1)β(siβ+si+1β)=2β‘0(mod2). This means that each move changes the sum of the states by 0(mod2). The parity of the total number of "on" lights is an invariant.
Step 4: Compare the parity of the initial and target states. Initial state sum parity: 0(mod2) (even number of "on" lights). Target state sum parity: 1(mod2) (odd number of "on" lights).
Since the parity of the sum of "on" lights is invariant under the allowed operation, and the initial state has an even sum while the target state has an odd sum, it is impossible to reach the target state.
Answer: No, it is not possible to turn all 5 lights on.
---
Problem-Solving Strategies
π‘CMI Strategy
Simplify First: Always reduce numbers modulo n before performing operations (especially for large numbers or exponents). For example, aΓb(modn) is easier as (a(modn)Γb(modn))(modn).
Look for Invariants: In problems involving state changes or sequences of operations (like the switch problem), identify quantities that remain constant modulo n (often modulo 2 for parity).
Use Negative Remainders: Sometimes using negative remainders can simplify calculations, e.g., 6β‘β1(mod7).
Base Conversion as a Tool: Remember the two-step process for converting between arbitrary bases (via base 10). For bases that are powers of each other (e.g., binary to octal/hexadecimal), use the grouping method for speed.
Polynomial Congruence: If aβ‘b(modn), then p(a)β‘p(b)(modn) is a powerful direct result; no need to calculate p(a) and p(b) explicitly if a and b are large.
---
Common Mistakes
β οΈAvoid These Errors
β Incorrect Division:acβ‘bc(modn) does NOT generally imply aβ‘b(modn).
β Correct Approach: You can only "cancel" c if gcd(c,n)=1. Otherwise, acβ‘bc(modn)βΉaβ‘b(modn/gcd(c,n)).
β Forgetting Modulo in Intermediate Steps: Performing calculations and only taking the modulo at the very end can lead to extremely large numbers, making computation difficult or impossible.
β Correct Approach: Apply the modulo operator at each step where possible to keep numbers small, especially in exponentiation.
β Base Conversion Errors: Mixing up the order of digits or miscalculating powers of the base.
β Correct Approach: For base k to base 10, ensure correct powers of k are assigned to each digit. For base 10 to base k, ensure remainders are collected in the correct (reverse) order.
β Misunderstanding Modulo 2: Confusing parity of individual elements with parity of a sum or count.
β Correct Approach: Clearly define what 0 and 1 represent in the context of the problem and analyze how operations affect the sum modulo 2.
---
Practice Questions
:::question type="NAT" question="Convert the base 7 number (253)7β to base 4. Express your answer as a plain number string (e.g., 123)." answer="2020" hint="First convert to base 10, then to base 4." solution="Step 1: Convert (253)7β to base 10.
(253)7β=2Γ72+5Γ71+3Γ70
=2Γ49+5Γ7+3Γ1
=98+35+3=13610β
Step 2: Convert 13610β to base 4 using repeated division.
136Γ·4=34Β remainderΒ 0
34Γ·4=8Β remainderΒ 2
8Γ·4=2Β remainderΒ 0
2Γ·4=0Β remainderΒ 2
Reading the remainders from bottom to top gives (2020)4β.
Answer: 2020β " :::
:::question type="SUB" question="Prove that for any integer x, x5β‘x(mod10)." answer="Proof involves Fermat's Little Theorem and Chinese Remainder Theorem, or direct checking." hint="Consider modulo 2 and modulo 5 separately, then combine." solution="We need to prove x5β‘x(mod10). This is equivalent to proving:
x5β‘x(mod2)
x5β‘x(mod5)
Part 1: Proving x5β‘x(mod2) If x is even, then xβ‘0(mod2). Then:
x5β‘05(mod2)
x5β‘0(mod2)
Since xβ‘0(mod2), we have x5β‘x(mod2). If x is odd, then xβ‘1(mod2). Then:
x5β‘15(mod2)
x5β‘1(mod2)
Since xβ‘1(mod2), we have x5β‘x(mod2). In both cases, x5β‘x(mod2) holds.
Part 2: Proving x5β‘x(mod5) By Fermat's Little Theorem, for a prime p and any integer a, apβ‘a(modp). Here, p=5. So, x5β‘x(mod5) holds directly from Fermat's Little Theorem.
Part 3: Combining the results using the Chinese Remainder Theorem principle We have:
x5β‘x(mod2)
x5β‘x(mod5)
Since gcd(2,5)=1, if Aβ‘B(mod2) and Aβ‘B(mod5), then Aβ‘B(mod2Γ5). Therefore, x5β‘x(mod10). " :::
:::question type="MCQ" question="Which of the following is the modular multiplicative inverse of 7 modulo 15?" options=["A) 1","B) 4","C) 7","D) 13"] answer="D) 13" hint="We are looking for an integer x such that 7xβ‘1(mod15)." solution="We need to find x such that 7xβ‘1(mod15). Let's test the options: A) If x=1,
7Γ1=7ξ β‘1(mod15)
(Incorrect)
B) If x=4,
7Γ4=28
28=1Γ15+13βΉ28β‘13(mod15)
(Incorrect)
C) If x=7,
7Γ7=49
49=3Γ15+4βΉ49β‘4(mod15)
(Incorrect)
D) If x=13,
7Γ13=91
91=6Γ15+1βΉ91β‘1(mod15)
(Correct) Therefore, 13 is the modular multiplicative inverse of 7 modulo 15.
Answer: Dβ " :::
:::question type="MSQ" question="Let M=(11011)2β. Which of the following statements are true?" options=["A) (M)10β=27","B) Mβ‘3(mod4)","C) (M)8β=(33)8β","D) M is a prime number."] answer="A,B,C" hint="Convert to base 10 first, then evaluate each condition." solution="Step 1: Convert M=(11011)2β to base 10.
M=1Γ24+1Γ23+0Γ22+1Γ21+1Γ20
M=16+8+0+2+1
M=2710β
So, option A is true.
Step 2: Check Mβ‘3(mod4) (Option B).
27Γ·4=6Β remainderΒ 3
So 27β‘3(mod4). Thus, option B is true.
Step 3: Check (M)8β=(33)8β (Option C). To convert (11011)2β to base 8, group digits in threes from the right. We can pad with a leading zero:
(011Β 011)2β
0112β=310β
0112β=310β
So, (11011)2β=(33)8β. Thus, option C is true.
Step 4: Check if M is a prime number (Option D). M=27. Since 27=33, 27 is not a prime number (it is a composite number). Thus, option D is false.
Answer: A,B,Cβ " :::
:::question type="NAT" question="A sequence of operations is defined on a set of three binary variables (x1β,x2β,x3β), where each xiββ{0,1}. An operation consists of selecting two variables and flipping their values (i.e., 0β1 and 1β0). If the initial state is (0,1,0) and the target state is (1,1,1), what is the parity (0 for even, 1 for odd) of the minimum number of operations required to reach the target state?" answer="1" hint="Consider the sum of the variables modulo 2." solution="Let the state of the variables be represented by xiββ{0,1}. An operation consists of picking two variables, say xiβ and xjβ, and flipping them. This means xiββxiβ+1(mod2) and xjββxjβ+1(mod2).
Consider the sum of the variables modulo 2: S=(x1β+x2β+x3β)(mod2). Initial state: (0,1,0). Initial sum:
Sinitialβ=(0+1+0)(mod2)=1(mod2)
Target state: (1,1,1). Target sum:
Stargetβ=(1+1+1)(mod2)=3(mod2)=1(mod2)
When an operation is performed, two variables xiβ and xjβ are flipped. The change in the sum is:
(xiβ+1+xjβ+1)β(xiβ+xjβ)=2β‘0(mod2)
This means that each operation changes the sum of the variables by 0(mod2). Therefore, the sum of the variables modulo 2 is an invariant. Since Sinitialβ=1(mod2) and Stargetβ=1(mod2), it is possible to reach the target state.
Now, we need to find the minimum number of operations. Initial state: (0,1,0). Target state: (1,1,1). Variables that need to be flipped: x1β (from 0 to 1) and x3β (from 0 to 1). Variable x2β stays 1. An operation flips two variables. We need to flip x1β and x3β. Operation 1: Flip x1β and x3β.
(0,1,0)FlipΒ x1β,x3ββ(0+1,1,0+1)=(1,1,1)
This takes exactly one operation.
The minimum number of operations is 1. The parity of the minimum number of operations is 1(mod2)=1.
Answer: 1β " :::
:::question type="SUB" question="Let n be a positive integer. Prove that n2β‘n(mod2) for all integers n." answer="Proof by cases: n is even or n is odd." hint="Consider n(mod2)." solution="We need to prove n2β‘n(mod2).
Case 1: n is an even integer. If n is even, then nβ‘0(mod2). Then:
n2β‘02(mod2)
n2β‘0(mod2)
Since nβ‘0(mod2), we have n2β‘n(mod2) in this case.
Case 2: n is an odd integer. If n is odd, then nβ‘1(mod2). Then:
n2β‘12(mod2)
n2β‘1(mod2)
Since nβ‘1(mod2), we have n2β‘n(mod2) in this case.
In both cases, n2β‘n(mod2). Therefore, n2β‘n(mod2) for all integers n. " :::
---
Summary
βKey Takeaways for CMI
Congruence Definition:aβ‘b(modn) means nβ£(aβb) or a and b have the same remainder when divided by n.
Properties are Key: Mastering the addition, subtraction, multiplication, and exponentiation properties of congruences is vital for simplifying expressions.
Polynomial Congruence: If aβ‘b(modn), then p(a)β‘p(b)(modn) for any polynomial p(x) with integer coefficients. This is a frequently tested concept.
Base Conversion: Be proficient in converting between any base k and base 10, and understand the grouping method for bases that are powers of each other (e.g., binary to octal/hexadecimal).
Modular Inverses: Understand when a modular multiplicative inverse exists (gcd(a,n)=1) and how to find it (Extended Euclidean Algorithm or Fermat's Little Theorem for prime moduli).
Modulo 2 Applications: Parity problems are often solved by analyzing invariants or changes modulo 2.
---
What's Next?
π‘Continue Learning
This topic connects to:
Linear Congruences and Systems of Congruences: Solving equations of the form axβ‘b(modn) and systems like those addressed by the Chinese Remainder Theorem. These are crucial for cryptographic algorithms.
Number Theoretic Functions: Euler's totient function (Ο(n)) and its relation to modular exponentiation (Euler's Theorem), which generalizes Fermat's Little Theorem.
Cryptography (RSA): The RSA algorithm heavily relies on modular exponentiation, modular inverses, and properties of prime numbers and Euler's totient function.
Hashing and Error Correction Codes: Modular arithmetic is used to distribute data across hash tables and to detect/correct errors in data transmission.
Master these connections for comprehensive CMI preparation!
---
Chapter Summary
πModular Arithmetic - Key Takeaways
Here are the most important concepts from Modular Arithmetic that you must master for CMI:
Definition of Congruence: Understand aβ‘b(modn)βΊnβ£(aβb). This means a and b have the same remainder when divided by n. This equivalence relation partitions integers into n distinct congruence classes.
Arithmetic Operations: Congruences can be added, subtracted, and multiplied:
If aβ‘b(modn) and cβ‘d(modn), then aΒ±cβ‘bΒ±d(modn) and acβ‘bd(modn). Division is not always straightforward.
Modular Inverse: An integer a has a multiplicative inverse modulo n, denoted aβ1, if and only if gcd(a,n)=1. If it exists, it is unique modulo n. The Extended Euclidean Algorithm is the primary method to find aβ1.
Solving Linear Congruences: The linear congruence axβ‘b(modn) has solutions if and only if gcd(a,n)β£b. If this condition holds, there are exactly d=gcd(a,n) distinct solutions modulo n.
Euler's Totient Function and Theorems:
Ο(n): Counts the number of positive integers less than or equal to n that are relatively prime to n. Euler's Theorem: If gcd(a,n)=1, then aΟ(n)β‘1(modn). This is crucial for simplifying large powers. * Fermat's Little Theorem: A special case of Euler's Theorem: If p is a prime number and pβ€a, then apβ1β‘1(modp).
---
Chapter Review Questions
:::question type="MCQ" question="What is the smallest positive integer x such that 32023xβ‘9(mod11)?" options=["A) 1","B) 2","C) 3","D) 4"] answer="D) 4" hint="First, simplify the power of 3 using Fermat's Little Theorem. Then, find the modular inverse of the simplified coefficient." solution="We need to solve 32023xβ‘9(mod11). First, simplify 32023(mod11). Since 11 is a prime number and 11β€3, we can use Fermat's Little Theorem, which states apβ1β‘1(modp). Here, a=3 and p=11, so 311β1β‘310β‘1(mod11).
Now, we simplify the exponent 2023:
2023=10Γ202+3
So,
32023=310Γ202+3=(310)202β 33(mod11)
Using Fermat's Little Theorem:
(1)202β 33β‘1β 27(mod11)
27β‘5(mod11)(sinceΒ 27=2Γ11+5)
The congruence becomes:
5xβ‘9(mod11)
To find x, we need to multiply by the modular inverse of 5(mod11). Let 5β1(mod11) be y. We need 5yβ‘1(mod11). By inspection, 5Γ9=45β‘1(mod11). So 5β1β‘9(mod11). Multiply both sides of 5xβ‘9(mod11) by 9:
9β 5xβ‘9β 9(mod11)
45xβ‘81(mod11)
1xβ‘81(mod11)
Since 81=7Γ11+4, we have 81β‘4(mod11). Thus,
xβ‘4(mod11)
The smallest positive integer x is 4.
Answer: Dβ " :::
:::question type="NAT" question="Find the smallest positive integer x such that 17xβ‘1(mod101)." answer="6" hint="Use the Extended Euclidean Algorithm to find integers a and b such that 17a+101b=1. The value of a (modulo 101) will be your answer." solution="We need to find the smallest positive integer x such that 17xβ‘1(mod101). This is equivalent to finding the modular inverse of 17 modulo 101. We use the Extended Euclidean Algorithm to find integers a and b such that 17a+101b=1.
The steps of the Euclidean Algorithm are:
101=5Γ17+16
17=1Γ16+1
16=16Γ1+0
Now, we work backwards from the second equation to express 1 as a linear combination of 17 and 101:
So, we have 6Γ17+(β1)Γ101=1. Taking this equation modulo 101:
6Γ17+(β1)Γ101β‘1(mod101)
6Γ17+0β‘1(mod101)
6Γ17β‘1(mod101)
Thus, xβ‘6(mod101). The smallest positive integer x is 6.
Answer: 6β " :::
:::question type="NAT" question="Find the remainder when 72022 is divided by 100." answer="49" hint="Since gcd(7,100)=1, use Euler's Totient Theorem. First, calculate Ο(100). Then simplify the exponent." solution="We need to find 72022(mod100). Since gcd(7,100)=1, we can use Euler's Totient Theorem, which states that aΟ(n)β‘1(modn) for gcd(a,n)=1. First, calculate Ο(100):
So, Ο(100)=40. By Euler's Theorem, 740β‘1(mod100).
Now, we simplify the exponent 2022 modulo 40:
2022=40Γ50+22
So,
72022=740Γ50+22=(740)50β 722(mod100)
Using Euler's Theorem:
(1)50β 722β‘722(mod100)
Now we need to calculate 722(mod100):
71=7
72=49
73=49Γ7=343β‘43(mod100)
74β‘43Γ7=301β‘1(mod100)
Since 74β‘1(mod100), we can simplify 722 further:
22=4Γ5+2
722=(74)5β 72β‘(1)5β 72β‘1β 49β‘49(mod100)
Therefore, the remainder when 72022 is divided by 100 is 49.
Answer: 49β " :::
:::question type="MCQ" question="Consider the congruence 12xβ‘18(mod42). Which of the following statements is true?" options=["A) It has no solutions.","B) It has exactly one solution modulo 42.","C) It has exactly 6 solutions modulo 42.","D) It has exactly 12 solutions modulo 42."] answer="C) It has exactly 6 solutions modulo 42." hint="First, calculate gcd(12,42). Then check if this gcd divides 18. The number of solutions depends on this gcd." solution="We are given the congruence 12xβ‘18(mod42).
According to the theory of linear congruences, axβ‘b(modn) has solutions if and only if gcd(a,n) divides b. If solutions exist, there are exactly gcd(a,n) distinct solutions modulo n.
Calculate gcd(12,42):
Using the Euclidean Algorithm:
42=3Γ12+6
12=2Γ6+0
So, gcd(12,42)=6.
Check if gcd(12,42) divides 18:
6 divides 18 (since 18=3Γ6). Since the condition is met, solutions exist.
Determine the number of solutions:
The number of distinct solutions modulo 42 is equal to gcd(12,42), which is 6.
Therefore, the congruence 12xβ‘18(mod42) has exactly 6 solutions modulo 42.
To find these solutions (optional, for verification): Divide the entire congruence by gcd(12,42)=6:
612βxβ‘618β(mod642β)
2xβ‘3(mod7)
Now we need to find the inverse of 2(mod7).
2Γ4=8β‘1(mod7)
So 2β1β‘4(mod7). Multiply both sides by 4:
4Γ2xβ‘4Γ3(mod7)
8xβ‘12(mod7)
xβ‘5(mod7)
This gives us one solution x0β=5. The other solutions are found by adding multiples of n/d=42/6=7 to x0β:
xkβ=x0β+k(dnβ)forΒ k=0,1,β¦,dβ1
The solutions modulo 42 are:
x0β=5
x1β=5+7=12
x2β=5+2Γ7=19
x3β=5+3Γ7=26
x4β=5+4Γ7=33
x5β=5+5Γ7=40
There are indeed 6 distinct solutions modulo 42.
Answer: Cβ " :::
---
What's Next?
π‘Continue Your CMI Journey
You've mastered Modular Arithmetic! This chapter is a cornerstone of Number Theory and its applications in various fields. The principles you've learned here will be indispensable for many advanced topics.
Key connections: Building on Previous Learning: This chapter solidified your understanding of divisibility, prime factorization, greatest common divisors (GCD), and least common multiples (LCM). Modular arithmetic provides a formal framework for analyzing these concepts. Foundation for Future Chapters: Diophantine Equations: Many integer solutions to linear Diophantine equations are found using modular arithmetic techniques. Chinese Remainder Theorem (CRT): This powerful theorem, often covered in the next steps, builds directly on solving systems of linear congruences, which you're now equipped for. Quadratic Residues and Reciprocity: These advanced topics in number theory heavily rely on the foundations of modular arithmetic. Order of an Element and Primitive Roots: Concepts like the order of an element modulo n and primitive roots are direct extensions of Euler's and Fermat's theorems. * Cryptography: Modern cryptographic systems like RSA are built upon the principles of modular exponentiation, Euler's Totient function, and the difficulty of factoring large numbers.
Continue practicing these concepts with varied problems. A strong grasp of modular arithmetic will significantly boost your problem-solving capabilities for the CMI entrance exam.
π― Key Points to Remember
βMaster the core concepts in Modular Arithmetic before moving to advanced topics
βPractice with previous year questions to understand exam patterns
βReview short notes regularly for quick revision before exams