Number Systems – Advanced University‑Level Notes
(Quantitative Aptitude – “RPF Constable” – Deep Dive for MIT‑style rigor)
Goal: Master the theory, algorithms, and edge‑cases of positional number systems, and apply this knowledge to solve challenging problems that appear in aptitude exams and research‑level coursework.
1. Foundations
| Concept | Symbol | Definition |
|---|---|---|
| Base | (b) | Positive integer (b \ge 2). The radix of the positional system. |
| Alphabet | (\Sigma_b = {0,1,\dots,b-1}) | Set of allowed digits. |
| Place value | (b^k) | Weight of the (k)-th digit (from right, (k=0) is units). |
| Number | (N = \sum_{k=0}^{m} d_k b^k) | With (d_k \in \Sigma_b). |
| Radix point | (\cdot) | Separates integer part (left) from fractional part (right). |
| Fractional digit | (\delta_k) | Digit at position (-k) (right of radix), contributes (\delta_k b^{-k}). |
Key theorem (Uniqueness)
For a fixed base (b) and a finite representation with no leading zeros, the expansion (N = \sum_{k=0}^{m} d_k b^k) is unique.
Proof Sketch:
Assume two distinct expansions. Subtracting yields (\sum_{k=0}^{m} (d_k - d'_k)b^k = 0). The left side is a non‑zero integer multiple of (b^0) but less than (b^{m+1}) in absolute value, impossible unless all differences vanish. ∎
2. Conversion Algorithms
2.1 Integer Part
| From | To | Method |
|---|---|---|
| Base (b) → Base (c) | Repeated division | While (N>0): (r = N\bmod c); prepend (r); (N \leftarrow \lfloor N/c \rfloor). |
| Base (b) → Decimal | Direct evaluation | (D = \sum_{k=0}^{m} d_k b^k). |
| Decimal → Base (c) | Same as above, with (b=10). |
Complexity: (O(\log_b N)) digit operations.
2.2 Fractional Part
| From | To | Method |
|---|---|---|
| Base (b) fractional → Base (c) | Iterative multiplication | Let (x) be fractional part. For each desired digit (d): (x \leftarrow x \cdot c); (d = \lfloor x \rfloor); (x \leftarrow x - d). |
| Rational fractions | Exact representation possible iff denominator’s prime factors divide base. | Factorize denominator; if all primes divide (c), expansion terminates. |
Edge‑case: An irrational fraction (e.g., (1/\pi)) never terminates in any base; digits are non‑repeating.
3. Divisibility and Congruences in Arbitrary Bases
| Rule | Condition | Proof Sketch |
|---|---|---|
| Sum‑of‑digits test (base (b)) | (b-1) divides (N) iff it divides (\sum d_k). | Because (b \equiv 1 \pmod{b-1}). |
| Alternating‑sum test (base (b)) | (b+1) divides (N) iff it divides (\sum (-1)^k d_k). | Because (b \equiv -1 \pmod{b+1}). |
| General modulus | (b^k \equiv 0 \pmod{b^k}). | Trivial. |
Note: In binary ((b=2)), the sum‑of‑digits test is parity: (N) even ↔ even number of ones.
4. Advanced Topics
4.1 Redundant and Balanced Representations
| System | Alphabet | Example |
|---|---|---|
| Signed‑digit | ({-1,0,1}) (balanced ternary) | (2 = 1\cdot3^1 + (-1)\cdot3^0) |
| Floating‑point | Sign, exponent, mantissa | IEEE‑754 binary32 |
Why useful?
- Balanced ternary has no carry‑over; addition is simpler.
- Floating‑point allows huge dynamic range with fixed word length.
4.2 Gray Code
| Definition | Property |
|---|---|
| Binary reflected Gray code | Adjacent codes differ by exactly one bit. |
Construction:
- (G_1 = 0,1).
- (G_{n+1} = 0G_n, 1\overline{G_n}) (prefix 0 to (G_n), prefix 1 to bitwise complement).
Application: Minimizes error in digital communication.
4.3 Number Representation of Irrational Numbers
- Continued fractions give best rational approximations.
- Base‑(b) expansion of (\sqrt{2})