The Cook–Levin Theorem

Symptom You know reductions (T017): to prove your problem hard, reduce a known-hard problem to it. Fine. But that begs the obvious question, and it is the question a sharp colleague asks the first time you use the technique. ...

P vs NP

Symptom You are handed a scheduling problem. Two hundred tasks, precedence constraints, shared resources, and a deadline. Somebody wants an optimal schedule. Checking a proposed schedule takes seconds: walk the list, verify each constraint, add up the makespan. Finding one is different. Your search runs for a day and finds nothing. You try simulated annealing, then a genetic algorithm, then branch and bound. Each gives good schedules and none gives the best one, and you cannot tell whether the problem is hard or you are not clever enough. ...

The Hamming Bound and Error-Correcting Codes

Symptom You are specifying ECC memory for a fleet. The vendor quotes SECDED: single error correct, double error detect, at 8 check bits per 64 data bits. That is 12.5% overhead, and someone in the room asks the obvious question — why not correct two errors? Or three? What does it cost? ...

The Noisy-Channel Coding Theorem

Symptom Your link drops 1% of bits. You need reliable delivery, so you triple every bit and take a majority vote. Now an error needs two of three bits to flip, which happens with probability about $3 \times 10^{-4}$ — better, but you paid 3x in bandwidth and the error rate is still not zero. ...

Huffman Coding Is Optimal

Symptom You are compressing a log file. The symbols are wildly skewed: INFO is 90% of the lines, WARN is 9%, ERROR and FATAL split the rest. Fixed-width two-bit codes give you exactly 2 bits per symbol, and entropy (T018) says the floor is about 0.53 bits. There is a factor of four sitting there. ...

Balls Into Bins and the Power of Two Choices

Symptom You have 100 backends and a load balancer hashing request IDs to pick one. Expected load per backend is exactly 1%, and you have checked the hash is good. ...

Reductions

Symptom You have a new problem. Your build system needs to decide whether two configuration files can ever produce conflicting outputs. Or your linter needs to decide whether a regex with backreferences can match a string of a given length. Or your scheduler needs to decide whether a set of periodic tasks is feasible. ...

The Coffman Conditions

Symptom Production is wedged. Not slow — wedged. CPU is at zero, no errors are being logged, and two threads are sitting in a lock wait with no timeout. The stack traces show thread A holding the account lock and waiting for the ledger lock, thread B holding the ledger lock and waiting for the account lock. Somebody restarts the service and it goes away. ...

Godel's Incompleteness Theorems

Symptom The proof assistant is failing you. You are trying to verify a piece of concurrent code in Coq or Lean, and the tool will not accept your termination argument. A colleague says, without much conviction, “well, Gödel — you can’t prove everything anyway.” ...

Kleene's Recursion Theorem

Symptom Write a program that prints its own source code. No file I/O, no reading __file__, no cheating. The first attempt fails instantly. To print the source you must contain the source, and then the containing text is also part of the source, so you must contain that too. The regress is obviously infinite, and most people conclude after ten minutes that the task is impossible. ...

The Chomsky Hierarchy

Symptom The most upvoted answer in Stack Overflow history is a refusal to answer. Someone asked how to match nested HTML tags with a regular expression, and the reply is a page of escalating horror about the centre not holding. It is funny, and it is also a theorem, which is not obvious from reading it. ...

The Universal Machine

Symptom You write a Python program. It runs. What ran it? CPython — itself a program, written in C, compiled to x86 instructions, executed by a CPU whose control unit is arguably interpreting microcode, possibly inside a virtual machine, on a kernel that scheduled it, all perhaps within a container image. At no point in that stack does anyone find it strange that a program’s job is running other programs. We build emulators, JITs, WebAssembly runtimes, Docker, QEMU, and browsers that download and execute arbitrary code from strangers, and treat every layer as ordinary engineering. ...

The Church–Turing Thesis

Symptom Somebody says “CSS is Turing-complete” and the room splits. Half the people treat it as a joke about a styling language, the other half as a serious claim with consequences. Both reactions are common and only one is right. ...

Concentration Bounds (Chernoff/Hoeffding)

Symptom Your service handles four billion requests a month and you want the error rate. Computing it exactly means a job over four billion log lines. Someone suggests sampling ten thousand of them. ...

Amortized Analysis and the Potential Method

Symptom You have a dynamic array. push writes one element and bumps a counter, which is clearly $O(1)$ — except when the array is full, in which case it allocates a new buffer of twice the size, copies every element across, and frees the old one. That is $O(n)$. ...

Adversary Arguments

Symptom You need the largest and second-largest element of an array. The obvious way is two passes: $n-1$ comparisons for the max, then $n-2$ for the max of the rest. That is $2n - 3$. ...

Linearity of Expectation

Symptom You are analyzing a hash table. You want the expected number of buckets that end up empty. The bucket occupancies are all tangled together — one key landing in bucket 3 makes every other bucket slightly less likely to be chosen — and the dependencies look like they will make the sum intractable. ...

The Omega(n log n) Comparison-Sort Bound

Symptom Every general-purpose sort in every standard library is $O(n \log n)$. Timsort, introsort, pdqsort, merge sort, heapsort. Decades of work by extremely motivated people, an enormous amount of money riding on it, and they all land on the same exponent. ...

Shannon Entropy and the Source Coding Theorem

Symptom You gzip a log file and it drops to 8% of its original size. You gzip the already-gzipped file and it gets slightly bigger. Somebody asks why, and the honest answer you have is “because it’s already compressed,” which is a restatement, not a reason. ...

The Birthday Bound

Symptom You need a short ID for uploads. Eight hex characters feels generous, so you take the first 32 bits of a hash and move on. At about 80,000 uploads, two files collide, and one of them silently overwrites the other, and the bug report says the customer’s invoice contains someone else’s line items. ...