Lesson plan
Unary coding
Unary coding, or the unary numeral system, is an entropy encoding that represents a natural number, , with ones followed by a zero (if the term natural number is understood as non-negative integer) or with ones followed by a zero (if the term natural number is understood as strictly positive integer). A unary number's code length would thus be with that first definition, or with that second definition. Unary code when vertical behaves like mercury in a thermometer that gets taller or shorter as n gets bigger or smaller, and so is sometimes called thermometer code. An alternative representation uses or zeros followed by a one, effectively swapping the ones and zeros, without loss of generality. For example, the first ten unary codes are: Unary coding is an optimally efficient encoding for the following discrete probability distribution : \operatorname{P}(n) = 2^{-n}\, for n=1,2,3,... . In symbol-by-symbol coding, it is optimal for any geometric distribution : \operatorname{P}(n) = (k-1)k^{-n}\, for which , the golden ratio, or, more generally, for any discrete distribution for which : \operatorname{P}(n) \ge \operatorname{P}(n+1) + \operatorname{P}(n+2)\, for n=1,2,3,... .…
Article summary
Unary coding, or the unary numeral system, is an entropy encoding that represents a natural number, , with ones followed by a zero (if the term natural number is understood as non-negative integer) or with ones followed by a zero (if the term natural number is understood as strictly positive integer). A unary number's code length would thus be with that first definition, or with that second definition. Unary code when vertical behaves like mercury in a thermometer that gets taller or shorter as n gets bigger or smaller, and so is sometimes called thermometer code. An alternative representation uses or zeros followed by a one, effectively swapping the ones and zeros, without loss of generality. For example, the first ten unary codes are: Unary coding is an optimally efficient encoding for the following discrete probability distribution : \operatorname{P}(n) = 2^{-n}\, for n=1,2,3,... . In symbol-by-symbol coding, it is optimal for any geometric distribution : \operatorname{P}(n) = (k-1)k^{-n}\, for which , the golden ratio, or, more generally, for any discrete distribution for which : \operatorname{P}(n) \ge \operatorname{P}(n+1) + \operatorname{P}(n+2)\, for n=1,2,3,... .…
Key claims
No claims recorded.
Discussion questions
- Summarise the article in your own words. Which single claim would you verify first, and why?
- Which claim in this article is most likely to be revised as the sources update? How would you check its current status?
- If two sources disagreed about one of these facts, what would you need in order to trust one over the other?
Bibliography
No sources recorded.
Key claims and bibliography are generated from the same tracked claims and sources as the article page.