Presentation is loading. Please wait.

Presentation is loading. Please wait.

R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 1 Graph theory – תורת הגרפים 4. ORDERED TREES 4.1 UNIQUELY DECIPHERABLE CODES מבוסס על הספר : S. Even,

Similar presentations


Presentation on theme: "R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 1 Graph theory – תורת הגרפים 4. ORDERED TREES 4.1 UNIQUELY DECIPHERABLE CODES מבוסס על הספר : S. Even,"— Presentation transcript:

1 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 1 Graph theory – תורת הגרפים 4. ORDERED TREES 4.1 UNIQUELY DECIPHERABLE CODES מבוסס על הספר : S. Even, "Graph Algorithms", Computer Science Press, 1979 שקפים, ספר וחומר רלוונטי נוסף באתר הקורס : Slides, book and other related material at: http://www.cs.technion.ac.il/~cs234141

2 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 2 מושגים בסיסיים: א"ב מילה קוד הודעה

3 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 3 מושגים שנפגוש: קוד ח"פ קוד פרפיקסי עץ מצבי הסכום האופייני

4 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 4 4.1 UNIQUELY DECIPHERABLE CODES 4.1 UNIQUELY DECIPHERABLE CODES Let We call  an alphabet and its elements are called letters; the number of letters in  is . A finite sequence a 1 a 2 …a l,, where a1 is a letter, is called a word whose length is l. We denote the length of a word w by l(w). A set of (non-empty and distinct) words is called a code. For example, the code {102, 21, 00} consists of three code-words: one code-word of length 3 and two code-words of length 2; the alphabet is {0, 1, 2} and consists of three letters.

5 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 5 Let c 1,c 2,…,c k be code-words. The message c 1,c 2,…,c k is the word resulting from the concatenation of the code-word c 1 with c 2, etc. For example, if c 1 =00,c 2 =21 and c 3 = 00, then c 1 c 2 c 3 =002100.. A code C over  is said to be uniquely decipherable (UD) if every message constructed from code-words of C can be broken down into code-words of C in only one way. For example, the code {01, 0, 10} is not UD because the message 010 can be parsed in two ways: 0, 10 and 01, 0..

6 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 6 Lemma 4.1: A code C is UD if and only if no tail is a code-word Proof:לא בחומר (בסמסטר זה)

7 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 7 Prefix c 1 c 2 …c n מחרוזת של אותיות d 1 d 2 …d m היא פרפיקס (רישא) של מחרוזת c 1 =d 1, c 2 =d 2,…, c k =d m אם דוגמא: approximation הוא פרפיקס של: approx

8 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 8 Prefix code קוד יקרא פרפיקסי אם אין בו שני מילים שאחת מהן היא רישא של השניה. טענה: קוד פרפיקסי הוא חד-פענח. הוכחה: על הלוח.

9 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 9 קודים פרפיקסיים ועצים מצביים w(x) :x המילה של צומת מטרת הטענות בהמשך: א. להראות שמילות העלים מהווים קוד פרפיקסי ב. להוכיח תנאי הסכום האופייני

10 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 10 רוצים להראות שמילות העלים מהווים קוד פרפיקסי w(y)פרפיקס של w(x)  y של אב קדמוןx טענה א: w(x)≠w(y)  x≠y טענה ב: w(y)פרפיקס של w(x)  y של אב קדמוןx טענה ג: תוצאה: הקוד המתאים לקבוצת העלים - פרפיקסי אותיות σ טענה ד: לכל קוד-פרפיקסי מעל א"ב עם -מצבי.σ קיים עץ הוכחות: על הלוח.

11 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 11 Theorem 4.1 characteristic sum condition תנאי הסכום האופייני Theorem 4.1; Let C = { c 1, c 2,..., c n } be a UD code over an alphabet of  letters. If l i = l(c i ), i = 1, 2,..., n, then Proof: לא בחומר (בסמסטר זה) אנו נראה זאת רק עבור קודים פרפיקסיים

12 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 12 Theorem 4.2: If the vector of integers, (l 1, l 2,...,l n ), satisfies then there exists a prefix code C={c 1,c 2,…,c n }, over the alphabet of  letters, such that l i =l(c i ). Proof:יוכח בתרגול (בסמסטר זה)


Download ppt "R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 1 Graph theory – תורת הגרפים 4. ORDERED TREES 4.1 UNIQUELY DECIPHERABLE CODES מבוסס על הספר : S. Even,"

Similar presentations


Ads by Google