Hacker News new | ask | show | jobs
by pugworthy 21 days ago
I've always liked the idea of file compression based on the idea that theoretically the right seed would create a sequence of values that matched the data to be compressed. So 1 or more seeds (and an implementation of the random number generator) encapsulated an entire file.

I mean in a reverse way Minecraft does this to some extent, beyond you're going seed to world, not world to seed - and there are worlds with no seed that will make them.

2 comments

I feel like you wouldn't actually want real randomness for something like that though because of the high entropy; larger files would become exponentially more difficult to find a seed for.

I think the concept sounds similar to Kolmogorov complexity[1], but in general I think software solutions can always be represented in different ways where there is a tradeoff between space and time in some way.

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

_In general_ this would result in zero compression. The exact seed needed to be able to generate, say a 1KB file exactly, will in-general itself be ~1KB large.

Conversely, if you have say a 32-bit seed, then by definition you can only generate 2^32 different files (and their prefixes, if a length is also included) - meaning you CAN "compress" all possible 4-byte files into "their" 32-bit seed. Thats it.

Bottomline: this will _in-general_ not result in any compression at all.