Recursive indexing: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
 
(14 intermediate revisions by 14 users not shown)
Line 1:
{{Orphanno footnotes|date=NovemberJune 20062020}}
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''' is an [[algorithm]] used to represent large numeric values using members of a relatively small [[Set (mathematics)|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
Recursive indexing writes 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.
 
WHAT IS PEEEEENUSS???? PEIND IS AREBE LUVS
Recursive Indexingindexing with a 2 -letter alphabet is called [[Unaryunary 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&nbsp;–&nbsp;''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''&nbsp;=&nbsp;[0 1 2 3 4 ... 10], be aan 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 removingsubtract 10 from 49, and keepiterate until the difference is a number in the 0–10 proceedingrange.
till we reach a number in the 0-10 range.
 
So theThe values are 10 (''N''&nbsp;=&nbsp;49-&nbsp;–&nbsp;10 = &nbsp;39), 10 (''N''&nbsp;=&nbsp;39-&nbsp;–&nbsp;10&nbsp;=&nbsp;29), 10 (''N''&nbsp;=&nbsp;29-&nbsp;–&nbsp;10&nbsp;=&nbsp;19), 10 (''N''&nbsp;=&nbsp;19-&nbsp;–&nbsp;10&nbsp;=&nbsp;9), 9. The recursively indexed sequence for ''N''&nbsp;=&nbsp;49 with set ''S'', is&nbsp;10,&nbsp;10,&nbsp;10,&nbsp;10,&nbsp;9.
Hence the recursively indexed sequence for N=49 with set S, is 10,10,10,10,9.
 
==Decoding==
Compute the sum of the index values.
Keep adding all the elements of the index, stopping when the index value is between (inclusive of ends)
the least & penultimate elements of the set S.
 
=== Example ===
ContinuingDecoding fromthe above example we haveinvolves &nbsp;10&nbsp;+&nbsp;10&nbsp;+&nbsp;10&nbsp;+&nbsp;10&nbsp;+&nbsp;9 &nbsp;= &nbsp;49.
 
==Uses==
This technique is most commonly used in [[RLE|Runrun-length Length Encodingencoding]] systems to encode longer runs than the alphabet sizes permit.
than the alphabet sizes permit.
 
==References==
* Khalid Sayood, Introduction to Data Compression 3rd ed, [[Morgan KaufmanKaufmann]].
 
[[Category:Coding theory]]
[[Category:Data compression]]