reversal


Let Σ be an alphabet and w a word over Σ. The reversal of w is the word obtained from w by “spelling” it backwards. Formally, the reversal is defined as a function rev:Σ*→Σ* such that, for any word w=a1⁢⋯⁢an, where ai∈Σ, rev⁡(w):=an⁢⋯⁢a1. Furthermore, rev⁡(λ):=λ. Oftentimes wR or mi⁡(w) is used to denote the reversal of w.

For example, if Σ={a,b}, and w=a⁢a⁢b⁢a⁢b⁢b, then rev⁡(w)=b⁢b⁢a⁢b⁢a⁢a.

Two properties of the reversal are:

  • •

    it fixes all a∈Σ: rev⁡(a)=a.

  • •

    it is idempotentMathworldPlanetmathPlanetmath: rev∘rev=1, and

  • •

    it reverses concatenationMathworldPlanetmath: rev⁡(a⁢b)=rev⁡(b)⁢rev⁡(a).

In other words, the reversal is an antihomomorphismMathworldPlanetmath. In fact, it is the antihomomorphism that fixes every element of Σ. Furthermore, g is an antihomomorphism iff g∘rev is a homomorphismPlanetmathPlanetmathPlanetmathPlanetmathPlanetmathPlanetmathPlanetmathPlanetmathPlanetmath. By the second property above, h is a homomorphism iff h∘rev is an antihomomorphism.

A word that is fixed by the reversal is called a palindrome. The empty wordPlanetmathPlanetmathPlanetmath λ as well as any symbol in the alphabet Σ are trivially palindromes. Also, for any word w, the words w⁢x⁢rev⁡(w) and rev⁡(w)⁢x⁢w are both palindromes, where x is either a symbol in Σ or the empty word. In fact, every palindrome can be written this way.

The languagePlanetmathPlanetmath consisting of all palindromes over an alphabet is context-free, and not regularPlanetmathPlanetmathPlanetmath if Σ has more than one symbol. It is not hard to see that the productions are σ→λ, σ→a and σ→a⁢σ⁢a, where a ranges over Σ.

Reversal of words can be extended to languages: let L be a language over Σ, then

rev⁡(L):={rev⁡(w)∣w∈L}.

A family ℱ of languages is said to be closed underPlanetmathPlanetmath reversal if for any L∈ℱ, rev⁡(L)∈ℱ. It can be shown that regular languages, context-free languages, context-sensitive languages, and type-0 languages are all closed under reversal.

Title reversal
Canonical name Reversal
Date of creation 2013-03-22 18:55:20
Last modified on 2013-03-22 18:55:20
Owner CWoo (3771)
Last modified by CWoo (3771)
Numerical id 12
Author CWoo (3771)
Entry type Definition
Classification msc 68Q70
Classification msc 68Q45
Synonym mirror image
Related topic Palindrome