Unary coding: Difference between revisions

Content deleted Content added
Line 107:
Following set of unary codes are symmetric and can be read in any direction. It is also instantaneously decodable in either direction.
{| class="wikitable" style="text-align: center;"
! n (strictly positive) !! Unary code
!Alternative
!n (non-negative)
|-
| 1 || 1
|0
|0
|-
| 2 || 00
|11
|1
|-
| 3 || 010
|101
|2
|-
| 4 || 0110
|1001
|3
|-
| 5 || 01110
|10001
|4
|-
| 6 || 011110
|100001
|5
|-
| 7 || 0111110
|1000001
|6
|-
| 8 || 01111110
|10000001
|7
|-
| 9 || 011111110
|100000001
|8
|-
| 10 || 0111111110
|1000000001
|9
|-
| colspan="24" | ...
|}
==Canonical unary codes==