I can't think of any counterexample but I can't find any such statement on the internet or my textbook either. I know that for each uniquely decodable code, there exists a prefix code with the same average length.
Asked
Active
Viewed 420 times
0
1 Answers
3
You can prove by induction on the length of the encoding that any string is uniquely decodable.
Let $s=s_1...s_n$ be some string encoded with a prefix free code. Since our code is prefix free, there exists a unique prefix of $s$, $s_1...s_j$ which is a code word. $s_{j+1}...s_n$ is also a valid encoding (we removed a single codeword from a concatenation of codewords), so by our inductive hypothesis, $s_{j+1}...s_n$ is uniquely decodable, which completes the proof.

Ariel
- 13,369
- 1
- 21
- 38
I can't find any such statement on the internet
really. – greybeard Jun 11 '20 at 09:36