Nick X Tsui
Nick X Tsui

Reputation: 2912

Sardinas–Patterson algorithm

Is the code C = {00, 11, 0101, 111, 1010, 100100, 0110} uniquely decodeable?

My answer is no, because according to Sardinas–Patterson algorithm:

C1 = {1}

C2 = {1, 11, 010, 00100}

So C2 AND C = {11}, so C is not a uniquely decodable code.

I am wondering am I right about this?

Upvotes: 0

Views: 596

Answers (1)

Peter de Rivaz
Peter de Rivaz

Reputation: 33509

You are correct that this code is not uniquely decodable.

Consider the string 111111, this can be parsed as 11 11 11 or as 111 111.

Upvotes: 3

Related Questions