Content deleted Content added
Em3rgent0rdr (talk | contribs) →Symmetric unary codes: grammar and simplify. |
Em3rgent0rdr (talk | contribs) →Symmetric unary codes: simplify symmetric |
||
Line 144:
==Symmetric unary codes==
The following
{| class="wikitable" style="text-align: center;"
!Alternative
!n (non-negative)
!n (strictly positive)
|-
|0
|0
|1
|-
|11
|1
|2
|-
|101
|2
|3
|-
|1001
|3
|4
|-
|10001
|4
|5
|-
|100001
|5
|6
|-
|1000001
|6
|7
|-
|10000001
|7
|8
|-
|100000001
|8
|9
|-
|1000000001
|9
|10
|-
| colspan="4" |
|}
== Canonical unary codes ==
For unary values where the maximum is known, one can use canonical unary codes that are of a somewhat numerical nature and different from character based codes. It involves starting with numerical '0' or '-1' ( <math>\operatorname2^{n} - 1\,</math>) and the maximum number of digits then for each step reducing the number of digits by one and increasing/decreasing the result by numerical '1'.
{| class="wikitable"
|