You are on page 1of 16

Gio vin hng dn

Thy Nguyn Thnh Nht


C Mai Trng Thanh

M Lempel Ziv
Nhm 3
V Th Ngc Giu
H Minh Hong
Ng nh Quang Huy
Phan Th Tr My

0511089
0511100
0511107
0511158

Gii thiu s lc
Kt hp gia 2 thut ton ca
Abraham Lempel v Jacob Ziv t
nm 1977-1978.
L mt thut ton nn d liu
khng mt thng tin.
ng dng nhiu trong cc tin ch
nh: zip, gzip, nn nh GIF v
chun modem V.42, ...

Abraham Lempel

Jacob Ziv

Gii thiu s lc(tt)


Hai thut ton nguyn bn l LZ77 v
LZ78.

LZ78
Phng php nn: thay th mt phn ca
chui bi con tr ti chui tin t.
Th t t in ca chui con: chui con xut
hin sau phi khc vi chui con trc . C
ngha l chui sau s khc hn vi chui trc
hoc sai khc vi chui trc t nht 1 bit.
Chui con trc s l tin t ca 1 hoc
nhiu chui con sau.
4

LZ78 V d
Cho chui 1011010100010
Tch thnh cc chui con theo
th t t in:
1, 0, 11, 01, 010, 00, 10.

LZ78 M ha
9Chia chui cn m ha thnh nhiu chui
con theo th t t in ca chui con;
9nh s th t cc chui con;
9Thay th mt chui con bi hai phn:

Phn con tr n chui tin t: s th t (nh


phn) ca chui tin t;
Phn bit sai khc vi chui tin t: 1 bit.

9Ghp cc chui con li ta c chui m


ha.

LZ78 Lu
Vi chui con th n, ta s cn
[log2n] bit cho phn con tr .
VD: chui th 2 cn 1 bit cho
phn con tr, chui th 3 th
cn 2 bit, ...
7

LZ78 V d m ha
VD: m ha chui 1011010100010.
Bng m ha:
Chui con

1
0
11
01
010
00
10
n
0
1
2
3
4
5
6
7
n (nh phn) 000 001 010
011
100
101
110
111
(con tr , bit)
( , 1) (0 , 0) (01 , 1) (10 , 1) (100 , 0) (010 , 0) (001 , 0)

=> Chui m ha:

100011101100001000010

LZ78 Gii m
9T chui m ha, ta tch thnh cc

chui con. Mi chui con n gm 2


phn:
Phn con tr n chui tin t: [log2n] bit;
Phn bit khc vi chui tin t: 1 bit.

9Thay phn con tr bng gi tr ca


chui con tin t.
9Ghp cc chui con li ta c chui
gc.

LZ78 V d gii m
Gii m chui 100011101100001000010
Bng gii m:
n

(con tr , bit)

Chui con

1
2
3
4
5
6
7

( , 1)
(0 , 0)
(01 , 1)
(10 , 1)
(100 , 0)
(010 , 0)
(001 , 0)

1
0
11
01
010
00
10

=> Chui gc: 1011010100010


10

LZ78 V d
VD1: M ha chui
000000000000100000000000
s dng thut ton Lempel Ziv.
VD2: Gii m chui
00101011101100100100011010101000011
c m ha bng thut ton Lempel Ziv.
11

LZ78 Gii v d 1
M ha chui
000000000000100000000000
Bng m ha:
Chui con

0
00
000
0000
001
00000 000000
n
0
1
2
3
4
5
6
7
n (nh phn) 000 001 010
011
100
101
110
111
(con tr , bit)
( , 0) (1 , 0) (10 , 0) (11 , 0) (010 , 1) (100 , 0) (110 , 0)

=> Chui m ha:


010100110010110001100
12

LZ78 Gii v d 2
Gii m chui

00101011101100100100011010101000011
Bng gii m:
n

(con tr , bit)

Chui con

1
2
3
4
5
6
7
8
9
10

( , 0)
(0 , 1)
(01 , 0)
(11 , 1)
(011 , 0)
(010 , 0)
(100 , 0)
(110 , 1)
(0101 , 0)
(0001 , 1)

0
1
00
001
000
10
0010
101
0000
01

=> Chui gc: 0100001000100010101000001

13

LZ78 Nhn xt
u im:
9Khng cn phi lu tr t in, c
th xy dng li t qu trnh gii m.

Nhc im:
9T in tng ln khng gii hn;
9Cc chui con di xut hin kh tr
trong qu trnh xy dng t in.
14

Ti liu tham kho


Christina Zeeh - Seminar Famous Algorithms.
David J.C. MacKay - Information Theory, Inference, and
Learning Algorithms.
http://en.wikipedia.org/wiki/lempel - ziv.

15

Thanks 4 ur attention!!!

16