Regular Language - The Number of Words in A Regular Language

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:

    “This nightmare occupied some ten pages of manuscript and wound off with a sermon so destructive of all hope to non-Presbyterians that it took the first prize. This composition was considered to be the very finest effort of the evening.... It may be remarked, in passing, that the number of compositions in which the word “beauteous” was over-fondled, and human experience referred to as “life’s page,” was up to the usual average.”
    —Mark Twain [Samuel Langhorne Clemens] (1835–1910)

    “Those graceful acts,
    Those thousand decencies, that daily flow
    From all her words and actions, mixed with love
    And sweet compliance, which declare unfeigned
    Union of mind, or in us both one soul.”
    —John Milton (1608–1674)

    “He hung out of the window a long while looking up and down the street. The world’s second metropolis. In the brick houses and the dingy lamplight and the voices of a group of boys kidding and quarreling on the steps of a house opposite, in the regular firm tread of a policeman, he felt a marching like soldiers, like a sidewheeler going up the Hudson under the Palisades, like an election parade, through long streets towards something tall white full of colonnades and stately. Metropolis.”
    —John Dos Passos (1896–1970)

    “Translate a book a dozen times from one language to another, and what becomes of its style? Most books would be worn out and disappear in this ordeal. The pen which wrote it is soon destroyed, but the poem survives.”
    —Henry David Thoreau (1817–1862)