通常の言語で指定された長さの単語の数


15

通常の言語で、与えられた長さの単語の数の代数的特徴はありますか?

ウィキペディアは結果をやや不正確に述べています:

任意の正規言語の場合はL定数が存在するλ1,…,λk及び多項式p1(バツ)、…、pk(バツ) ようにすべてのためのn数sL(n)の長さの単語のnにおけるL式を満たす sL(n)=p1(n)λ1n+⋯+pk(n)λkn。

どのスペースにλ住んでいるか(C、私は推測します)、および関数が全体で非負の整数値を持つ必要があるかどうかは述べられていませんN。正確な声明と、証拠のスケッチまたはリファレンスをお願いします。

ボーナスの質問:逆は真ですか、つまり、この形式の関数が与えられた場合、長さあたりの単語数がこの関数に等しい通常の言語は常に存在しますか?

この質問は、通常の言語の単語数(00)∗


3
証拠のスケッチはこちら
— アルテムKaznatcheev

3
@ArtemKaznatcheev興味深い、ありがとう。この質問への回答を移動することを検討しますか?
— ジル 'SO-悪であるのをやめる

1
この質問は少し冗長であると感じます(より一般的ですが)。証明への私のアプローチを一般化するのは少し難しいですが、夕食後に見てみましょう。
— アルテムKaznatcheev

@ArtemKaznatcheevありがとう。回答の2番目の部分で問題が発生し、還元可能なDFAに拡張されました。
— ジル「SO-悪であるのをやめる」

1
@vzn通常の言語における単語数の生成関数は合理的であるという古典的な事実であり、これはOPの式を(その正しい形で)即座に暗示します。難しい部分は、漸近線を抽出することです。詳細については、(たとえば)私の答えで言及したAnalytic Combinatoricsの本をチェックしてください。
— ユヴァルフィルマス

回答:


10

正規言語所与、いくつかのDFA受け入れる検討Lを、聞かせてAがその伝達行列である(A 、I 、Jの状態から前縁の数であり、I状態へJ)、聞かせてX初期状態の特徴ベクトルであり、およびlet yは受け入れ状態の特性ベクトルである。それから s L(n )= x T A n y 。LLAA私j私jバツy

sL(n)=バツTAny。

複素数上、ことをヨルダンの定理状態のいずれかの形式のブロックとマトリクスと同様である (λ)、(λ 1 0 λ)、(λ 1 0 0 λ 1 0 0 λ)、(λ 1 0 0 0 λ 1 0 0 0 λ 1 0 0 0 λ)、··· もしλ ≠ 0、次にNA

(λ)、(λ10λ)、(λ100λ100λ)、(λ1000λ1000λ1000λ)、…
λ≠0nこれらのブロックの乗である ここでは、これらの式になった方法は次のとおりです。としてブロックを書くB=λ+N。Nの連続した累乗は、行列の連続する2次対角線です。二項定理を使用して(λがNと交換するという事実を使用して)、 Bn=(λ+n)N=λ
(λn)、(λnnλn−10λn)、(λnnλn−1(n2)λn−20λnnλn−100λn)、(λnnλn−1(n2)λn−2(n3)λn−30λnnλn−1(n2)λn−200λnnλn−1000λn)、…
B=λ+NNλN 場合λ=0、ブロックはベキ零であり、我々は、以下の行列得る(表記[N=K]であり、1であれば、N=Kと0それ以外): ( [ N = 0 ])、( [ N = 0 ] [ n = 1 ] 0 [ n = 0
Bn=(λ+n)N=λn+nλn−1N+(n2)λn−2N2+⋯。
λ=0[n=k]1n=k0
([n=0])、([n=0][n=1]0[n=0])、([n=0][n=1][n=2]0[n=0][n=1]00[n=0])、([n=0][n=1][n=2][n=3]0[n=0][n=1][n=2]00[n=0][n=1]000[n=0])

An(nk)λn−k[n=k]

sL(n)=∑私p私(n)λ私n+∑jcj[n=j]、
λ私、cjp私n
sL(n)=∑ipi(n)λin.
This is the precise statement of the result.

We can go on and obtain asymptotic information about sL(n), but this is surprisingly non-trivial. If there is a unique λi of largest magnitude, say λ1, then

sL(n)=p1(n)λ1n(1+o(1)).
Things get more complicated when there are several λs of largest magnitude. It so happens that their angle must be rational (i.e. up to magnitude, they are roots of unity). If the LCM of the denominators is d, then the asymptotics of sL will very according to the remainder of n modulo d. For some of these remainders, all λs of largest magnitude cancel, and then the asymptotics "drops", and we have to iterate this procedure. The interested reader can check the details in Flajolet and Sedgewick's Analytic Combinatorics, Theorem V.3. They prove that for some d, integers p0,…,pd−1 and reals λ0,…,λd−1,
sL(n)=npn(modd)λn(modd)n(1+o(1)).

8

Let L⊆Σ∗ a regular language and

L(z)=∑n≥0|Ln|zn

its generating function, where Ln=L∩Σn and so |Ln|=sL(n).

It is known that L(z) is rational, i.e.

P(z)Q(z)

with P,Q polynomials; this is easiest seen by translating a right-linear grammar for L into a (linear!) equation system whose solution is L(z).

The roots of Q are essentially responsible for the |Ln|, leading to the form stated on Wikipedia. This is immediately related with the method of characteristic polynomials for solving recurrences (via the recurrence which describes (|Ln|)n∈N) .


あなたの答えが質問にどのように答えるかは明らかではありません。また、何ですかLn?
— デイブクラーク

1
@Gilles Analytic Combinatorics, the books by Eilenberg, the book by Berstel, Reutenauer
— ウリ


1
@Patrick87: 1) Right, typo; thanks! 2) For finite languages, the generating function is a polynomial (and therewith rational). As Q(z)=1, this approach won't work. The linked theorem starts with a linear homogeneous recurrence; I don't think those can describe sequences that are zero for all k≥n0 (and non-zero for at least one value). Not sure, though. If I am right, the statement we are talking about does indeed only hold for infinite regular languages; this would not be entirely surprising as finite languages do not have any structure.
— Raphael

1
@Raphaelうん、私の考えは似ていました...(a)有限言語は規則的であり、(b)定理は有限言語が規則的ではないことを意味し、(c)言語が有限であるかどうかを判断することは(一般に)決定不能です。それらは有限言語で動作します。
— Patrick87
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.