Unit 1: Number Theory-I - Subjective Questions
MTH381 — Number Theory And Cryptography • Practice Questions with Detailed Answers
20 questions
Define divisibility of integers. State and explain the Division Algorithm with a suitable example.
Divisibility: An integer divides an integer (written ) if there exists an integer such that . Here is called a divisor or factor of , and is a multiple of .
Division Algorithm: For any integer and positive integer , there exist unique integers (the quotient) and (the remainder) such that:
- (floor of )
Example: Let and .
Here and , where .
Example with negative dividend: Let , .
Here and (remainder is always non-negative).
Explain the concept of modular arithmetic. What does mean? List and prove key properties of congruences.
Congruence Modulo m: Two integers and are said to be congruent modulo (where is a positive integer) if divides . It is written as:
Equivalently, and leave the same remainder when divided by .
Key Properties:
- Reflexive:
- Symmetric: If , then
- Transitive: If and , then
Addition/Multiplication Property: If and , then:
Proof of Multiplication Property: Since , we have ; since , we have for integers . Then:
Thus , which is divisible by , so .
Example: because .
Describe arithmetic modulo m. Define the set and the operations and . Construct the addition and multiplication tables for .
Set : The set of non-negative integers less than :
Addition modulo m ():
Multiplication modulo m ():
These operations satisfy closure, associativity, commutativity, identity elements (0 for addition, 1 for multiplication), and additive inverses.
Addition Table for :
| 0 | 1 | 2 | 3 | 4 | |
|---|---|---|---|---|---|
| 0 | 0 | 1 | 2 | 3 | 4 |
| 1 | 1 | 2 | 3 | 4 | 0 |
| 2 | 2 | 3 | 4 | 0 | 1 |
| 3 | 3 | 4 | 0 | 1 | 2 |
| 4 | 4 | 0 | 1 | 2 | 3 |
Multiplication Table for :
| 0 | 1 | 2 | 3 | 4 | |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 2 | 3 | 4 |
| 2 | 0 | 2 | 4 | 1 | 3 |
| 3 | 0 | 3 | 1 | 4 | 2 |
| 4 | 0 | 4 | 3 | 2 | 1 |
Since 5 is prime, every non-zero element has a multiplicative inverse.
Explain the concept of base-b representation of integers. State and prove the theorem that guarantees a unique base- representation for every positive integer.
Base-b Representation Theorem: Let be an integer. Then every positive integer can be expressed uniquely in the form:
where , each digit satisfies , and the leading digit .
This is written as .
Proof (Existence by construction): Apply the division algorithm repeatedly:
Continue until the quotient becomes 0. Since is a strictly decreasing sequence of non-negative integers, the process terminates. The remainders form the base- digits.
Uniqueness: Suppose has two representations. The first digit is uniquely determined. Then is unique, and by induction all subsequent digits are uniquely determined.
Example (base 2): .
Describe the algorithm to convert a decimal integer to its binary expansion. Convert to binary showing all steps.
Algorithm (Repeated Division by 2):
- Divide the decimal number by 2.
- Record the remainder (0 or 1).
- Replace the number with the quotient.
- Repeat until the quotient is 0.
- The binary expansion is the sequence of remainders read from bottom to top (last to first).
Converting :
| Division | Quotient | Remainder |
|---|---|---|
| 120 | 1 | |
| 60 | 0 | |
| 30 | 0 | |
| 15 | 0 | |
| 7 | 1 | |
| 3 | 1 | |
| 1 | 1 | |
| 0 | 1 |
Reading remainders from bottom to top:
Verification: ✓
Explain octal and hexadecimal number systems. Convert the decimal number into both octal and hexadecimal expansions.
Octal System (Base 8): Uses digits –. Each octal digit represents a power of 8.
Hexadecimal System (Base 16): Uses digits – and letters –, where:
Converting to Octal (repeated division by 8):
| Division | Quotient | Remainder |
|---|---|---|
| 343 | 4 | |
| 42 | 7 | |
| 5 | 2 | |
| 0 | 5 |
Reading bottom to top:
Verification: ✓
Converting to Hexadecimal (repeated division by 16):
| Division | Quotient | Remainder |
|---|---|---|
| 171 | 12 = C | |
| 10 | 11 = B | |
| 0 | 10 = A |
Reading bottom to top:
Verification: ✓
Explain the method of converting between binary, octal, and hexadecimal directly (without going through decimal). Illustrate with the binary number .
Key Idea: Since and :
- Binary ↔ Octal: Group binary digits in sets of 3 (from right).
- Binary ↔ Hexadecimal: Group binary digits in sets of 4 (from right).
Binary to Octal — :
Group into 3 bits from the right:
Binary to Hexadecimal — :
Group into 4 bits from the right (pad left with zeros):
Octal to Hexadecimal (via binary): Convert each octal digit to 3 bits, then regroup into 4-bit sets.
Verification: . Also ✓ and ✓.
Describe the algorithm for the addition of two integers in binary representation. Add and using the algorithm, showing carries.
Addition Algorithm (Binary): Given two integers and , we add bit by bit from the least significant bit, propagating carries.
Steps:
- Initialize carry .
- For each bit position from 0 to :
- Compute sum
- The result bit
- New carry
- The final carry becomes the leading bit .
Bit-Rules: , , (write 0, carry 1), (write 1, carry 1).
Adding :
carries: 1 1 1 1
1 1 0 1
-
1 0 1 1
1 1 0 0 0
Step-by-step:
- Bit 0: write 0, carry 1
- Bit 1: write 0, carry 1
- Bit 2: write 0, carry 1
- Bit 3: write 1, carry 1
- Final carry: write 1
Result: .
Verification: ✓ (Complexity: bit operations).
Describe the algorithm for multiplication of two integers in binary. Multiply by using the shift-and-add method. Analyze its complexity.
Multiplication Algorithm (Binary): To multiply by :
- For each bit of : form a partial product.
- If , the partial product is shifted left by positions ().
- If , the partial product is 0.
- Add all partial products using the binary addition algorithm.
Multiplying :
(bits )
- : partial product
- : partial product shifted 1
-
: partial product shifted 2
1 0 1x 1 1 0
0 0 0 0 0 (b0 = 0)
1 0 1 0 (b1 = 1, shift 1)
1 0 1 0 0 (b2 = 1, shift 2)1 1 1 1 0
Result: .
Verification: ✓
Complexity Analysis: There are partial products, each of length up to bits. Computing shifts is and adding numbers of length takes bit operations. Hence total complexity is .
Distinguish between the notations (the modulo operator) and (congruence relation). Give examples of each.
(Modulo Operator):
- This is a binary operation (function) that returns a single value — the remainder when is divided by .
- The result is always in the range .
- Example: .
(Congruence Relation):
- This is a relation (a statement that is either true or false) between two integers and .
- It asserts that , i.e., and have the same remainder mod .
- Example: is true; is false.
Comparison Table:
| Aspect | ||
|---|---|---|
| Type | Function/operator | Relation (true/false) |
| Output | A number in | A boolean statement |
| Reads as | " modulo " | " is congruent to mod " |
| Example |
Relationship: is true if and only if .
State and prove the following properties of divisibility: (a) If and , then . (b) If , then for any integer . (c) If and , then .
Let be integers with .
(a) If and , then :
Since , there exists integer with . Since , there exists integer with . Then:
Since is an integer, .
(b) If , then for any integer :
Since , there exists integer with . Then:
Since is an integer, .
(c) If and , then (Transitivity):
Since , there exists integer with . Since , there exists integer with . Substituting:
Since is an integer, .
Corollary (Linear Combination): From (a) and (b), if and , then for all integers .
Explain how modular arithmetic is used to compute the day of the week and other cyclic phenomena. Using modulo 7, determine the day of the week 100 days after a Monday.
Cyclic Phenomena and Modular Arithmetic: Many real-world quantities repeat in cycles — days of the week (period 7), hours on a clock (period 12 or 24), months (period 12). Modular arithmetic naturally models these because after reaching the modulus, values wrap back to 0.
If we label days as: Monday , Tuesday , ..., Sunday , then the day days later is:
Problem: 100 days after Monday
- Start = Monday =
- Compute
- , so
Result = , which corresponds to Wednesday.
Other Examples:
- 12-hour clock: Time hours after time is .
- ISBN/checksum digits: Use mod 10 or mod 11.
- Cryptography: Caesar cipher shifts letters using mod 26.
Thus modular arithmetic elegantly captures periodic/wrapping behavior.
Convert the hexadecimal number to (a) binary, (b) octal, and (c) decimal. Show the working for each conversion.
Given where , .
(a) Hexadecimal to Binary: Convert each hex digit to 4 bits.
| Hex digit | 4-bit binary |
|---|---|
| 3 | 0011 |
| A | 1010 |
| F | 1111 |
Concatenating: . Dropping leading zeros:
(b) Hexadecimal to Octal (via binary): Take the binary and regroup into 3-bit sets from the right:
(c) Hexadecimal to Decimal: Use positional values (powers of 16):
Verification: ✓
Explain the number of bit operations required for the standard integer addition algorithm. Derive the time complexity for adding two -bit numbers.
Setup: Let and be two integers each represented with bits (if unequal, pad the shorter with leading zeros so both have bits).
Addition Procedure: We add bit by bit from the least significant to the most significant bit, maintaining a carry.
At each bit position :
Counting Operations:
- At bit position 0: adding requires 1 bit addition (no incoming carry).
- At each subsequent position (from 1 to ): we add three bits (), which requires a constant number () of bit operations.
Thus the total number of bit operations is:
Time Complexity: Since each bit position needs bit operations and there are positions:
Conclusion: The addition of two -bit integers requires a number of bit operations that is linear in , i.e., . This is optimal since every bit of the input must be examined at least once.
Define the greatest integer function (floor) and least integer function (ceiling). Explain their role in the division algorithm and evaluate , , , and .
Floor Function : The greatest integer that is less than or equal to .
Ceiling Function : The smallest integer that is greater than or equal to .
Role in the Division Algorithm: For with , the quotient is given by the floor:
This ensures the remainder satisfies .
Evaluations:
- (greatest integer )
- (smallest integer )
Note: For negative numbers, floor rounds toward negative infinity, not toward zero.
Compare the binary, octal, hexadecimal, and decimal number systems in a tabular form, discussing base, digits used, and typical applications. Why are octal and hexadecimal preferred in computing?
Comparison Table:
| System | Base | Digits Used | Prefix (common) | Application |
|---|---|---|---|---|
| Binary | 2 | 0, 1 | 0b |
Internal machine representation, digital logic |
| Octal | 8 | 0–7 | 0o |
Unix file permissions, compact binary grouping |
| Decimal | 10 | 0–9 | (none) | Everyday human arithmetic |
| Hexadecimal | 16 | 0–9, A–F | 0x |
Memory addresses, color codes, machine code |
Why Octal and Hexadecimal are Preferred in Computing:
-
Compact representation of binary: Computers work in binary, but long binary strings are error-prone to read/write. Since and , conversion between binary and octal/hex is trivial — each octal digit maps to exactly 3 bits and each hex digit to exactly 4 bits.
-
Example: The 8-bit value is or — far shorter and easier to handle.
-
No arithmetic conversion needed: Grouping bits directly gives the octal/hex digits, avoiding tedious division.
-
Hex dominance today: Because modern computers use byte (8-bit) and word sizes that are multiples of 4 bits, hexadecimal aligns perfectly (2 hex digits = 1 byte), making it the standard for memory dumps, addresses, and color codes (e.g.,
#FF8800).
Thus octal/hex act as a convenient human-readable shorthand for binary.
Explain fast modular exponentiation using the method of successive squaring. Compute using this technique.
Fast Modular Exponentiation (Binary/Successive Squaring): To compute efficiently, we use the binary expansion of the exponent and repeated squaring, reducing modulo at each step. This avoids computing the huge number directly.
If , then:
Algorithm:
- Write in binary.
- Compute successive squares .
- Multiply together those squares corresponding to a 1-bit in , reducing mod .
Compute :
- Binary of exponent: , so .
Successive squaring mod 7:
Combine (bits 8, 4, 1 are set):
Result: .
Efficiency: Only multiplications are needed instead of , making this crucial for cryptographic applications like RSA.
Convert the octal number to binary, hexadecimal, and decimal. Clearly explain each conversion step.
Given .
(a) Octal to Binary: Convert each octal digit to 3 bits.
| Octal digit | 3-bit binary |
|---|---|
| 7 | 111 |
| 2 | 010 |
| 5 | 101 |
Concatenating:
(b) Octal/Binary to Hexadecimal: Take binary and regroup into 4-bit sets from the right (pad left with zeros):
(c) Octal to Decimal: Use positional powers of 8:
Verification via hex: ✓
State the Well-Ordering Principle and use it to prove the existence part of the Division Algorithm.
Well-Ordering Principle (WOP): Every non-empty set of non-negative integers has a least element.
Division Algorithm (Existence): For any integer and positive integer , there exist integers and such that with .
Proof of Existence using WOP:
Consider the set of all non-negative values of the form :
Step 1 — is non-empty: We can choose small enough (very negative) so that . For example, take ; then since . So .
Step 2 — Apply WOP: Since is a non-empty set of non-negative integers, it has a least element. Call it for some integer . By construction .
Step 3 — Show : Suppose, for contradiction, that . Then:
This means , but , contradicting that is the least element of .
Therefore , completing the existence proof.
Note: Uniqueness is proved separately by assuming two representations and showing they must be equal.
Explain how integers are added and multiplied in arithmetic modulo m by giving the general rules, and perform the following computations in : (a) , (b) , (c) the additive inverse of , (d) .
General Rules in :
- Addition: — add normally, then take remainder mod .
- Multiplication: — multiply normally, then take remainder mod .
- Additive inverse of is the element , since .
Computations in (so ):
(a) :
Result
(b) :
Result
(c) Additive inverse of :
Check: . Result
(d) :
Result
Define divisibility of integers. State and explain the Division Algorithm with a suitable example.
Divisibility: An integer divides an integer (written ) if there exists an integer such that . Here is called a divisor or factor of , and is a multiple of .
Division Algorithm: For any integer and positive integer , there exist unique integers (the quotient) and (the remainder) such that:
- (floor of )
Example: Let and .
Here and , where .
Example with negative dividend: Let , .
Here and (remainder is always non-negative).
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 →