Question

Suppose we have been given that our prefix-free binary code has 11 codewords of length 4, and 2 codewords of length 2. We are asked to come up with an example for it, but how can we make 11 codewords when the code length is 4 and we can only use 1s and 0s (binary code).

Was it helpful?

Solution

You don't have to fill the binary space. For instance, if there were only two codewords they could be 0010 and 0001; all other codewords (1, 0000, 0011, etc) would be invalid and any application interpreting the code should generate an error upon encountering them.

That said, you won't find an example because this particular code's requirements are impossible to satisfy.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top