Code

An early example is an invention of language, which enabled a person, through speech, to communicate what they thought, saw, heard, or felt to others.

The invention of writing, which converted spoken language into visual symbols, extended the range of communication across space and time.

Decoding is the reverse process, converting code symbols back into a form that the recipient understands, such as English or/and Spanish.

One reason for coding is to enable communication in places where ordinary plain language, spoken or written, is difficult or impossible.

An extension of the code for representing sequences of symbols over the source alphabet is obtained by concatenating the encoded strings.

Using the extension of the code, the encoded string 0011001 can be grouped into codewords as 0 011 0 01, and these in turn can be decoded to the sequence of source symbols acab.

Using terms from formal language theory, the precise mathematical definition of this concept is as follows: let S and T be two finite sets, called the source and target alphabets, respectively.

Virtually any uniquely decodable one-to-many code, not necessarily a prefix one, must satisfy Kraft's inequality.

This so-called error-correcting code works by including carefully crafted redundancy with the stored (or transmitted) data.

When telegraph messages were the state of the art in rapid long-distance communication, elaborate systems of commercial codes that encoded complete phrases into single mouths (commonly five-minute groups) were developed, so that telegraphers became conversant with such "words" as BYOXO ("Are you trying to weasel out of our deal?

Techniques such as Huffman coding are now used by computer-based algorithms to compress large data files into a more compact form for storage or transmission.

Scripts that require large character sets such as Chinese, Japanese and Korean must be represented with multibyte encodings.

This in turn produces proteins through a genetic code in which a series of triplets (codons) of four possible nucleotides can be translated into one of twenty possible amino acids.

In marketing, coupon codes can be used for a financial discount or rebate when purchasing a product from a (usual internet) retailer.

In military environments, specific sounds with the cornet are used for different uses: to mark some moments of the day, to command the infantry on the battlefield, etc.

In the history of cryptography, codes were once common for ensuring the confidentiality of communications, although ciphers are now used instead.

Secret codes intended to obscure the real messages, ranging from serious (mainly espionage in military, diplomacy, business, etc.)

to trivial (romance, games) can be any kind of imaginative encoding: flowers, game cards, clothes, fans, hats, melodies, birds, etc., in which the sole requirement is the pre-agreement on the meaning by both the sender and the receiver.