encyclopegia.org

Tunstall coding

In computer science and information theory, Tunstall coding is a form of entropy coding used for lossless data compression.

In computer science and information theory, Tunstall coding is a form of entropy coding used for lossless data compression. D := tree of |\mathcal{U}| leaves, one for each letter in \mathcal{U} . While |D| : Convert most probable leaf to tree with |\mathcal{U}| leaves. We initialize the tree, starting with a tree of |\mathcal{U}|=9 leaves. Each word is therefore directly associated to a letter of the alphabet. The 9 words that we thus obtain can be encoded into a fixed-sized output of \lceil \log_2(9) \rceil = 4 bits. We then take the leaf of highest probability (here, w_1 ), and convert it to yet another tree of |\mathcal{U}|=9 leaves, one for each character. We re-compute the probabilities of those leaves. For instance, the sequence of two letters L happens once. Given that there are three occurrences of letters followed by an L, the resulting probability is {1 \over 3} \cdot {3 \over 12} = {1 \over 12} . We obtain 17 words, which can each be encoded into a fixed-sized output of \lceil \log_2(17) \rceil = 5 bits. Note that we could iterate further, increasing the number of words by |\mathcal{U}|-1=8 every time. This is an example of a Tunstall code being used to read (for transmit ) any data that is scrambled, e.g. by polynomial scrambling. This particular example helps to modify the base of the data from 2 to 3 in a stream therefore avoiding expensive base modification routines. With base modification we are particularly bound by 'efficiency' of reads, where ideally \log_{n} bits are used at an average to read the code. This ensures that upon use of the new base, which is duty bound to use at best \log_{n} bits per code, our reads do not result in lesser margin of efficiency of transmission for which we are employing the base modification in the first place. We can therefore then employ the read-to-modify-base mechanism for efficiently transmitting the data across channels that have a different base. eg. transmitting binary data across say MLT-3 channels with increased efficiency when compared to mapping codes (with large number of unused codes). We are essentially reading perfectly scrambled binary data or 'implied data' for the purpose of transmitting it using base-3 channels. Please see leaf nodes in the Ternary Tunstall Tree. As we can see, the read will result in the first digit being 'B' - 25% of the time as it has an implied probability of 25%, being of length 2 trying to read from implied data. A 'B' such read does not read any further, but with 75% probability we read 'A' or 'C', requiring another code. Thus the efficiency of the read is 2.75 (average length of the size 7 Huffman code) / 1.75 (average length of the 1 or 2-digit base - 3 Tunstall code) = 1.57142857 which is as per requirement very close to \log_{2}3=1.5849625 which calculates to an efficiency of 99.15% . We can then transmit the symbols using base-3 channels efficiently.

References

No reference rows published for this article.

Cite this article

MLA

"Tunstall coding." encyclopegia.org, 2025, https://encyclopegia.org/wiki/tunstall-coding. Accessed 24 November 2026.

Chicago

"Tunstall coding." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/tunstall-coding.

APA

encyclopegia.org. (2025). Tunstall coding. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/tunstall-coding

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

arithmetic coding

stub · references available

Advanced Video Coding

stub · references available

Coding Technologies

stub · references available

entropy coding

stub · references available

superdense coding

stub · references available

Tunstall Quarles

stub · references available

Unified Speech and Audio Coding

stub · references available

Dirty paper coding

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1327571477 · 0.5 · snapshot enwiki-001327571477

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.