How to compress 256^3 unique data points in order. Each data point is a value from 1 to 255

68 Views Asked by At

I am trying to compress 256^3 datapoints into a 256 digit or less long string (using only base 10 numbers). I have already tried a few things which I will list below.

I have tried to switch between addition and subtraction between parentheses. for example: 255+(122-(32+(10-3))) but I don't know how to reverse it and get the original number back when just having the sum.

I do not know how else to compress that many data-points into a 256 or less digit string. (because in theory it should be possible because there are more total values in a 256 digit long string than there are values of my data points.)

I need a way to do this language agnostically.

2

There are 2 best solutions below

4
Me again On

Each of your data points is almost 1 byte (255 unique values instead of 256). If there are 16 million of data points (256^3) then there is 16 MB of data.

Your string has 256 digits from 0 to 9, so it can store 10^256 states, or around 106 bytes. So unless the values have some extreme dependencies between each other, there is no way to compress 16MB down to 106B

0
Mark Adler On

No. Just no.

To make clear how far away you are from being able to do what you want to do, assuming that all 255 values of each coordinate are equally likely, you are asking to store 134 million bits of information in 850 bits! In a comment you ask about ten 256-digit strings in which case you'll have 8500 bits to put it in. You're off by a factor of 160,000, or 16,000 with ten of them.

I can't imagine why you would think "because in theory it should be possible".