Number System – Advanced Study Notes
(MIT‑style, first principles to edge‑case analysis)
Audience – Graduate students, advanced undergraduates, and competitive‑exam aspirants (e.g., Nagaland Patwari / Lekhpal).
Goal – Provide a rigorous, self‑contained treatment of number systems, covering all familiar bases, their algebraic properties, and subtle edge cases that often trip up test‑takers.
Structure
- Foundations & Definitions
- Positional Number Systems
- Conversions & Algorithms
- Divisibility, Modular Arithmetic & Number‑Theory Links
- Edge Cases & Non‑Standard Bases
- Advanced Topics (brief)
- Challenging Practice Problem
1. Foundations & Definitions
| Symbol | Meaning | Notation |
|---|---|---|
| (\mathbb{N}) | Natural numbers (positive integers) | 1,2,3,… |
| (\mathbb{Z}) | Integers (positive, zero, negative) | …,-2,-1,0,1,2,… |
| (\mathbb{Q}) | Rational numbers | (\frac{p}{q}), (p,q\in\mathbb{Z}), (q\neq0) |
| (\mathbb{R}) | Real numbers | All limits of Cauchy sequences of rationals |
| (\mathbb{C}) | Complex numbers | (a+bi,\ a,b\in\mathbb{R}) |
| (\mathbb{Z}_b) | Residue ring modulo (b) | ({0,1,\dots,b-1}) |
All arithmetic we discuss is performed in (\mathbb{Z}) unless otherwise noted.
2. Positional Number Systems
2.1 Positional Notation
A base (or radix) (b) is a positive integer (b\ge 2).
Any integer (n) can be uniquely expressed as
[ n = d_k,b^k + d_{k-1},b^{k-1} + \dots + d_1,b + d_0 ]
where each digit (d_i) satisfies (0 \le d_i < b).
Proof of Uniqueness
Assume two distinct representations exist. Let (k) be the largest index where they differ. Then
[ \sum_{i=0}^k (d_i-d_i'),b^i = 0 ]
but (|d_i-d_i'| < b) for all (i). The left side lies strictly between (-b^{k+1}) and (b^{k+1}), yet is a multiple of (b^{k+1}) only if it is zero. Contradiction → uniqueness.
2.2 Base‑(b) Digits
| Base | Digits |
|---|---|
| 2 | 0,1 |
| 8 | 0–7 |
| 10 | 0–9 |
| 16 | 0–9, A–F (representing 10–15) |
2.3 Fractional Part
A rational number (q=p/q) can be expanded as
[ q = \sum_{i=1}^{m} \frac{d_{-i}}{b^i} ]
where (d_{-i}\in{0,\dots,b-1}). If the expansion terminates, the fraction has a finite representation; otherwise it is periodic.
Periodicity Theorem
A fraction (p/q) (in lowest terms) has a terminating base‑(b) expansion iff (\gcd(q,b^k)=1) for some (k). Equivalently, all prime factors of (q) divide (b).
3. Conversions & Algorithms
3.1 Integer to Base‑(b)
Repeatedly divide by (b), recording remainders:
function toBase(n,b):
digits = []
while n>0:
digits.append(n mod b)
n = floor(n / b)
return reverse(digits)
3.2 Base‑(b) to Decimal
Compute weighted sum:
function fromBase(digits,b):
n = 0
for d in digits:
n = n*b + d
return n
3.3 Fraction Conversion
Use long‑division style algorithm: at each step multiply the remainder by (b), take integer part as next digit, continue.
Example
( \frac{1}{3}) in base 10 → 0.333…
In base 2:
- (1 \times 2 = 2) → digit 0