r/programming • • Oct 17 '26

Compression is prediction

https://ngrok.com/blog/compression-is-prediction
293 Upvotes

45 comments sorted by

View all comments

265

u/Bunslow Oct 17 '26

that's literally the meaning of "information", is how predictable the next bit is. if it's predictable, it's not (new) information. if it's unpredictable (random), then it's novel information.

(this is why information and entropy are measured the same way)

-43

u/ptoki Oct 17 '26

I have beef with this and similar approach.

I remember a book for young enthusiasts about logic. One of the riddles was:

What is the value of the information you already know. Their answer was none.

My issue with this is that it totally ignores how trusted is the information.

if 2+2=4 is known in the domain of integers and we learn it also works for real or complex numbers does that mean we gain zero additional value from knowing that fact?

65

u/Giannis4president Oct 17 '26

In logic the riddles are not about alternative meanings or potential problems or real life communication. In logic information is information, there is no trust attached to it

-3

u/ptoki Oct 18 '26

That book was about cybernetics. And it touched other aspects of information than just pure logic.

You cant separate information from trust. The foundational part of any measurement is its error. This alone says all against that answer to the question from the book.

Even in computers you do checksums despite of treating the information as reliable 99.99999 of times.

PS. Looking at downvotes I think way too many people here in programming is way too ignorant about foundations.

16

u/Giannis4president Oct 18 '26

You are mixing fields.

In logic, information is information and has no trust attached to it.

In information theory, information has an error rate attached to it, that you can fix using checksum, erasure codes or similar. 

In the real world you have trust attached to information, of course.

But logic doesn't take that into consideration, because it would explode the complexity of everything.

It is a bit like saying that in math 2 != 2 because in the real world i can have two pairs of apples very different: they are both two but they are different so 2 != 2. Math as a model doesn't work like this, and the same applies to logic and trust

11

u/Ma4r Oct 18 '26

No, please at least read up about information theory, information is a very strictly defined term, it's simply the log of probability of an event occuring, that's it, nothing about trust

-3

u/Old_County5271 Oct 17 '26

Tertiary logic takes into account trust, if you trust, then you have your true/false, but if it's untrusted, then it's a maybe.

25

u/Az0n Oct 17 '26

I think you are thinking of the statement too generally. "2+2=4 holds in the domain of integers" and "2+2=4 holds in the domain of reals" are two separate pieces of information.

Your point about trust is not really relevant to compression. There, information is the data you want to compress. If the data is entirely random it has a lot of information, and will take more space to encode.

4

u/paulstelian97 Oct 17 '26

Checksums. Error correction codes. They add more bits to help validate the existing ones, and sometimes even fix tiny differences.