On this page
Picture two files, each a million characters long. One is 0101…01, the pair "01" written 500,000 times. The other came from a million fair coin tosses. Both take the same space on disk, yet one is obviously simpler. Kolmogorov complexity turns that hunch into a number, and in doing so it gives mathematics a working definition of randomness.
What is Kolmogorov complexity?
The Kolmogorov complexity of a string is the length of a shortest computer program, in a fixed programming language, that produces the string as output (Wikipedia: Kolmogorov complexity). It is usually written K(s).
Three people reached the idea independently. Ray Solomonoff set it out in a 1964 paper on inductive inference90223-2); Andrey Kolmogorov in work later printed in English as Three approaches to the quantitative definition of information; and Gregory Chaitin in a 1966 Journal of the ACM paper on the length of programs that compute binary sequences.
The invariance theorem says that switching languages changes K(s) by at most a constant that depends on the two languages, not on the string (Wikipedia).
Why is 0101…01 simple but a random string is not?
Try writing the shortest program for each file, with the definition above in mind.
Patterned file: print "01" 500,000 times. The only part that grows with the file is the number 500,000, which fits in 19 binary digits because 2¹⁹ = 524,288. The program is a fixed bit of code plus about 19 bits.
Coin-toss file: there is almost certainly no pattern to exploit, so the best program is print "…" with all million digits written out. That is slightly longer than the string itself.
Now double both files. The patterned program needs one more bit, because 1,000,000 fits in 20 binary digits. The random program doubles. That growth rate is the real test of simplicity.
Why are most strings incompressible?
There are 2ⁿ binary strings of length n but only 2ⁿ − 1 strings shorter than n, so at least one string of every length has no shorter description (Wikipedia: Kolmogorov complexity). Each program prints only one string, so there are not enough short programs to go round.
To compress a string by c bits you need a program shorter than n − c bits. There are fewer than 2ⁿ⁻ᶜ of those, so fewer than one string in 2ᶜ can shrink that much:
c = 1: fewer than half of all strings shrink by even one bit.
c = 10: fewer than 1 in 1,024, under 0.1%.
c = 20: fewer than 1 in 1,048,576.
Try it: make one text file of 01 repeated a few thousand times and another of random key presses of the same length, zip both, and compare sizes.
Why can't a computer calculate Kolmogorov complexity?
The proof borrows from the Berry paradox. Bertrand Russell, the first to discuss it in print, credited it to the Oxford librarian G. G. Berry: "the smallest positive integer not definable in under sixty letters" is itself defined in fewer than sixty letters (Wikipedia: Berry paradox).
Turn that into a proof that K is not a computable function (Wikipedia: Kolmogorov complexity):
Suppose a program of length L computes K(s) for every string s.
Build a new program: go through strings in order and print the first one with K(s) > N. The counting argument says such a string exists.
The new program is L bits, plus about log₂ N bits to store N, plus a constant: far below N when N is large.
So a program shorter than N prints a string whose shortest program is longer than N. Contradiction.
It uses the same kind of self-reference as Turing's diagonal argument for the halting problem. Any compressor still gives an upper bound on K(s), since decompressor plus compressed file is a program; what you cannot do in general is confirm you have found the shortest.
How does Kolmogorov complexity define randomness?
A string is called random when its shortest program is about as long as the string itself (Wikipedia: Kolmogorov complexity). Chaitin's 1966 paper proposed applying these ideas to "the problem of defining a patternless sequence" (Chaitin, J. ACM). Put this together with the counting argument: most strings are random, yet beyond a fixed complexity threshold no formal system can prove that a particular string is (Wikipedia: Kolmogorov complexity).
This differs from Shannon entropy and why a fair coin carries 1 bit, which measures the average surprise of a source rather than one fixed string; practical compressors such as arithmetic coding are built on entropy.
A three-question check for any string:
Can I state a rule plus a few numbers that rebuild it? Then K is small.
When the string doubles, does the description grow by a bit or double? A bit means pattern.
Did a compressor shrink it a lot? Then K is low. If it didn't shrink, that is evidence, not proof, of randomness.
If powers of 2, logarithms or the pigeonhole step felt shaky, the Fermi Concept Library covers concepts across physics, chemistry, biology, mathematics and computing, so you can rebuild the pieces before rereading the proof.



