Palindrome
From Wikipedia, the free encyclopedia
- For the movie see Palindromes (film).
For lists of palindromic words in various languages see Wiktionary:Appendix:Palindromic words.
A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction (the adjustment of punctuation and spaces between words is generally permitted). The word "palindrome" was coined from Greek roots Greek πάλιν (palin) "back" and δρóμος (dromos) "way, direction" by English writer Ben Jonson in the 1600s. Composing literature in palindromes is an example of constrained writing.
Contents |
[edit] History
Palindromes date back at least to 79 A.D., as the palindromic Latin word square "Sator Arepo Tenet Opera Rotas" was found as a graffito at Herculaneum, buried by ash in that year. This palindrome is remarkable for the fact that it also reproduces itself if one forms a word from the first letters, then the second letters and so forth. Hence it can be arranged into a word square that reads in four different ways: horizontally or vertically from top left to bottom right; and horizontally or vertically from bottom right to top left.
While some sources translate this as "The sower Arepo holds the wheels at work", translation is problematic as the word arepo is otherwise unknown; the square may have been a coded Christian signifier, with TENET forming a cross. For further discussion, see separate article.
A palindrome with the same property is the Hebrew palindrome "פרשנו רעבתן שבדבש נתבער ונשרף", (PRShW R`BTN ShBDBSh NTB`R WNShRP, or "parashnuw ra`abtan shebadbash nitba'er wenishrap"), meaning "We explained the glutton who is in the honey was burned and incinerated", by Ibn Ezra, referring to the halachic question as to whether a fly landing in honey makes the honey non-kosher.
פ ר ש נ ו
ר ע ב ת ן
ש ב ד ב ש
נ ת ב ע ר
ו נ ש ר ף
Another Latin palindrome, "In girum imus nocte et consumimur igni" ("We enter the circle at night and are consumed by fire"), was said to describe the behavior of moths. It is likely from medieval rather than ancient times.
Byzantine Greeks often inscribed the palindrome "ΝΙΨΟΝΑΝΟΜΗΜΑΤΑΜΗΜΟΝΑΝΟΨΙΝ" on baptismal fonts; in mixed case with modern accents and divided into words this reads "Νίψον ανομήματα μη μόναν όψιν" ("Nipson anomēmata mē monan opsin"), meaning "Wash the sins, not face alone" (ps, ψ, is the single Greek letter psi).
[edit] Palindromes in languages with different writing systems
In languages that use a writing system other than an alphabet, a palindrome is still a sequence of characters from that writing system that remains the same when reversed.
Japanese palindromes, called kaibun, rely on the hiragana syllabary. An example is the word しんぶんし shinbunshi (in syllables shi-n-bu-n-shi), meaning "newspaper". The Japanese syllabary makes it possible to construct very long palindromes.
A Chinese word is a character, and is not composed of letters or syllables. Therefore, any Chinese word itself is a trivial palindrome. Chinese palindromes have to be phrases or sentences and are much more easy to construct than in languages written with an alphabet. For example, the phrases "我愛媽媽,媽媽愛我" ("I love mother, mother loves me") and "上海自來水來自海上" ("Shanghai's tap water comes from the sea") are palindromes.
Palindromic poetry (回文詩) was a literary genre in classical Chinese literature. The "forward reading" and the "backward reading" of such a poem would be similar but not exactly the same in meaning. Although called "palindromic", these poems are often not palindromes in the normal English sense of the word. They do not necessarily have symmetry of characters or sound, but merely need to make sense when read in either direction. The following example was composed during the Song Dynasty:
枯眼望遙山隔水,往來曾見幾心知。壺空怕酌一杯酒,筆下難成和韻詩。迷路阻人離別久,訊音無雁寄回遲。孤燈夜守長寥寂,夫憶妻兮父憶兒。
The "forward reading" of the last sentence is about husband missing wife and father missing son, while the "backward reading" is about son missing father and wife missing husband.
[edit] Types of palindrome
[edit] Symmetry by characters
The most familiar palindromes, in English at least, are character-by-character: the written characters read the same backwards as forwards. Palindromes may consist of a single word (such as "civic" or "level" ), a phrase or sentence ("Neil, a trap! Sid is part alien!"), or a longer passage of text ("Sit on a potato pan, Otis.") Some other examples are "Do geese see God?" and "Mr. Owl ate my metal worm." Spaces, punctuation and case are usually ignored.
Three famous English palindromes are: "Able was I ere I saw Elba," honoring the first exile of Napoleon; "A man, a plan, a canal: Panama," (by Leigh Mercer, commemorating Theodore Roosevelt or Ferdinand Lesseps), and "Madam, in Eden I'm Adam," (a reference to the creation story in the Bible). (This last example is still palindromic if "in Eden" is omitted. The response would be a one-word palindrome, "Eve.")
A famous palindrome sentence in Portuguese is "Socorram-me, subi no onibus em Marrocos" which means "Help me, I took a bus in Morocco."
[edit] Symmetry by words
Some palindromes use words as units rather than letters. An example is "fall leaves after leaves fall" or "First Ladies rule the State and state the rule: ladies first". The Chinese palindromes described above are most like this type of English palindrome.
[edit] Symmetry by lines
Still other palindromes take the line as the unit. The poem Doppelganger, composed by James A. Lindon, is an example.
The dialogue "Crab Canon" in Douglas Hofstadter's Gödel, Escher, Bach is nearly a line-by-line palindrome. The second half of the dialog consists, with some very minor changes, of the same lines as the first half, but in reverse order and spoken by the opposite characters (i.e., lines spoken by Achilles in the first half are spoken by the Tortoise in the second, and vice versa). In the middle is a non-symmetrical line spoken by the Crab, who enters and spouts some nonsense, apparently triggering the reversal. The structure is modeled after the musical form known as crab canon, in particular the canon a 2 cancrizans of Johann Sebastian Bach's The Musical Offering.
[edit] Numbers
[edit] In music
The interlude from Alban Berg's opera Lulu is a palindrome, as are sections and pieces, in arch form, by many other composers, including James Tenney, and most famously Béla Bartók. George Crumb also used musical palindrome to text paint the Federico Garcia Lorca poem "¿Porque naci?", the first movement of three in his fourth book of Madrigals. Igor Stravinsky's final composition, The Owl and the Pussy Cat, is a palindrome.
The music of Anton Webern is often imbued with palindromes. Webern, who had studied the music of the Renaissance composer Heinrich Issac, was extremely interested in symmetries in music, be they horizontal or vertical. For one of the most famous examples of horizontal or linear symmetry in Webern's music, one should look no further than the first phrase in the second movement of the Opus 21 Symphony. In one of the most striking examples of vertical symmetry, the second movement of the Opus 27 Piano Variations, Webern arranges every pitch of this dodecaphonic work around the central pitch axis of A4. From this, each downward reaching interval is replicated exactly in the opposite direction. For example, a G-sharp3 -- 13 half-steps down from A4 -- is replicated as a B-flat5 -- 13 half-steps above.
See also crab canon — in classical music, a canon in which one line of the melody is reversed in time and pitch from the other.
"Weird Al" Yankovic's song Bob, from his 2003 album Poodle Hat, is a tribute to Bob Dylan and is performed in typically Dylanesque musical style and with Yankovic imitating Dylan's distinct nasal voice. The lyrics are all rhymed palindromes.
The song "The Divided Sky" by Phish, from the 1988 album Junta, contains a brief musical palindrome near the beginning of the song.
In 2003 the city of San Diego, California commissioned sculptor Roman DeSalvo and composer Joseph Waters to create a public artwork in the form of a safety railing on the civilian overpass on Interstate 94 at 25th Street. Entitled Crab Carillon, the result is a set of 488 tuned chimes, that can be played by pedestrians as they cross the overpass. Each chime is tuned to the note of a melody, composed by Waters. The melody is in the form of a palindrome, to accommodate walking in either direction. The music can be heard on the City of San Diego Public Art Website
[edit] Computer programs
Brian Westley wrote a C program for the 1987 International Obfuscated C Code Contest which is a line-by-line palindrome: http://www.ioccc.org/1987/westley.c
Up to the type definitions, here is a compilable almost palindrome written in Caml:
type 'a elbatum = 'a ;; type lol = bool ;; type pop = int ;; type b = { mutable lol : lol elbatum } ;; type i = { mutable pop : pop elbatum } ;;
fun erongi lol pop n -> pop.lol <- let nuf = erongi;fun erongi lol pop n -> pop.lol ; ignore n in erongi ; lol.pop <- n pop lol ignore nuf ; ignore = fun tel -> lol.pop <- n pop lol ignore nuf ;;
The problem lies in the angle brackets, which are reversed when reading backwards from the end.
[edit] Long palindromes
The longest palindromic word in the Oxford English Dictionary is tattarrattat, coined by James Joyce in Ulysses for a knock on the door. The Guinness Book of Records gives detartrated, the past tense of detartrate, a somewhat contrived chemical term meaning to remove tartrates. Rotavator, a trademarked name for an agricultural machine, is often listed in dictionaries. The term redivider (i.e. someone or something that redivides) is used by some writers but appears to be an invented term - only redivide and redivision appear in the "Shorter Oxford Dictionary". Malayalam, an Indian language, is of equal length.
Saippuakauppias, Finnish for "soap vendor", is claimed to be the world's longest palindromic word in everyday use. A meaningful derivative from it is saippuakalasalakauppias (soapfish bootlegger). An even longer effort is saippuakuppinippukauppias (soapdish batch seller) Koortsmeetsysteemstrook is probably the longest palindrome in Dutch, and Kuulilennuteetunneliluuk (bullet flightway tunnel hatch) is the longest palindrome in Estonian.
To celebrate the palindromic moment 20:02 02/20 2002, Peter Norvig wrote on that day (20 February 2002) a computer program which produced what Norvig himself regards as the world's longest palindromic sentence, running to 17,259 words [1]. However, although it is technically palindromic, it violates the rules of English grammar as it doesn't qualify as a sentence.
A long palindrome in English that reads more easily and attempts to flow is reproduced here.
A historically famous palindrome was the headline of a newspaper reporting the development of the Panama Canal: "A Man, a Plan, a Canal: Panama"
In 1991, Gordon Dow composed a 306 word palindrome titled Dog Sees Ada. This palindrome is famous for using very few contrived words. It is reproduced here.
The poet Graywyvern wrote a 427-line palindromic poem, "The Angel of Death," in 2005, still available both online and in hard copy.
Two "palindromic novels" appeared, in limited editions, during the 1980s: Dr Awkward & Olson in Oslo by Lawrence Levine (self-published, St Augustine FL); and Satire: Veritas by David Stephens (Word Ways Monographs) (reference1reference2).
Demetri Martin, a stand-up comedian, wrote a poem titled "Dammit I'm Mad", which is a 223 word palindrome. The poem does not use any made-up words and is grammatically correct.
[edit] Longest palindromes in Polish
Stanisław Barańczak, a Polish poet and translator created a Mega-Palindromader which is based on symmetry by letters. This work in Polish is composed of 4 introductory small palindromes (as the author called them, 'fanfares') and the main 2,501-letter palindrome. This was bettered by Prof. Tadeusz Morawski, Polish palindrome enthusiast and author, who published two longer palindromes in his 2005 book Gór ech chce róg. In June 2006, Prof. Morawski announced he has created a record-breaking 33,000-letter palindrome, published on his webpage [2], gaining some coverage in national press.
[edit] Biological structures
In most genomes or sets of genetic instructions, palindromic motifs are found. However, the meaning of palindrome in the context of genetics is slightly different from the definition used for words and sentences. Since the DNA is formed by two paired strands of nucleotides, and the nucleotides always pair in the same way (Adenine (A) with Thymine (T), Cytosine (C) with Guanine (G)), a (single-stranded) sequence of DNA is said to be a palindrome if it is equal to its complementary sequence read backwards. For example, the sequence ACCTAGGT is palindromic because its complement is TGGATCCA, which is equal to the original sequence in reverse.
A palindromic DNA sequence can form a hairpin. Palindromic motifs are made by the order of the nucleotides that specify the complex chemicals (proteins) which, as a result of those genetic instructions, the cell is to produce. They have been specially researched in bacterial chromosomes and in the so-called Bacterial Interspersed Mosaic Elements (BIMEs) scattered over them. Recently a research genome sequencing project discovered that many of the bases on the Y chromosome are arranged as palindromes. A palindrome structure allows the Y chromosome to repair itself by bending over at the middle if one side is damaged.
[edit] Computation theory
In automata theory, a set of all palindromes in a given alphabet is a typical example of a language which is context-free, but not regular.
The following Context-free grammar produces all palindromes for the alphabet {a,b}:
- S → a | b | aSa | bSb | (empty)
Even though this grammar is not ambiguous, it is not parseable by any LR(k) parser either. Essentially, given an incomplete string that begins a palindrome, it is impossible to identify the “middle”, unless the entire palindrome is present. To illustrate, suppose that a palindrome begins with
- “madamim...”.
There is not enough information to determine whether the string ends with
- “…adam” or
- “...imadam”, or
- “...xyzzyxmimadam”, etc..
It turns out that palindromes cannot be accepted by any deterministic pushdown automaton[3]. The following non-deterministic pushdown automaton accepts palindromes for the alphabet {a,b}. The non-determinism is reflected in the choice of transitions from state 0. This choice essentially represents finding the “middle” of the palindrome.
- Start state: 0
- Accept state: 2
State | Input | Stack | Action | NextState |
---|---|---|---|---|
0 | a | A, B, or empty | push A | 0 |
0 | b | A, B, or empty | push B | 0 |
0 | a | A, B, or empty | none | 1 |
0 | b | A, B, or empty | none | 1 |
0 | a | A, B, or empty | push A | 1 |
0 | b | A, B, or empty | push B | 1 |
0 | end | empty | none | 2 |
1 | a | A | pop | 1 |
1 | b | B | pop | 1 |
1 | end | empty | none | 2 |
A proof that palindromes are not regular uses the Pumping Lemma:
For any positive integer p, consider the palindrome w = apbap. For example, for p = 3, we have w = “aaabaaa”.
Consider all partitionings of this word w = xyz, such that |y| > 0 and |xy| <= p. For example, for p = 3, we must consider the possibilities:
- x = “”, y = “a”, z = “aabaaa”
- x = “”, y = “aa”, z = “abaaa”
- x = “”, y = “aaa”, z = “baaa”
- x = “a”, y = “a”, z = “abaaa”
- x = “a”, y = “aa”, z = “baaa”
- x = “aa”, y = “a”, z = “baaa”
If palindromes were a regular language, then for one of these partionings xyiz will also be a palindrome for any i. Here, we will show that for any such partitioning, i = 0, results in xyiz being a non-palindrome.
Since |xy| ≤ p, x and y together must be entirely within the first set of a’s. Since |y| > 0, the y section must contain at least one of these a’s. Thus, deleting the y section will result in deletion of at least one a from the left side, resulting in a non-palindrome.
[edit] Poking fun at palindromes
In their famous Dead Parrot sketch Monty Python pokes fun at palindromes:
Shopkeeper (Michael Palin): (having said the customer was in Ipswich instead of Bolton) It was a pun.
Customer (John Cleese): A pun?
Shopkeeper: No, no, not a pun, no. What's the other thing which reads the same backwards as forwards?
Customer: A palindrome?
Shopkeeper: Yeah, yeah.
Customer: It's not a palindrome. The palindrome of Bolton would be Notlob. It don't work.
[edit] The palindrome in Greek
Even though the word Palindrome was constructed from Greek roots, the Greek expression to describe a Palindrome is "Καρκινική επιγραφή", Karkinikê epigrafê (literally translated: "Crab inscription"), or simply "Καρκινιήοι" (crabs) from the backward movement of crabs - therefore, an inscription which can be read backwards.
[edit] Semordnilaps
Semordnilap is a name coined for a word or phrase that spells a different word or phrase backwards. "Semordnilap" is itself "palindromes" spelled backwards. Semordnilaps are also known as heteropalindromes, semi-palindromes, half-palindromes, reversgrams, mynoretehs, reversible anagrams [4], word reversals, or anadromes [5]. They have also sometimes been called antigrams [6], though this term now usually refers to anagrams with opposing meanings.