Phase 19
Computational Mathematics & Problem Solving
Phase 19 of the Quant Academy curriculum.
19.1Full Lesson
Divisibility, GCD, and the Euclidean Algorithm
The arithmetic of the integers: division with remainder, greatest common divisors, and Bézout’s identity &m
19.2Full Lesson
Primes, Sieves, and Integer Factorization
Fundamental theorem of arithmetic, the sieve of Eratosthenes and its linear/segmented cousins, multiplicative functions,
19.3Full Lesson
Modular Arithmetic, Inverses, and Fast Exponentiation
Working in \(\Z/n\Z\): congruences, inverses, Fermat and Euler, the Chinese Remainder Theorem, and computing \(a^b\bmod \lt /div\gt \lt div class="lc-meta"\gt \lt span\gt Intermediate\lt /span\gt · \lt span\gt 60 min\lt /span\gt \lt /div\gt \lt /a\gt \lt a class="lesson-card" data-module-id="p19-exact-arithmetic" href="exact-arithmetic.html"\gt \lt div class="lc-top"\gt \lt span class="lc-num"\gt 19.4\lt /span\gt \lt span class="lesson-badge full"\gt Full Lesson\lt /span\gt \lt /div\gt \lt div class="lc-title"\gt Exact Arithmetic: Big Integers, Rationals, and Floating-Point Traps\lt /div\gt \lt div class="lc-sub"\gt When \(10^{16}+1\) equals \(10^{16}\), and what to do about it: IEEE-754, catastrophic cancellation, exact rationals, an
19.5Full Lesson
Combinatorics: Counting, Binomials, and Inclusion–Exclusion
Bijections, the twelvefold basics, Pascal’s recurrence, binomials mod a prime, and inclusion–exclusion as th
19.6Full Lesson
Recurrence Relations and Generating Functions
From Fibonacci to Catalan: solving linear recurrences in closed form, and turning a whole sequence into a single analyti
19.7Full Lesson
Dynamic Programming: Memoization and Tabulation
Optimal substructure, overlapping subproblems, top-down vs bottom-up - and, as a payoff, combinatorial game theory
19.8Full Lesson
Bit Manipulation and State Compression
Subsets as integers: enumerating \(2^n\) states, popcount and lowbit tricks, subset-sum DP, and the \(O(2^n n^2)\) trave
19.9Full Lesson
Graph Algorithms: BFS, DFS, Dijkstra, and Minimum Spanning Trees
Modelling a problem as a graph is usually the whole solution; after that, four classical algorithms cover most of what y
19.10Full Lesson
Search: Backtracking, Branch-and-Bound, Binary Search, Meet-in-the-Middle
How to explore an exponential space without visiting all of it - plus the computational geometry predicates that l
19.11Full Lesson
Integer Partitions and Counting Structures
p(n), Euler’s product, the pentagonal number theorem, and the family of counting structures (Stirling, Bell, Catal
19.12Full Lesson
Continued Fractions, Pell Equations, and Diophantine Approximation
The best rational approximations to a real number, the periodic expansion of a quadratic surd, and how that periodicity
19.13Full Lesson
Matrix Exponentiation and Linear Recurrence Acceleration
Any linear recurrence is a matrix product; square-and-multiply then evaluates term \(10^{18}\) in \(O(k^3\log n)\) opera
19.14Full Lesson
Computational Complexity, Feasibility Estimation, and Proving Algorithms Correct
The two questions to ask before writing any code: will it finish, and will it be right? Plus the disciplined optimizatio