Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Code
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Theory == {{main|Coding theory}} In [[information theory]] and [[computer science]], a code is usually considered as an [[algorithm]] that uniquely represents [[symbols]] from some source [[alphabet (computer science)|alphabet]], by ''encoded'' strings, which may be in some other target alphabet. An extension of the code for representing sequences of symbols over the source alphabet is obtained by concatenating the encoded strings. Before giving a mathematically precise definition, this is a brief example. The mapping :<math>C = \{\, a\mapsto 0, b\mapsto 01, c\mapsto 011\,\}</math> is a code, whose source alphabet is the set <math>\{a,b,c\}</math> and whose target alphabet is the set <math>\{0,1\}</math>. 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 [[alphabet (computer science)|alphabets]], respectively. A '''code''' <math>C:\, S \to T^*</math> is a [[total function]] mapping each symbol from S to a [[String (computer science)|sequence of symbols]] over T. The '''extension''' <math>C'</math> of <math>C</math>, is a [[Homomorphism#Formal language theory|homomorphism]] of <math>S^*</math> into <math>T^*</math>, which naturally maps each sequence of source symbols to a sequence of target symbols. === Variable-length codes === {{main|Variable-length code}} In this section, we consider codes that encode each source (clear text) character by a [[Code word (figure of speech)|code word]] from some dictionary, and [[concatenation]] of such code words give us an encoded string. Variable-length codes are especially useful when clear text characters have different probabilities; see also [[entropy encoding]]. A ''prefix code'' is a code with the "prefix property": there is no valid code word in the system that is a [[prefix (computer science)|prefix]] (start) of any other valid code word in the set. [[Huffman coding]] is the most known algorithm for deriving prefix codes. Prefix codes are widely referred to as "Huffman codes" even when the code was not produced by a Huffman algorithm. Other examples of prefix codes are [[telephone country codes]], the country and publisher parts of [[ISBN]]s, and the Secondary Synchronization Codes used in the [[UMTS]] [[W-CDMA|WCDMA]] 3G Wireless Standard. [[Kraft's inequality]] characterizes the sets of codeword lengths that are possible in a prefix code. Virtually any uniquely decodable one-to-many code, not necessarily a prefix one, must satisfy Kraft's inequality. === Error-correcting codes === {{Main|Error detection and correction}} {{See also|Block code}} Codes may also be used to represent data in a way more resistant to errors in transmission or storage. This so-called [[Error detection and correction|error-correcting code]] works by including carefully crafted redundancy with the stored (or transmitted) data. Examples include [[Hamming code]]s, [[Reed–Solomon]], [[Reed–Muller code|Reed–Muller]], [[Walsh–Hadamard code|Walsh–Hadamard]], [[BCH code|Bose–Chaudhuri–Hochquenghem]], [[Turbo code|Turbo]], [[Binary Golay code|Golay]], [[Algebraic geometry code|algebraic geometry codes]], [[low-density parity-check code]]s, and [[space–time code]]s. Error detecting codes can be optimised to detect ''burst errors'', or ''random errors''.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)