The Number of Words in A Regular Language
Let denote the number of words of length in . The ordinary generating function for L is the formal power series
The generating function of a language L is a rational function if and only if L is regular. Hence for any infinite regular language there exist constants and polynomials such that for every the number of words of length in satisfies the equation .
Thus, non-regularity of certain infinite languages can be proved by counting the words of a given length in . Consider, for example, the Dyck language of strings of balanced parentheses. The number of words of length in the Dyck language is equal to the Catalan number, which is not of the form, witnessing the non-regularity of the Dyck language.
The zeta function of a language L is
The zeta function of a regular language is not in general rational, but that of a cyclic language is.
Read more about this topic: Regular Language
Famous quotes containing the words number, words, regular and/or language:
“I am walking over hot coals suspended over a deep pit at the bottom of which are a large number of vipers baring their fangs.”
—John Major (b. 1943)
“I wonder whether mankind could not get along without all these names, which keep increasing every day, and hour, and moment; till at the last the very air will be full of them; and even in a great plain, men will be breathing each others breath, owing to the vast multitude of words they use, that consume all the air, just as lamp-burners do gas.”
—Herman Melville (18191891)
“A regular council was held with the Indians, who had come in on their ponies, and speeches were made on both sides through an interpreter, quite in the described mode,the Indians, as usual, having the advantage in point of truth and earnestness, and therefore of eloquence. The most prominent chief was named Little Crow. They were quite dissatisfied with the white mans treatment of them, and probably have reason to be so.”
—Henry David Thoreau (18171862)
“Like the trains beat
Swift language flutters the lips
Of the Polish airgirl in the corner seat.”
—Philip Larkin (19221986)