View Question
Q: Looking for a math genius... ( No Answer,   1 Comment )
 Question
 Subject: Looking for a math genius... Category: Computers > Algorithms Asked by: zeusdman-ga List Price: \$50.00 Posted: 27 Sep 2006 07:05 PDT Expires: 27 Oct 2006 07:05 PDT Question ID: 768855
 ```I have an input byte stream consisting of numbers in the set {0 - 15} exclusively of about 1000 bytes. What I would like to do is to be able to somehow store that mathematically in ONE unsigned integer and then, having in hand the the last byte value that was "encoded" into that unsigned integer, mathematically reverse it back to the original byte stream. I am hoping there is a way to mathematically encode the values into an integer and then decoding them back. Do you know how?``` Request for Question Clarification by maniac-ga on 28 Sep 2006 18:17 PDT ```Hello Zeusdman, As noted by frankcorrao, the general solution is not feasible unless you know something before hand about the data (for example, the data is NOT random). Basically, you are trying to compress roughly 4000 bits of information into a single "unsigned integer" (likely 32 bits, but could be 64). A 100 to 1 compression of image data is possible with a "lossy" algorithm - the original data is NOT reproduced exactly from the stored data (but it does "somewhat" look OK as a reproduction of the image). Can you describe the type of data in more detail to see if there is some way to encode the information to achieve that level of compression? --Maniac```
 ```This is not possible for the general case of some random stream of bytes. http://en.wikipedia.org/wiki/Kolmogorov_complexity is a good place to start if you need justications. Intuitively, should you realize that it is not possible to compress essentially 125 bytes of data (0-15 is 4 bits) into bytes of data for all random formulations of those 125 bytes.```