Recursive indexing: Difference between revisions

Content deleted Content added
SJP (talk | contribs)
m Reverted edits by 72.12.189.221 to last version by SmackBot (using Huggle)
Tidying
Line 1:
{{Orphan|date=November 2006}}
When number (generally large number) is represented in a finite alphabet set, and it
cannot be represented by just one member of the set, Recursive Indexing is used.
 
When number (generally large number) is represented in a finite alphabet set, and it cannot be represented by just one member of the set, '''Recursive indexing''' is used.
Recursive Indexing itself is a method to write the successive differences of the
number after extracting the maximum value of the alphabet set from the number, and
continuing recursively till the difference falls in the range of the set.
 
Recursive indexing itself is a method to write the successive differences of the number after extracting the maximum value of the alphabet set from the number, and continuing recursively till the difference falls in the range of the set.
Recursive Indexing with a 2 letter alphabet is called [[Unary code]].
 
Recursive Indexingindexing with a 2 letter alphabet is called [[Unary code]].
 
==Encoding==
To encode a number ''N'', keep reducing the maximum element of this set (Smax''S''<sub>max</sub>) from ''N'' and output ''S''max for each such difference, stopping when the number lies in the half closed half open
range [0–''S''<sub>max</sub>).
and output Smax for each such difference, stopping when the number lies in the half closed half open
range [0-Smax).
 
===Example===
Let set ''S''=[0 1 2 3 4 ... 10], be a 11 element set, and we have to recursively index the value N=49.
index the value N=49.
 
According to this method, we need to keep removing 10 from 49, and keep proceeding till we reach a number in the 0–10 range.
till we reach a number in the 0-10 range.
 
So the values are 10 (''N''=49-1049–10 = 39), 10 (''N''=39-1039–10=29), 10 (''N''=29-1029–10=19), 10 (''N''=19-1019–10=9), 9.
Hence the recursively indexed sequence for ''N''=49 with set ''S'', is 10,10,10,10,9.
 
==Decoding==
Keep adding all the elements of the index, stopping when the index value is between (inclusive of ends) the least and penultimate elements of the set ''S''.
the least & penultimate elements of the set S.
 
===Example===
Line 32 ⟶ 26:
 
==Uses==
This technique is most commonly used in [[RLE|Run Length Encoding]] systems to encode longer runs than the alphabet sizes permit.
than the alphabet sizes permit.
 
==References==
* Khalid Sayood, Data Compression 3rd ed, [[Morgan KaufmanKaufmann]].
 
[[Category:Coding theory]]
[[Category:Data compression]]