Empty String - Formal Theory

Formal Theory

Formally, a string is a finite sequence of symbols such as letters or digits. The empty string is the extreme case where the sequence has length zero, so there are no symbols in the string. There is only one empty string, because two strings are only different if they have different lengths or a different sequence of symbols. In formal treatments, the empty string is denoted with λ or sometimes Λ or ε.

The empty string should not be confused with the empty language ∅, which is a formal language (i.e. a set of strings) that contains no strings, not even the empty string.

The empty string has several properties:

  • . The string length is zero.
  • . The empty string is the identity element of the concatenation operation (which forms a free monoid on the alphabet Σ).
  • . Reversal of the empty string produces the empty string.
  • The empty string precedes any other string under lexicographical order, because it is the shortest of all strings.

Read more about this topic:  Empty String

Famous quotes containing the words formal and/or theory:

    That anger can be expressed through words and non-destructive activities; that promises are intended to be kept; that cleanliness and good eating habits are aspects of self-esteem; that compassion is an attribute to be prized—all these lessons are ones children can learn far more readily through the living example of their parents than they ever can through formal instruction.
    Fred Rogers (20th century)

    By the “mud-sill” theory it is assumed that labor and education are incompatible; and any practical combination of them impossible. According to that theory, a blind horse upon a tread-mill, is a perfect illustration of what a laborer should be—all the better for being blind, that he could not tread out of place, or kick understandingly.... Free labor insists on universal education.
    Abraham Lincoln (1809–1865)