JA EN

#algorithm

15 articles

01 ·Numerical Computing·★ MEMBER·13 min read Solving Systems of Equations — Direct Methods and Iterative Methods How much a bridge sags, how heat spreads through a room, what a Gaussian process predicts — once a computer gets hold of them they all turn into the same shape, Ax = b. This article builds up elimination (LU) and approximation (conjugate gradients) from zero, through why a million-unknown system can't be solved by elimination, all the way to condition numbers, preconditioning, and matrix-free solvers. 02 ·Numerical Computing·★ MEMBER·13 min read Solving Systems of Equations — Direct Methods and Iterative Methods How much a bridge sags, how heat spreads through a room, what a Gaussian process predicts — once a computer gets hold of them they all turn into the same shape, Ax = b. This article builds up elimination (LU) and approximation (conjugate gradients) from zero, through why a million-unknown system can't be solved by elimination, all the way to condition numbers, preconditioning, and matrix-free solvers. 03 ·Parallel & Distributed·★ MEMBER·9 min read Concurrency from Scratch — Locks, Atomics, and Memory Models Why data races happen and why they refuse to reproduce in your tests, starting from zero. Locks, atomic operations, CAS, and memory models, built up through metaphor, math, and code. 04 ·Numerical Computing·★ MEMBER·12 min read Build Your Own Autograd — A Mini PyTorch in 100 Lines Start from a single Value class, add operator overloading, topological ordering, and gradient accumulation, then put a neural network on top and train it. Once you have seen the reasons behind each design choice, zero_grad() and retain_graph stop being trivia to memorize. 05 ·Numerical Computing·★ MEMBER·12 min read Build Your Own Autograd — A Mini PyTorch in 100 Lines Start from a single Value class, add operator overloading, topological ordering, and gradient accumulation, then put a neural network on top and train it. Once you have seen the reasons behind each design choice, zero_grad() and retain_graph stop being trivia to memorize. 06 ·Data Structures·★ MEMBER·PAPER·13 min read Probabilistic Data Structures — Counting Without Counting Bloom filters, HyperLogLog and the Count-Min sketch explained from zero — how giving up the right to always be correct buys you memory that never grows, and how large services actually operate these sketches. 07 ·Complexity·★ MEMBER·12 min read Approximation Algorithms — Trading Exactness for a Guarantee The craft of giving up on the optimal answer while attaching a price tag that reads "never worse than X times optimal". We build up the approximation ratio, carry a greedy proof all the way to the end, and see why the triangle inequality flips the entire conclusion for the traveling salesman problem. 08 ·Complexity·FREE·9 min read NP-Completeness from Scratch — Not Unsolvable, but Fast to Verify NP does not stand for Non-Polynomial. It is the class of problems where, if someone hands you an answer, you can check it quickly. We build up P vs NP, reductions and NP-completeness from zero, then look at how all of it shows up in shift rosters and delivery routes. 09 ·Data Structures·★ MEMBER·10 min read B-Trees and LSM-Trees — The Heart of Every Database Almost every database ever shipped sits on a B-tree or an LSM-tree. Starting from one physical fact — storage can only be written a page at a time — here is why the two designs came out opposite, what write amplification really is, and how PostgreSQL and RocksDB differ, from zero background to the knobs you actually turn. 10 ·Numerical Computing·FREE·10 min read How Autodiff Actually Works — Unpacking the PyTorch Magic Why does writing loss.backward() hand you derivatives for millions of parameters? We build up computation graphs, the chain rule, and forward vs. reverse mode from zero — then write a working 40-line autograd engine. 11 ·Complexity·★ MEMBER·12 min read Randomized Algorithms — Why Rolling Dice Makes Things Faster Why does adding randomness make an algorithm faster? We build up quicksort with a random pivot, the one-sided error of Bloom filters, and the Monte Carlo / Las Vegas split from zero background — ending with the ways mishandled randomness actually breaks systems in production. 12 ·Numerical Computing·★ MEMBER·10 min read Numerical Pitfalls — Cancellation, Rounding, and logsumexp Where "the loss went nan three hours into the run" actually comes from, built up from nothing: how rounding enters, how the condition number amplifies it, and why subtracting two close numbers is so destructive. It all converges on logsumexp — the one trick sitting inside every softmax and cross-entropy implementation. 13 ·Numerical Computing·★ MEMBER·10 min read Numerical Pitfalls — Cancellation, Rounding, and logsumexp Where "the loss went nan three hours into the run" actually comes from, built up from nothing: how rounding enters, how the condition number amplifies it, and why subtracting two close numbers is so destructive. It all converges on logsumexp — the one trick sitting inside every softmax and cross-entropy implementation. 14 ·Data Structures·★ MEMBER·11 min read Cache-Friendly Code — Why Two O(n) Loops Can Differ by 10× Two implementations with identical complexity can differ by an order of magnitude, because the CPU never fetches one value — it fetches a 64-byte block. Locality, cache lines, arrays versus linked lists, AoS versus SoA, loop order and false sharing, from zero assumed background to checking it yourself with perf. 15 ·Numerical Computing·★ MEMBER·PAPER·9 min read The FFT from Scratch — Why Convolution Turns into Multiplication A from-zero walk through the Fourier transform: a smoothie metaphor, the spinning-needle intuition, the DFT formula, and the divide-and-conquer trick behind the FFT — ending with the polynomial-multiplication view that makes the convolution theorem feel obvious.