Computing

A computer does exactly what you said, fast enough to make the difference between a good algorithm and a bad one impossible to ignore. These tools run both and let you watch the gap open.

Newest in this category

Chapters

Short sequences rather than single tools. Each step hands the next one something specific, so they are worth doing in order.

L1: foundations

How codes are broken

COMPEach cipher here hides the letters and leaves something else showing. A substitution leaves the letter counts, a keyword cipher leaves them in columns, and a one-time pad used twice leaves the spaces. Only a random key as long as the message shows nothing at all, and then the hard part becomes getting that key to the other side, which the last two pages do in public.

  1. 01Substitution cipher
  2. 02Vigenère cipher
  3. 03One-time pad
  4. 04Diffie–Hellman
  5. 05RSA

L2: school

What a data structure makes cheap

COMPEvery structure here answers one question fast and pays for it somewhere else. A Bloom filter keeps no keys at all and can still say definitely not; a trie answers the prefix questions a hash table cannot; a heap always knows its smallest key and little else. The last page asks which page to throw out of memory, where the best answer needs the future.

  1. 01Bloom filter
  2. 02Trie
  3. 03Binary heap
  4. 04Page replacement

L3: undergraduate

Protecting a stream: revoke a device, then find out which one

COMPTwo halves of the same problem, in the order a studio meets them. First, a key has leaked and the licence must keep working for everyone else — which turns out to cost a header that does not grow with the size of the system at all. Then the harder half: knowing whose key it was, from a copy that several subscribers built together specifically so that it names nobody.

  1. 01Device revocation
  2. 02Forensic watermarking

L3: undergraduate

The Fourier transform in practice

COMPA signal is a sum of spinning arrows, and every practical way of reading them off costs something the textbook formula leaves out. A finite window smears a tone that does not fit it across every bin; a shorter window buys time and pays in pitch; an average is a filter with a shape of its own; and the last page is the reason any of it is affordable.

  1. 01Discrete Fourier transform
  2. 02Spectrogram
  3. 03Moving average as a filter
  4. 04Fast Fourier transform

L3: undergraduate

Why an algorithm is correct

COMPAn algorithm is right for a reason that can be stated, and wrong for one a small test can find. Each page sets a correct version beside a plausible wrong one: fourteen of the sixteen ways to write binary search fail, greedy change-giving loses on old British coins and never on US cents, Kruskal and Prim agree for a reason, and a code that corrects one flipped bit makes two flips worse.

  1. 01Binary search
  2. 02Coin change
  3. 03Minimum spanning tree
  4. 04Hamming code

Problems solved in full

What you find out here

Articles written from these tools

Every tool on this shelf

Algorithms & Data Structures

BFS vs DFS Visualizer
Node 15 sits 6 edges from the start; depth-first can hand you a 12-edge route to it. The component holds 15 nodes on 16 edges, so 2 surplus edges cause every disagreement the two panels have.
Big-O Complexity Explorer
Visualize how O(1), O(log N), O(N), O(N²), O(2ᴺ) and O(N!) growth rates compare at different scales.
Binary Heap: A Priority Queue in an Array
Fifteen keys arriving largest first cost 34 comparisons inserted one at a time and 22 built from the last parent; at 1,023 keys it is 8,194 against 2,026. Step through every comparison and swap, with the tree and the array side by side, and take the keys out smallest first.
Binary Search: Four Choices, Sixteen Loops
A binary search loop has four choices in it, and only two of the sixteen ways to make them are right. Build the loop, watch it run on a small array, and test it on every array up to 256 elements, where every wrong loop has already failed by two elements.
Bloom Filter: Definitely Not, or Probably Yes
Insert words into a Bloom filter one at a time, look others up, and count the false positives over 10,000 strings that were never inserted. Compare the standard estimate with what this filter actually does, find the best number of hash functions, and see why a plain Bloom filter cannot delete.
BST / AVL Tree Visualizer
Insert 10, 20, 30, 40, 50, 60, 70 in that order and the tree is a chain of height 7, seven comparisons to find the last key where three would do. AVL rotations put the same seven keys at height 3.
Coin Change: Greedy against Optimal
To pay 48d in old British money, greedy change-giving hands over a half-crown, a shilling and a sixpence, where two florins would do. Greedy against the dynamic-programming optimum on any coin system, the table filled cell by cell, and the bound that makes checking a system a finite job.
Diffie–Hellman: A Secret Agreed in Public
Alice and Bob agree a secret over an open line, and you play the eavesdropper. Step through brute force and Pohlig–Hellman one try at a time, and see why the prime 1621 falls in at most 21 tries while 1619, two below it, holds out for 811.
Dijkstra's Shortest Path
Node 1 is one edge from the source at a cost of 4, and its shortest distance is 3 by way of node 3. Load the negative-edge preset and node 3 settles at −1 while the route reconstruction reports a loop.
Graph Coloring Explorer
Color graph vertices, test chromatic constraints, and explore clique lower bounds.
Hash Table Visualizer
See how hash tables store data with chaining, linear probing, and quadratic probing collision resolution.
Levenshtein Distance Visualizer
Compute the edit distance (insertions, deletions, substitutions) between two strings and visualize the comparison.
Minimum Spanning Tree: Kruskal and Prim
Twelve villages, 66 possible roads. Kruskal and Prim take 11 of them in different orders and end on the same 199.04 km, because each road they take is the cheapest across a cut. Driving on to the nearest village instead costs 10.76% more, and for three towns 40 km apart a junction between them saves 13.40%.
One-Time Pad: Unbreakable Once, Broken Twice
Encrypt a message with a random key as long as itself, then type any other message of the same length and get the key that would have produced it. Reuse the key on a second message, watch it cancel, and drag a guessed word across the two to read them both.
Page Replacement: FIFO, LRU and the Optimal Policy
Step a reference string through a few page frames under FIFO, LRU and Bélády's optimal policy and count every fault. On 1 2 3 4 1 2 5 1 2 3 4 5, FIFO faults 9 times with three frames and 10 times with four; LRU and OPT never fault more for having more memory.
Pathfinding Algorithm Visualizer
Watch A*, Dijkstra, Greedy Best-First, and BFS search a grid, step by step.
Recursion Tree Explorer
Count the calls, distinct subproblems and stack depth of a naive recursive call tree for Fibonacci, Tower of Hanoi, Pascal's rule, merge sort and stair climbing, and see exactly where a memo table pays.
Sorting Algorithm Race
Reversed 64 elements cost bubble sort exactly 2,016 swaps, one per inversion, and every neighbour-swapping algorithm has that same floor. Quicksort clears them in 32 exchanges, moving elements 63 places.
Substitution Ciphers: 26! Keys, Broken by Counting Letters
Break a Caesar cipher and a full substitution cipher yourself, from letter counts. Chi-squared names the right Caesar shift 99.1% of the time at 31 letters; ranking letters by frequency, even over a whole 32,725-letter story, still gets five of the 26 wrong.
Trie: The Prefix Tree, Step by Step
Store words in a trie and step through a lookup, an autocomplete and an insert. The same word is counted against binary search and a hash table letter by letter, and the bytes of each structure are counted too: sharing 40 of its 70 letters still leaves the trie 2.6 times the size of the plain list.
Vigenère Cipher: Find the Key Length, Then Break It
Encrypt the opening of Alice's Adventures in Wonderland with a keyword, then break it yourself: find the key length from the index of coincidence of every k-th letter, check it against Kasiski's repeated letter groups, and read each key letter off a chi-squared score.

Signal & Media Processing

Chroma Subsampling Lab
Compare 4:4:4, 4:2:2, and 4:2:0 to see color-detail loss in image and video compression.
Color Contrast Checker (WCAG Luminance)
Check text/background color contrast against WCAG 2 accessibility thresholds — and see how the luminance formula behind it descends from 1953 broadcast television's need to squeeze color into an existing black-and-white signal.
Convolution and Feature Maps Playground
Fourteen stacked 3×3 layers let one output pixel see the whole 28×28 image, at 126 multiply-accumulates. One 29×29 kernel with the same reach costs 841, which is why vision networks are long and thin.
Discrete Fourier Transform
Sample a pure tone 64 times and take its discrete Fourier transform: at exactly 10 cycles it is one clean bar, at 10.5 it lights every bar and the tallest reads 64.61% of the tone. Each bar is drawn as the 64 arrows that add up to it, with a window to trade the smear for a wider peak.
GOP Structure Visualizer
Understand I/P/B frame patterns, seek latency, and compression tradeoffs in video streams.
Motion Estimation Simulator
225 search positions per block is a 15×15 window, −7 to +7 pixels, and the cost is quadratic in radius: 961 at 15, 3969 at 31. A three-step search checks 27 instead and accepts a worse vector.
Pixel Sampling Lab
Understand sampling, Nyquist, and aliasing with signal and pixel-grid visualizations.
Quantization Lab
Eight-bit quantisation reads 56.18 dB here where the textbook 6.02N + 1.76 says 49.92. The 6.2 dB gap is crest factor: that rule is about a full-scale sine, and this ramp has more than twice its RMS.
Rate Control Simulator
CRF and CBR spend the same 2000 bits a frame here, and CRF still scores 89.8 against 79. The 10.8 points buy a flat peak: CBR's largest frame is 2000 bits where CRF's is 4078.
Sobel vs Canny Edge Detector
Apply Sobel gradients and Canny hysteresis to compare edge-detection pipelines.
Spectrogram
A spectrogram slides a short Fourier transform along a piece of music, and the window length decides what it can show. Telling A4 from A♯4 takes 72.0 ms with a Hann window; a semitone at A1, 55 Hz, takes 576.2 ms, more than four sixteenth notes, so a fast bass trill shows which note is playing in under a quarter of the slices with any window up to a second long.
The Fast Fourier Transform
The fast Fourier transform gets the same N numbers as the direct sum with about N log N multiplications instead of N². Step through its butterflies, redo Gauss's own twelve-point example from his unpublished manuscript of about 1805, and time both methods in your browser.
Video Encoding Lab
Learn bitrate, codec, CRF/CBR, and quality tradeoffs with live visual estimates.

Automata & Cryptography

Boolean Expression Solver
Type Boolean logic expressions and generate a full truth table with intermediate sub-expression columns.
Cache Locality: Why the Order of Reads Matters
Sum the same matrix by rows and by columns through a small direct-mapped cache and count every hit and miss. The same additions over the same addresses give 48 hits of 64 in one order and none in the other; four unused ints per row bring the slow order level.
Finite State Machine Animator
Step through DFA transitions with a live state diagram — watch which state is active after each symbol and whether the input is accepted.
Logic Gates Explorer
Interactive logic gate and small-circuit visualizer with signal pulses, timing strips, and compact truth tables.
Memory and Bytes: Endianness, Types and Addresses
Thirty-two bytes of memory and nothing to say what they mean. Read any of them as an 8, 16 or 32-bit integer, a float or text, little- or big-endian, and see each byte's place value under it. 1 read in the wrong order is 16,777,216; π's float bytes read as an integer are 1,078,530,011.
Revoking a Device Without Telling Everyone Else
Sixty-four compromised devices out of a million need a licence header of 846 keys, or 77, or 3. Which one depends on the scheme, and on whether the sixty-four were a batch.
RSA Encryption Toy
p = 61 and q = 53 give n = 3233, which sixteen trial divisions break. Leaking φ = 3120 breaks it just as completely: p + q = 114 and pq = 3233 is a quadratic that hands back both primes.
The Call Stack: Frames, Return Addresses and Overflows
Watch function calls as writes to memory: each call pushes an argument, a return address and a saved frame pointer onto a 128-byte stack, and each return jumps to whatever the return-address slot holds. Recursion, stack overflow, an array that writes over its own return address, and a variable that holds what the last call left.
The Watermark That Survives a Collusion
Every copy carries a different bit string, so a leak names the subscriber. Four of them compare copies and forge one that names nobody — unless the string is 2,490 bits long, and sixteen of them need 39,833.
Tiny CPU: the Little Man Computer
Step the Little Man Computer one register transfer at a time and watch every memory read and write as it happens: PC, MAR, MDR, CIR and the accumulator, a hundred mailboxes, and programs you can edit. Counts how much of a program's memory traffic is the machine reading its own instructions.
Turing Machine Simulator
A 5-cell palindrome costs 21 moves and a 21-cell one costs 253, because one head must walk the whole tape per pair. A second tape makes the job linear, and Hennie proved in 1965 that a single tape cannot.

Other tools

Bitrate vs Size Calculator
One extra megabit per second costs 450 MB an hour whatever is in the picture. On a ten-minute clip at 6 Mbit/s the audio is 3.1% of a 478 MB file, so halving it saves 7 MB and costs every listener.
BPE Tokenizer Explorer
See how byte-pair encoding splits text into the tokens a language model actually reads. Fixed vocabulary, live inference — watch English cost 13 tokens where the same German sentence costs 36.
Encrypting One Block in Ten (CENC cbcs)
The cbcs scheme encrypts one 16-byte block in ten, and a 48-byte slice comes out a third ciphertext. The clear nine tenths are no use without the key, because in every slice the pattern reaches, the first byte after the header is ciphertext.
Hamming Code: Correcting a Bit by Naming Where It Is
Four data bits in seven, and three parity checks whose failures spell the wrong bit's position in binary, so a single flip is put right every time. Flip two and the decoder confidently flips a third; one more bit turns that into a flag.
Rotating the Keys of a Live Stream
Two-minute key rotation for a year makes 262,800 content keys, 4.20 MB of them. What it costs is a million players asking for each new key in the same ten seconds, and the key hierarchy that cuts the asking 720-fold makes a single leak 720 times larger.
Screen Resolution and Viewing Distance
How much of a screen's resolution actually reaches your eye, from its diagonal, its pixel count and where you sit. At 20/20 vision the answer is the field of view measured in arcminutes, and on a living-room television it usually lands below 1080p.
Temperature and Sampling
Watch a real next-token distribution get reshaped by temperature and truncated by top-k and top-p. Temperature never changes which token leads — only by how much, from 278x down to 1.76x.
Token Vectors and Similarity
Vectors built by counting which tokens appear near which, over this site's own prose. The pair that scores highest is ␣the and ␣is at 0.505 — higher than ␣Earth and ␣Sun at 0.299, and it means nothing.
Related categories: Mathematics, Physics