Precedure:
1. Count the number of distinct characters in the string, assign each of them initially equal interval between initial lower bound 0 and upper bound 1.
2. Read a character from the string sequentially, assign the character's inte rval as new lower bound and upper bound of the string.
3. Recompute the frequencies of characters, reassign interval for each charac ter according to its frequency.
4. Do step 2 and 3 repeatly until all characters in the string has been proce ssed. Each subsequent character extends the process, further reducing the upper bound and lower bound of the string.
5. Any number between the final lower bound and upper bound represents the st ring and will decode to that string.