1

If we are given a binary file of length n, where each bit independently is one with probability 1/3 and zero else. We want to construct a method that the expected length of the compressed sequence is less than 10 percent more than Shannon's lower bound (for all n large enough). I've got the lower bound is 0.918. I tried to use tuples of size 2, but it gives me an expected length of 1.88 by Huffman coding. Am I going in the right direction?

  • What if we want to get a 3% margin ?
3
  • 1
    Please provide some code :) Commented Apr 14, 2020 at 8:02
  • "length of 1.88" already means that you use only 0.94 bits per bit. You can get closer e.g. by using larger tuples. Commented Apr 14, 2020 at 10:56
  • By using a tuple of 3, it seems I get a larger expected length than 1.88 Commented Apr 14, 2020 at 16:37

2 Answers 2

2

The Shannon entropy bound is 0.918 output bits per input bit.

If you just write the bits you're given, you'll spend 1 output bit per input bit.

This is already less than 10% more than the bound, so no compression is required.

Sign up to request clarification or add additional context in comments.

Comments

1

You can use Arithmetic compressor or Rangecoder.

There is explanation with code for Arithmetic compressor and open-source implementation of Rangecoder.

I personally recommend to use Rangecoder, because of it works fastest, and has never been patented (patent for arithmetic compressor already expired).

1 Comment

I see! Thank you so much

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.