Latest articles
Notes on software, mathematics, and machine learning.
Calculus II — Gradients & Gradient Descent from Scratch
Derive gradients and quadratic step-size bounds, compare batch and stochastic updates, and test convergence and numerical assumptions.
Probability — Random Variables, Distributions, Expectation
Uncertainty, quantified: random variables, the distributions you'll actually meet (Bernoulli, binomial, normal, exponential, Poisson), expectation, variance, and Bayes' rule.
Arrays & Strings — Indexing, Slicing, Two-Pointer
Apply indexing, slicing, compaction and two-pointer methods with explicit ordering, mutation, Unicode and complexity contracts.
Hashmaps & Sets — Hash Functions, Collisions
Derive hash-table lookup and collision behavior, stable hash/equality contracts, ordering limits and explicit expected versus worst-case costs.
Stacks & Queues — LIFO/FIFO in Practice
Apply LIFO and FIFO invariants to traversal, monotonic structures and bounded queues; distinguish local ordering from distributed guarantees.
Recursion — Call Stack, Base Case, Worked Examples
Trace recursive calls and base cases, account for memo and stack resources, and compare equivalent iterative implementations.
Trees & BSTs — Traversal (BFS/DFS)
Trace tree traversal and BST invariants with explicit height, ordering, duplicate, node-identity and range-output contracts.
Heaps & Priority Queues
Apply heap invariants to top-K, merging, medians and weighted paths while accounting for ties, storage and update costs.
Graphs — Representation, BFS, DFS, Shortest Path
Represent graphs and derive traversal, connectivity and shortest-path algorithms under explicit vertex, ordering and edge-weight contracts.
Sorting — Merge, Quick, and When to Trust the Built-in
Compare merge, quick and heap sorting with explicit stability, comparator, storage and worst-case contracts, including when to use Python built-ins.
Dynamic Programming — Memoisation & Tabulation
Define states, transitions, base cases and evaluation order; derive time and storage from the actual state space rather than assuming polynomial complexity.
Greedy & Backtracking — When to Use Each
Prove greedy choices for the precise objective, and build complete backtracking searches with correct undo, sound pruning and explicit output costs.
Learning paths
Prefer a guided sequence? Explore connected lessons, examples, and interactive experiments by subject.