Examples
The first few codes are shown below. Included is the so-called implied distribution, describing the distribution of values for which this coding yields a minimum-size code; see Relationship of universal codes to practical compression for details.
| Value | Code | Implied distribution |
|---|---|---|
| 1 | 0 | 1/2 |
| 2 | 10 0 | 1/8 |
| 3 | 11 0 | 1/8 |
| 4 | 10 100 0 | 1/64 |
| 5 | 10 101 0 | 1/64 |
| 6 | 10 110 0 | 1/64 |
| 7 | 10 111 0 | 1/64 |
| 8 | 11 1000 0 | 1/128 |
| 9 | 11 1001 0 | 1/128 |
| 10 | 11 1010 0 | 1/128 |
| 11 | 11 1011 0 | 1/128 |
| 12 | 11 1100 0 | 1/128 |
| 13 | 11 1101 0 | 1/128 |
| 14 | 11 1110 0 | 1/128 |
| 15 | 11 1111 0 | 1/128 |
| 16 | 10 100 10000 0 | 1/2048 |
| 17 | 10 100 10001 0 | 1/2048 |
| ... | ||
| 100 | 10 110 1100100 0 | 1/8192 |
| 1000 | 11 1001 1111101000 0 | 1/131,072 |
| 1,000,000 | 10 100 10011 11110100001001000000 0 | 1/2,147,483,648 |
The encoding for 1 googol, 10100, is 11 1000 101001100 followed by the binary representation of 1 googol, which is 10010 01001001 10101101 00100101 10010100 11000011 01111100 11101011 00001011 00100111 10000100 11000100 11001110 00001011 11110011 10001010 11001110 01000000 10001110 00100001 00011010 01111100 10101010 10110010 01000011 00001000 10101000 00101110 10001111 00010000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 and a trailing 0, for a total of 349 bits.
The encoding for a googol to the hundredth power, 1010000, is 33243 bits long; under Elias delta coding, the same number is 33250 bits long. Interestingly, log2(1010000) is about 33219 bits, so in this instance, omega and delta coding are, respectively, only 0.07% and 0.09% short of optimal.
Read more about this topic: Elias Omega Coding
Famous quotes containing the word examples:
“There are many examples of women that have excelled in learning, and even in war, but this is no reason we should bring em all up to Latin and Greek or else military discipline, instead of needle-work and housewifry.”
—Bernard Mandeville (16701733)
“In the examples that I here bring in of what I have [read], heard, done or said, I have refrained from daring to alter even the smallest and most indifferent circumstances. My conscience falsifies not an iota; for my knowledge I cannot answer.”
—Michel de Montaigne (15331592)
“No rules exist, and examples are simply life-savers answering the appeals of rules making vain attempts to exist.”
—André Breton (18961966)