Unit 3: Number Theory-III - Subjective Questions
MTH381 — Number Theory And Cryptography • Practice Questions with Detailed Answers
20 questions
Define a linear congruence. Explain the condition under which the linear congruence has a solution.
A linear congruence is a congruence of the form:
where , , and are integers with , and is the unknown to be determined.
Condition for Solvability:
Let . Then:
- The congruence has a solution if and only if (i.e., divides ).
- If , then there are exactly incongruent solutions modulo .
- If , then the congruence has no solution.
Explanation:
The congruence is equivalent to the linear Diophantine equation:
By the theory of Diophantine equations, this has integer solutions if and only if .
Example: . Here and , so solutions exist (exactly 2 incongruent solutions modulo 8).
Solve the linear congruence and find all incongruent solutions.
We need to solve .
Step 1: Check solvability.
, and , so a unique solution exists modulo 26.
Step 2: Find the inverse of modulo .
We need . Using the Extended Euclidean Algorithm:
Back-substituting:
So , giving .
Step 3: Multiply both sides by the inverse.
Answer: .
Verification: , so . ✓
State and prove the Chinese Remainder Theorem (CRT).
Statement:
Let be positive integers that are pairwise relatively prime (i.e., for ). Then the system of congruences:
has a unique solution modulo .
Proof (Constructive):
Let and define for each .
- Since the are pairwise coprime, .
- Therefore, an inverse of modulo exists such that .
Construct the solution:
Verification: For each , when we reduce modulo , every term with contains the factor (since ), so it vanishes. Thus:
So satisfies all congruences.
Uniqueness: Suppose and are both solutions. Then for all , so . Since the are pairwise coprime, , giving . Hence the solution is unique modulo .
Using the Chinese Remainder Theorem, solve the following system of congruences:
Given system:
Step 1: Compute and .
Step 2: Find inverses where .
Step 3: Compute the solution.
Step 4: Reduce modulo .
Answer: .
Verification: ✓, ✓, ✓
State and prove Fermat's Little Theorem.
Statement:
If is a prime number and is an integer not divisible by (i.e., ), then:
Equivalently, for any integer :
Proof:
Consider the set of the first positive multiples of :
Claim: No two of these are congruent modulo , and none is congruent to .
- If with , then since , we can cancel to get , meaning .
- None is since and for .
Therefore, the residues are a permutation of modulo .
Taking the product of both sets:
Since , we can cancel :
Using Fermat's Little Theorem, find the remainder when is divided by .
We want to find .
Step 1: Apply Fermat's Little Theorem.
Since is prime and :
Step 2: Reduce the exponent modulo .
Therefore:
Step 3: Compute .
Answer: The remainder when is divided by is .
Explain how computer arithmetic with large integers is performed. Discuss the representation of large integers and the concept of modular arithmetic in this context.
Large Integer Arithmetic deals with performing arithmetic operations on integers that exceed the native word size of a computer (typically 32 or 64 bits).
Representation of Large Integers:
- Large integers are represented in a chosen base (radix), such as or .
- An integer is stored as an array of digits where:
- This is called a multiple-precision or arbitrary-precision representation.
Basic Operations:
- Addition/Subtraction: Digit-by-digit with carry/borrow propagation, complexity where is the number of digits.
- Multiplication: Schoolbook method is ; faster algorithms like Karatsuba () and FFT-based methods () exist.
- Division: Long division algorithm, more complex to implement.
Modular Arithmetic with Large Integers:
In cryptography (e.g., RSA), computations are done modulo a large integer :
- Modular exponentiation is central and computed efficiently using fast (binary) exponentiation / square-and-multiply, reducing the count of multiplications to .
- Intermediate results are always reduced modulo to keep numbers manageable.
Why It Matters:
- Cryptographic systems (RSA, Diffie-Hellman) use integers of 1024–4096 bits, far beyond native hardware capacity.
- Efficient large-integer arithmetic is essential for the practicality of these systems.
Describe the square-and-multiply (fast modular exponentiation) algorithm and illustrate it by computing .
Fast Modular Exponentiation computes efficiently by using the binary representation of the exponent, avoiding the computation of the full power.
Algorithm (Square-and-Multiply):
- Write the exponent in binary: .
- Initialize
result = 1. - Scan bits from most significant to least significant:
- Square:
result = result^2 mod m - If the current bit is : Multiply:
result = result * a mod m
- Square:
- The final
resultis .
This reduces the number of multiplications from to .
Example: Compute .
Binary of .
| Bit | Operation | result |
|---|---|---|
| Start | — | 1 |
| 1 | Square (1) → 1; Multiply → | 7 |
| 1 | Square → ; Multiply → | 2 |
| 0 | Square → ; (no multiply) | 4 |
| 1 | Square → ; Multiply → | 2 |
Answer: .
Verification via Fermat: , so . ✓
Distinguish between a congruence and a linear congruence. Give suitable examples of each.
Congruence:
Two integers and are said to be congruent modulo (where ) if divides . Written as:
It is a general relation expressing that two numbers leave the same remainder when divided by .
- Example: because .
Linear Congruence:
A linear congruence is a specific type of congruence involving an unknown variable to the first power, of the form:
Here we seek the values of that satisfy the relation.
- Example: is a linear congruence whose solution is .
Key Differences:
| Aspect | Congruence | Linear Congruence |
|---|---|---|
| Nature | A relation between two numbers | An equation to be solved |
| Unknown | No unknown variable | Contains unknown |
| Goal | State equivalence | Find solution(s) for |
| Form | ||
| Example |
Explain various applications of congruences in computer science and daily life with examples.
Congruences have wide-ranging practical applications. Some important ones include:
1. Hashing Functions:
Hash functions map keys to memory locations using:
Used in hash tables for efficient data storage and retrieval.
2. Pseudorandom Number Generation:
The linear congruential generator (LCG) produces sequences via:
Widely used in simulations and games.
3. Check Digits (Error Detection):
- ISBN codes use congruences modulo 11 (ISBN-10) or 10 (ISBN-13) to detect errors.
- UPC bar codes and credit card numbers use the Luhn algorithm based on modular arithmetic.
4. Cryptography:
- RSA encryption relies on modular exponentiation and Euler/Fermat theorems.
- Diffie-Hellman key exchange uses modular arithmetic.
5. Calendar Computations:
Determining the day of the week using Zeller's congruence:
6. Scheduling and Cyclic Problems:
Problems involving repeating cycles (clock arithmetic, round-robin schedules) use modular arithmetic. For example, hours after o'clock is o'clock.
7. Parity Checks:
Detecting even/odd via for error checking in data transmission.
Solve the system of congruences using CRT: , , .
Given:
Since are pairwise coprime, CRT applies.
Step 1: Compute and .
Step 2: Find inverses.
- : (since )
- : (since )
- : (since )
Step 3: Compute solution.
Step 4: Reduce modulo .
Answer: .
Verification: ✓, ✓, ✓
Define the multiplicative inverse modulo . Find the multiplicative inverse of modulo .
Definition:
The multiplicative inverse of an integer modulo is an integer such that:
This inverse is denoted .
Existence Condition:
The inverse exists if and only if (i.e., and are coprime). When it exists, it is unique modulo .
Finding the Inverse of modulo :
Step 1: Check existence.
, so the inverse exists.
Step 2: Solve .
We test values or use the Extended Euclidean Algorithm:
- ✓
Answer: .
Verification: . ✓
Explain how the Chinese Remainder Theorem is used in computer arithmetic with large integers to speed up computations.
The Chinese Remainder Theorem (CRT) provides a powerful technique for performing arithmetic on very large integers by breaking them into smaller, manageable pieces.
The Core Idea — Modular Representation:
Choose a set of pairwise coprime moduli with product . Any integer with can be uniquely represented by its residues:
This is called the residue number system (RNS).
How It Speeds Up Computation:
- Parallel arithmetic: To compute , , or , we operate on each residue independently:
Each component can be computed in parallel and involves only small integers (fitting in a machine word).
-
No carry propagation: Unlike standard multi-precision arithmetic, RNS operations have no inter-digit carries, allowing fully independent parallel processing.
-
Reconstruction: After computing the result's residues, CRT reconstructs the actual large integer.
Advantages:
- Converts one large operation into several small, parallel operations.
- Ideal for hardware and cryptographic implementations (e.g., RSA decryption uses CRT to gain roughly a 4× speedup).
Limitations:
- Division and comparison are difficult in RNS.
- Conversion overhead between representations.
RSA Example: In RSA, decryption where is computed separately modulo and , then combined via CRT — significantly faster than direct computation modulo .
State and explain the converse of Fermat's Little Theorem. Does the converse always hold? Discuss with reference to pseudoprimes.
Fermat's Little Theorem (Recap):
If is prime and , then .
Converse Statement:
The converse would state: If for some with , then is prime.
Does the Converse Hold?
No, the converse is FALSE in general. There exist composite numbers that satisfy the Fermat congruence for certain bases . Such numbers are called pseudoprimes.
Pseudoprimes:
A composite integer is called a pseudoprime to the base if:
- Example: is composite, yet . So is a pseudoprime to base .
Carmichael Numbers (Absolute Pseudoprimes):
Some composite numbers are pseudoprimes to every base coprime to . These are called Carmichael numbers.
- Smallest example: . For every with , .
Significance:
- Fermat's theorem gives a necessary but not sufficient condition for primality.
- It forms the basis of the Fermat primality test, which is probabilistic and can be fooled by Carmichael numbers.
- This limitation led to stronger tests like the Miller-Rabin primality test.
Solve the linear congruence and find all its incongruent solutions.
We solve .
Step 1: Check solvability.
. Since , solutions exist. There will be exactly incongruent solutions modulo .
Step 2: Reduce the congruence by dividing by .
Dividing , , and by :
Step 3: Solve the reduced congruence.
Find : , so .
So .
Step 4: Find all solutions modulo .
The general solution modulo is:
The five incongruent solutions are:
Verification (for ): . ✓
Explain the role of Fermat's Little Theorem in RSA cryptography and in primality testing.
Fermat's Little Theorem is a foundational result underpinning modern cryptography.
1. Role in RSA Cryptography:
In RSA, we choose two primes and , let , and select public/private key exponents and such that:
The correctness of RSA decryption — that — is proven using Fermat's Little Theorem (generalized as Euler's theorem).
Proof sketch: Since , write . Working modulo (a prime factor of ), Fermat's theorem gives , so:
Similarly modulo , and by CRT, . This guarantees decryption recovers the original message.
2. Role in Primality Testing (Fermat Primality Test):
The theorem gives a way to test whether a number is prime:
- Pick a random base with .
- Compute .
- If , then is definitely composite.
- If , then is probably prime (may still be a pseudoprime).
Limitations:
- Fails for Carmichael numbers (e.g., 561), which pass the test for all bases despite being composite.
- This weakness motivated stronger probabilistic tests like Miller-Rabin.
Summary: Fermat's Little Theorem ensures RSA works correctly and provides a fast, though imperfect, primality-checking method essential for generating cryptographic keys.
A basket contains eggs. When counted in groups of , , and , the remainders are , , and respectively. Find the least number of eggs in the basket using CRT.
Formulating the problem as congruences:
Let be the number of eggs. Then:
Since are pairwise coprime, CRT gives a unique solution modulo .
Step 1: Compute .
- , ,
Step 2: Find inverses.
- :
- :
- :
Step 3: Compute solution.
Step 4: Reduce modulo .
Answer: The least number of eggs is .
Verification: ✓, ✓, ✓
Describe the linear congruential method for generating pseudorandom numbers. What conditions ensure a maximum period?
Linear Congruential Generator (LCG):
The LCG is one of the oldest and simplest algorithms for generating a sequence of pseudorandom numbers. It is defined by the recurrence relation:
where:
- = modulus ()
- = multiplier ()
- = increment ()
- = seed or starting value ()
Each generated lies in the range . To obtain numbers in , we compute .
Special Case: When , it is called a multiplicative congruential generator.
Example: With , , , :
- ...
Conditions for Maximum Period (Hull-Dobell Theorem):
The LCG achieves the full period (all residues occur before repetition) if and only if:
- (i.e., and are coprime).
- is divisible by every prime factor of .
- is divisible by if is divisible by .
Importance:
- A longer period means the sequence appears more random before repeating.
- Poor choices of parameters lead to short periods and detectable patterns, making the generator unsuitable for cryptography.
Prove that if , then the linear congruence has a unique solution modulo .
Claim: If , then has exactly one solution modulo .
Proof:
Part 1: Existence of a solution.
Since , by Bézout's identity there exist integers and such that:
Reducing modulo :
Thus is the multiplicative inverse of modulo . Multiplying both sides of by :
So is a solution, proving existence.
Part 2: Uniqueness of the solution.
Suppose and are both solutions. Then:
Subtracting:
This means . Since , must divide :
Hence any two solutions are congruent modulo , so the solution is unique modulo .
Explain how check digits (e.g., in ISBN or credit card numbers) use congruences for error detection. Illustrate with an example.
Check Digits are extra digits appended to identification numbers, computed using modular arithmetic, to detect common errors such as single-digit mistakes and transposition of adjacent digits.
General Principle:
A check digit is chosen so that a weighted sum of all digits satisfies a specific congruence modulo some integer.
Example 1: ISBN-10 (modulo 11)
An ISBN-10 number must satisfy:
The last digit is the check digit (which may be representing ).
Illustration: For ISBN , digits are . Compute the weighted sum of the first nine:
We need . Since and :
So the check digit is .
Example 2: Credit Cards (Luhn Algorithm, modulo 10)
- Starting from the rightmost digit, double every second digit.
- If doubling gives a two-digit number, subtract (or add the digits).
- Sum all digits. The number is valid if the total .
Error Detection Capability:
- Single-digit errors: Always detected (changing one digit changes the sum).
- Transposition errors: ISBN-10 (mod 11) detects all adjacent transpositions; the Luhn scheme detects most.
Conclusion: Congruences provide a simple, efficient mechanism to validate identification numbers and catch data-entry errors.
Define a linear congruence. Explain the condition under which the linear congruence has a solution.
A linear congruence is a congruence of the form:
where , , and are integers with , and is the unknown to be determined.
Condition for Solvability:
Let . Then:
- The congruence has a solution if and only if (i.e., divides ).
- If , then there are exactly incongruent solutions modulo .
- If , then the congruence has no solution.
Explanation:
The congruence is equivalent to the linear Diophantine equation:
By the theory of Diophantine equations, this has integer solutions if and only if .
Example: . Here and , so solutions exist (exactly 2 incongruent solutions modulo 8).
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →