Content deleted Content added
Em3rgent0rdr (talk | contribs) |
Em3rgent0rdr (talk | contribs) unnecessarily confusing by squeezing too much into the first sentence, so split off code length to become second sentence, and make thermometer coding be its own sentence later with a bit of explanation. To hard to give example of 5 because have two definitions, so just introduced the table a little better. Move more technical stump on prefix-free code and a self-synchronizing code to be its own paragraph at end. |
||
Line 1:
{{Short description|Entropy encoding}}
'''Unary coding''',<ref group="nb" name="NB1"/>
{| class="wikitable"
!n (non-negative)
!n (strictly positive)
|-
| 0 || 1
| | |-
|1
|2
|-
|2
|3
|-
|3
|4
|-
|4
|5
|-
|5
|6
|-
|6
|7
|-
|7
|8
|-
|8
|9
|-
|9
|10
|}
Line 39 ⟶ 61:
:<math>\operatorname{P}(n) \ge \operatorname{P}(n+1) + \operatorname{P}(n+2)\, </math>
for <math>n=1,2,3,...</math>. Although it is the optimal symbol-by-symbol coding for such probability distributions, [[Golomb coding]] achieves better compression capability for the geometric distribution because it does not consider input symbols independently, but rather implicitly groups the inputs.
Unary coding is both a [[prefix-free code]] and a [[self-synchronizing code]].
==Unary code in use today==
|