Jump to content

Universal code

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Sam Hocevar (talk | contribs) at 11:03, 23 January 2005 (Data compression: spelling). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Data compression

In data compression, a universal code maps the integers (representing messages) onto self-delimiting binary codewords. Longer binary codewords are mapped to less probable messages. (Self-delimiting codes are also called prefix-free codes or "instantaneously decodable" codes).

Unlike other compression codes such as Huffman coding or fixed-length codes, universal codes do not require the receiver or the transmitter to know the maximum integer (number of potential messages) ahead of time.

Universal codes include:

Huffman coding, range encoding, and arithmetic encoding (when it can be used) gives at least as good, and often better compression than any universal code.

However, universal codes are useful when Huffman coding cannot be used -- for example, when one does not know the exact probability of each message, but only knows their ranking (this message is more probable than that message).

Universal codes are also useful when Huffman codes are inconvenient. For example, when the transmitter but not the receiver knows the probabilities of the messages, Huffman coding requires an overhead of transmitting those probabilities to the receiver. Using a universal code does not have that overhead.

Each universal code, like each other self-delimiting (prefix-free) binary code, has its own "implied probability distribution". If a set of messages happens to have a probability distribution similar enough to that implied by some universal code, then the Huffman code for that set of messages will be equivalent to that universal code. Since universal codes are simpler and faster to encode and decode than Huffman codes (which is, in turn, simpler and faster than range encoding and arithmetic encoding), the universal code would be preferable in cases where the codes are equivalent. [1]

Some codes such as Elias delta coding and Huffman are "asymptotically optimal", while others such as Elias gamma coding are not. [2]

Biology

In biology, "universal code" is short for the idea of the "universal genetic code".

In all known living creatures, instructions for making proteins are encoded in DNA. Three bases of DNA (the "codon") select an amino acid. In the 1960s, biologists and chemists worked out which particular amino acid is selected by each codon -- the genetic code. They were surprised to discover that this code was the same for every living creature they investigated -- plant, animal, bacteria, etc. This evidence supports the hypothesis of Common descent.

(In the 1990s, it was discovered that the genetic code was not universal after all -- quite a few organisms use genetic codes that have one or two differences from what was once thought to be the universal code, now called the "canonical code" -- [3], [4], [5] ).

See also the International Code of Zoological Nomenclature.

Law

In law, a universal code is a law that applies everywhere on Earth.

Ethics

In ethics, a "universal code of ethics" is a system of ethics that can apply to every human. See Michael E. Berumen, James Harrison Rigg.

Etiquette

In etiquette, a "universal code of etiquette" ...

Marketing

In marketing and package design, "universal code" may refer to the Universal Product Code bar code. EAN-UCC assigns each company a manufacturer code (from 00000 to 99999). Each manufacturer assigns a unique (to that manufacturer) product code to each of its products (from 00000 to 99999).

This allows up to 9 999 999 999 unique products, which is expected to be more than enough for the forseeable future.

HowStuffWorks

Typography

In typography, the "universal code" may refer to the Unicode Universal character set, or one of its encodings such as UTF-32. (In particular, the ASCII code is not universal because there are many letters it does not encode).

Cartography

In cartography, a "universal code" is a code that can indicate any location on Earth, such as "latitude and longitude", or the Natural Area Code.

Post code

A "post code" of the Universal Postal Union

CD

"Universal Code" is also the title of a CD by Dan Handrabur.

INSPSC

UNSPSC ?

See also