Algorithm for Interpreting For Uniform Bernoulli Sequence as Non-Uniform
I have a large, uniformly distributed sequence of binary digits (P(1) = P(0)) and I need to interpret this sequence of random bits as an EQUAL sized sequence of binary digits whose distribution is not uniform (i.e. P(1) != P(0)).
Specifically, I am looking for either of the following:
1.) an INVERTIBLE function F whose domain is equal to its range = the set of N bit binary sequences (i.e. a function whose domain = range = {0,1}^N for some fixed N) AND with the property that the function maps sequences开发者_如何学编程 of high entropy to ones of low entropy and vice versa as well as possible
Ideas?
It is for compression; I will post more about this later
Shannon proved that it's impossible to compress a uniform random binary string. Compression algorithms exploit non-uniformity in the input distribution.
There are a whole lot more high entropy sequences than low ones. If the function is both invertible and has domain equal to range, there's no way to do that mapping.
edit for your comment:
A = YourLargeSequence
f(0^N) = A
f(A) = 0^N
otherwise, f(x) = x
has all the properties you've asked for. Domain = Range = {0,1}^N, it's inverse is itself, 0 has low entropy. I'm guessing you've left out a requirement?
精彩评论