Live data from Hacker News

Kolmogorov Complexity and Compression Distance (2023)

smunshi.net

71–80 of 106 posts

Re: Kolmogorov Complexity and Compression Distance (2023)

#71
post #67

Earlier quoted context omitted.

The stronger result here is that any sort of conversion you can explicitly specify can be turned into a program. Since Kolmogorov Complexity is specified in terms of lengths of programs, that means the KC between two different pairs of encodings can differ at most by a constant amount (the size of the program that converts back and forth). The above is a bit handwavey, there are details you can tighten up (Is it the…

> any sort of conversion you can explicitly specify can be turned into a program. If your Turing machine can only print out zeros and ones, there's no program which can get it to print out "ABC". So it cannot specify a conversion between a language whose symbols are {0,1} and a language whose symbols are {"A",B","C"}. It could specify a mapping between one binary string and another binary string, but it can't even pr…

It is not an intractable problem as you believe it is.

E.g., make the machine print out pixel values for a large screen. The screen can display Chinese characters in canonical ways.

Re: Kolmogorov Complexity and Compression Distance (2023)

#72
post #61

Earlier quoted context omitted.

> Different human languages don't figure into this at all and are completely irrelevant. Back to basics: A Turing machine is specified by a set of symbols it can read/write to a tape, and a state machine matching current state and read symbol to next state and actions. If that set of symbols is just {1,0}, then it absolutely, positively, cannot print out the string "ABC". > the best compression methods out all have a…

Just because a turing machine prints out 0 and 1 at each step doesn't mean the sequences to factor into the calculation of what to print out next can't be longer binary sequences. Pretty much all the best compression methods are language agnostic and work on bit wise sequences. They also pretty much all predict the next bit and feed that into an alogithmic encoder. Eg. look up dynamic markov coding which is commonly…

> the turing machine doesn't care about that. It's also just writing 1's and 0's as per a turing machine.

But a Turing machine does not have to be restricted to just printing out zeros and ones. It can be any finite set of symbols. For example, he Soviets built a computer which used base 3--its symbol set was {-1, 0, 1}. It didn't have bits which could just store "1" or "0", it had trits which could store "-1", "0", or "1".

And why the soviets built such a computer is germane to Kolmogorov complexity just because you can make shorter strings in base 3 than you can in base 2. The choice of symbol set absolutely impacts the length of strings and programs, and therefore impacts the Kolmogorov complexity of strings relative to the computer.

With this in mind, please consider three Turing Machines: A, B, and C

The symbols A prints out on its tape are {"A", "B", "C"}

The symbols B prints out on its tape are {"0", "1"}

The symbols C prints out on its tape are {"0", "1", "A", "B", "C"}

Now consider two strings: "1000001" and "A". Turing machine B could print out "1000001". Turing machine A could print out "A".

You might be tempted to equate "1000001" and "A". But consider the same two strings printed out by machine C:

"1000001" and "A"

Clearly, these are different strings. If C printed out "A", it did not print out "1000001", and vice versa.

> Kolmogorov complexity explicitly includes any dictionary you use in it's calculation.

Sure, but on a binary turing machine, like Machine B above, that dictionary is not going to be matching between binary strings and, say Roman letters. Its going to be mapping from one binary string to another binary string.

Using Machine C, you certainly could write a program which inputed "1000001" and output "A". But you absolutely, positively, cannot write such a program in either machines A or B. Machine A cannot print the string "1000001". And B cannot print the string "A".

Different strings, different things.

Re: Kolmogorov Complexity and Compression Distance (2023)

#73
post #33
post #9

Richard von Mises (brother of the economist) formulated a definition of randomness as a sequence of data that, were you a gambler, you cannot by any strategy make money on betting on the outcomes. This was before computational calculus and was later developed by Kolmogorov and others in algorithmic complexity. The modern variation would be (Wiki) "considering a finite sequence random (with respect to a class of compu…

> you cannot by any strategy make money on betting on the outcomes What does "strategy" mean here? I might just happen to have a strategy which involves betting on the exact sequence of heads and tails in a given sequence. The analogy in terms of languages is that my language might just happen to have a short keyword that represents a given sequence of heads and tails. I don't know much about Kolmogorow complexity so…

The idea is that you bet before the sequence is known. Nowadays we would say it is the distribution (or the process producing the random sequences) that can be truly random or not, and we recognize that saying "sequence [...] is random" is incoherent, same as the joke of the random int set to 4 with a comment in the source code that it was chosen by fair dice roll.

If you know everything about the process and still can't beat chance at predicting it, that's the quality we are after. In this definition "random" just means unpredictable, which is another way to explain why it can only be a meaningful distinction when you don't yet know the result.

Re: Kolmogorov Complexity and Compression Distance (2023)

#74
post #72

Earlier quoted context omitted.

Just because a turing machine prints out 0 and 1 at each step doesn't mean the sequences to factor into the calculation of what to print out next can't be longer binary sequences. Pretty much all the best compression methods are language agnostic and work on bit wise sequences. They also pretty much all predict the next bit and feed that into an alogithmic encoder. Eg. look up dynamic markov coding which is commonly…

> the turing machine doesn't care about that. It's also just writing 1's and 0's as per a turing machine. But a Turing machine does not have to be restricted to just printing out zeros and ones. It can be any finite set of symbols. For example, he Soviets built a computer which used base 3--its symbol set was {-1, 0, 1}. It didn't have bits which could just store "1" or "0", it had trits which could store "-1", "0",…

All of those examples are exactly equivalent and convertable but where you are confusing yourself is that you're thinking of the differing states of a given n-ary system as having explicit symbols. It's best to think of it as simply numeric. Binary 010 is 2 if i were to write in decimal. Ternary 020 is the number 6 if i were to write it in decimal. Etc.

Any actual symbol mapping to the numbers from an n-ary system to actual symbols like you are showing here is actually arbitrary and part of the calculation of space when measuring an algorithms Kolmogov complexity. The program size in kolmogorov complexity includes the dictionary of numerical to symbolic lookup which is what you are getting at here.

Re: Kolmogorov Complexity and Compression Distance (2023)

#75

An excellent rabbit hole to dive into is the equivalence of compression and general AI. Every programmer should make a compressor (and, separately, a ray tracer)! See http://prize.hutter1.net/

Definitely with you on the ray/path tracer :)

Re: Kolmogorov Complexity and Compression Distance (2023)

#76

Kolmogorov Complexity does not help with giving a universal measure of complexity or randomness: https://forwardscattering.org/page/0

It's a lot better than the alternatives. Particularly the misused Shannon entropy.

The top rated answer for "how do i measure Shannon entropy" on stack overflow for example has an accepted answer of "count the probabilities of all 8bit sequences and then multiply the log of those probabilities together as per the equation". Which is a problematic answer. A file of all 8bit characters in sequence repeated many times over won't have any entropy but will have high entropy by this particular arbitrary measure. The problem with Shannon Entropy is that you have no way to define the optimal symbol lengths and frequencies for any given file.

Kolmogorov Complexity on the other hand at least gives some way for us to get a rough estimate. It's just as incalculable as Shannon entropy but at least by essentially explicitly stating "compress it using the best tool you have at hand and see how small it gets and also include the size of the compression program in the calculation to prevent cheating by using a dictionary" you can get some rough estimate.

Basically Kolmogorov Complexity is the best tool we have. It's not perfect because just like Shannon Entropy it's incalculable in reality but unlike Shannon Entropy we do have a good way to measure if one tool of calculating Kolmogorov Complexity is better than another tool. That measure is simply "does it compress better?".

It's literally the best way to measure randomness of an arbitrary file. Any other way is pretty game-able. If someone uses Shannon entropy to measure randomness just look at the alphabet they use for that measurement and repeat that alphabet sequentially over and over again and you'll have a high shannon entropy for a clearly non-random file. Likewise other measurements might be game-able with large dictionaries to lookup. Kolmogorov complexity includes the entire program so that game doesn't work here.

Re: Kolmogorov Complexity and Compression Distance (2023)

#77
post #9

Richard von Mises (brother of the economist) formulated a definition of randomness as a sequence of data that, were you a gambler, you cannot by any strategy make money on betting on the outcomes. This was before computational calculus and was later developed by Kolmogorov and others in algorithmic complexity. The modern variation would be (Wiki) "considering a finite sequence random (with respect to a class of compu…

Do you have a citation? I didn’t know the idea went back that far.

Thanks, I had to dig. I read about it in [1]. Mises was concerned about the formalization of probability theory. It seems the idea appears at least as early as in his 1919 paper [2].

[1] An Introduction to Kolmogorov Complexity and Its Applications, M. Li & P. Vitnányi

[2] Grundlagen der Wahrscheinlichkeitsrechnung, R. von Mises

Re: Kolmogorov Complexity and Compression Distance (2023)

#78
post #9

Richard von Mises (brother of the economist) formulated a definition of randomness as a sequence of data that, were you a gambler, you cannot by any strategy make money on betting on the outcomes. This was before computational calculus and was later developed by Kolmogorov and others in algorithmic complexity. The modern variation would be (Wiki) "considering a finite sequence random (with respect to a class of compu…

The two definitions say different things. What von Mises said is closer to cryptographic definitions of pseudorandomness, and in particular to next-bit unpredictability.

Yes, I agree. But I talked about an idea development and said variation, not necessarily addressing the same thing. The headline would be algorithmically random sequence.

https://en.wikipedia.org/wiki/Algorithmically_random_sequenc...

Re: Kolmogorov Complexity and Compression Distance (2023)

#80
post #20

> let’s assume that there exists a universal language U Why not specify it? > That gives us the true language-agnostic definition of Kolmogorov Complexity as follows: Choosing the language of Turing Machines does not make the definition language agnostic. Aiming for the simplest definition of description complexity, I instead based my definitions on the older computational model of lambda calculus in [1]. Unlike the…

> let’s assume that there exists a universal language U such that it always gives us the shortest description length for all strings.

Read on a bit and it looks like proof by contradiction:

> However, let’s bring back the paradox we discussed above. According to that paradox, U cannot exist or U cannot provide shorter descriptions than every arbitrary L.

Post reply on HN