Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need assitance understanding Sardinas-Patterson algorithm (Algorithm and example provided)

Tags:

algorithm

math

I am having difficulty understanding Sardinas- Patterson algorithm from the below slide:

enter image description here

How do we get C1 and C2???

I also got this information from the internet:

The algorithm is finite because all dangling suffixes added to the list are suffixes of a finite set of codewords, and a dangling suffix can be added at most once.

  • { 0, 01, 11 }. The codeword 0 is a prefix of 01, so add the dangling suffix 1. { 0, 01, 11, 1 }. The codeword 0 is a prefix of 01, but the dangling suffix 1 is already in the list; the codeword 1 is a prefix of 11, but the dangling suffix 1 is already in the list. There are no other dangling suffixes, so conclude that the set is uniquely decodable.
  • { 0, 01, 10 }. The codeword 0 is a prefix of 01, so add the dangling suffix 1 to the list. { 0, 01, 10, 1 }. The codeword 1 is a prefix of 10, but the dangling suffix 0 is a codewords. So, conclude that the code is not uniquely decodeable.
like image 322
Bic B Avatar asked Nov 30 '25 05:11

Bic B


1 Answers

The wiki article is a great explanation

The C in your slide correspond to the Si from the wiki article.

Here is description from me:

The important operation is taking two strings from C and if one of them is a prefix to the other you and to record the suffix that is left when the prefix is removed. This is how C1 is obtained.

With the following C2, C3, etc. You again want to look for words from C which are prefixes to words from Ci and take the remaining suffix, but you also want to look at the words from C_i and remove and words from C which are prefixes. C(i+1) is the union of those sets.

As soon as some Ci contains a word from C you know the code is not uniquely decodeable.

So:

C = 1, 011, 01110, 1110, 10011

C1 = 110 (because (1)110 is in C), 0011 (because (1)0011 is inC), 10 (because (011)10 is in C)

C2 = {10 (because (1)10 is in C1), 0 (because (1)0 is in C1)} union { 011, because (10)011 is in C }

like image 200
Petar Ivanov Avatar answered Dec 03 '25 03:12

Petar Ivanov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!