Math 2.0

Computer science Definition

Encoding of data

Builds on AlphabetStringInjective function

Definition

Let AA be a set and let Σ\Sigma be an alphabet, with Σ∗\Sigma^* the set of strings over Σ\Sigma. An encoding of AA over Σ\Sigma is an injective function e ⁣:A→Σ∗e \colon A \to \Sigma^*. The string e(a)e(a) is the code of aa, often written ⟨a⟩\langle a \rangle. A decoding for ee is a map d ⁣:Σ∗→A∪{⊥}d \colon \Sigma^* \to A \cup \set{\bot} with d(e(a))=ad(e(a)) = a for every a∈Aa \in A, where ⊥\bot marks strings that are not codes.

Remarks

Every encoding has a decoding, since ee is injective; in computability one also asks that ee and a decoding be computable. Example: the binary numeral without leading zeros, with 00 written as 00, is an encoding of ℕ\N over {0,1}\set{0, 1}. It is injective, since a numeral without leading zeros determines its value and the value determines the numeral. Non-example: the map ℕ→{0,1}∗\N \to \set{0,1}^* that sends nn to its last binary digit is not an encoding, since 11 and 33 both get the string 11. Codes of pairs are often built by concatenation with a separator, for example ⟨a,b⟩=⟨a⟩#⟨b⟩\langle a, b \rangle = \langle a \rangle \# \langle b \rangle over Σ∪{#}\Sigma \cup \set{\#}. A Gödel numbering is an encoding into ℕ\N instead of Σ∗\Sigma^*, and binary numerals turn one into the other.

Reading path

To understand this page from the ground up, read these 25 pages in order. The foundations come first.

Show the path as a graph
Element, definition, no evidence levelElementdefinitionInjective function, concept, no evidence levelInjective functionconceptMonoid, concept, no evidence levelMonoidconceptProposition, concept, no evidence levelPropositionconceptSet, definition, no evidence levelSetdefinitionImplication, definition, no evidence levelImplicationdefinitionPredicate, definition, no evidence levelPredicatedefinitionOrdered pair, definition, no evidence levelOrdered pairdefinitionExistential quantifier, definition, no evidence levelExistential quantifierdefinitionUniversal quantifier, definition, no evidence levelUniversal quantifierdefinitionCartesian product, definition, no evidence levelCartesian productdefinitionSubset, definition, no evidence levelSubsetdefinitionUniqueness quantifier, definition, no evidence levelUniqueness quantifierdefinitionBinary relation, definition, no evidence levelBinary relationdefinitionFunction, definition, no evidence levelFunctiondefinitionCodomain, definition, no evidence levelCodomaindefinitionInjective function, definition, no evidence levelInjective functiondefinitionFree monoid, definition, no evidence levelFree monoiddefinitionSurjective function, definition, no evidence levelSurjective functiondefinitionBijective function, definition, no evidence levelBijective functiondefinitionEquinumerous sets, definition, no evidence levelEquinumerous setsdefinitionFinite set, definition, no evidence levelFinite setdefinitionAlphabet, definition, no evidence levelAlphabetdefinitionString, definition, no evidence levelStringdefinitionEncoding of data, definition, no evidence levelEncoding of datadefinition
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Element definition
  2. Injective function concept
  3. Monoid concept
  4. Proposition concept
  5. Set definition
  6. Implication definition
  7. Predicate definition
  8. Ordered pair definition
  9. Existential quantifier definition
  10. Universal quantifier definition
  11. Cartesian product definition
  12. Subset definition
  13. Uniqueness quantifier definition
  14. Binary relation definition
  15. Function definition
  16. Codomain definition
  17. Injective function definition
  18. Free monoid definition
  19. Surjective function definition
  20. Bijective function definition
  21. Equinumerous sets definition
  22. Finite set definition
  23. Alphabet definition
  24. String definition
  25. Encoding of data definition

Where this leads

1 page builds on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/Gödel_numbering
About this page
TagFS5W99H8SA
URIm2://FS5W99H8SA
Kinddefinition
WritingW0 stub
MSC68Q01, 68P30, 03D10
DefinesEncoding of data
UsesAlphabet, String, Injective function
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

Used by