跳到主要内容

東京大学 情報理工学系研究科 コンピュータ科学専攻 2018年2月実施 問題2

Author

kainoj, 祭音Myyura

Description

For each n1n \geq 1, let Σn\Sigma_n be {a1,,an}\{a_1, \dots, a_n\}, where a1,,ana_1, \dots, a_n are different from each other. For a word wΣnw \in \Sigma_n^*, we write wai|w|_{a_i} for the number of occurrences of aia_i in ww. We define the languages L,nL_{\forall, n} and L,nL_{\exists, n} over Σn\Sigma_n by:

L,n={wΣnwai is even for every i{1,,n}},L_{\forall, n} = \{w \in \Sigma_n^* \mid |w|_{a_i} \text{ is even for every } i \in \{1, \dots, n\}\},

and

L,n={wΣnwai is even for some i{1,,n}}.L_{\exists, n} = \{w \in \Sigma_n^* \mid |w|_{a_i} \text{ is even for some } i \in \{1, \dots, n\}\}.

Answer the following questions.

(1) Give a deterministic finite state automaton with 44 states that accepts L,2L_{\forall, 2}.

(2) Give a non-deterministic finite state automaton with 77 states (without ϵ\epsilon-transitions) that accepts L,3L_{\exists, 3}.

(3) Prove that, for every n1n \geq 1, every deterministic finite state automaton that accepts L,nL_{\exists, n} has at least 2n2^n states.

(4) Prove that, for every n1n \geq 1, every non-deterministic finite state automaton (without ϵ\epsilon-transitions) that accepts L,nL_{\forall, n} has at least 2n2^n states.

题目描述

对每个 n1n\ge1,令 Σn={a1,,an}\Sigma_n=\{a_1,\ldots,a_n\},其中各字符互不相同。对 wΣnw\in\Sigma_n^*,以 wai|w|_{a_i} 表示字符 aia_iww 中出现的次数。定义

L,n={wΣn对每个 i{1,,n}, wai 均为偶数},L_{\forall,n} =\{w\in\Sigma_n^*\mid \text{对每个 }i\in\{1,\ldots,n\},\ |w|_{a_i}\text{ 均为偶数}\},

以及

L,n={wΣn存在 i{1,,n} 使 wai 为偶数}.L_{\exists,n} =\{w\in\Sigma_n^*\mid \text{存在 }i\in\{1,\ldots,n\}\text{ 使 }|w|_{a_i}\text{ 为偶数}\}.

回答下列问题。

(1)给出一个具有 44 个状态、识别 L,2L_{\forall,2} 的 DFA。

(2)给出一个具有 77 个状态、不含 ε\varepsilon 转移、识别 L,3L_{\exists,3} 的 NFA。

(3)证明对每个 n1n\ge1,任何识别 L,nL_{\exists,n} 的 DFA 都至少有 2n2^n 个状态。

(4)证明对每个 n1n\ge1,任何不含 ε\varepsilon 转移且识别 L,nL_{\forall,n} 的 NFA 都至少有 2n2^n 个状态。

Kai

(1)

This one was also solved in Automata Theory, Languages and computation 3rd ed, 2.2.4, Example 2.4

Explanation:

  • A: "number of aa's is even, number of bb's is even"
  • B: "number of aa's is odd, number of bb's is even"
  • C: "number of aa's is even, number of bb's is odd"
  • D: "number of aa's is odd, number of bb's is odd"

(2)

Begin with an ϵ\epsilon-NFA as depiced in Fig. (2-a). It "guesses" which letter appears even number of times. To make it ϵ\epsilon-free, we either follow him: https://youtu.be/sq-dLKAd6bo?t=1714 or consider the followig: starting from start state, how far, i.e. which states can we reach on letter aa? There are 33 such states. We simply draw an edge to those states. Do the same for b,cb,c. The final answer is on Fig. (2-b)

Fig. (2-a)
Fig. (2-b)

(3)

Prove that, for every n1n\geq 1, every deterministic finite state automaton that accepts L,nL_{\exists ,n} has at least 2n2^n states.

For each parity vector u{0,1}nu\in\{0,1\}^n, choose a word xux_u whose parity vector is uu. If uvu\ne v, append a word zz with parity vector 1u\boldsymbol1-u. Then xuzx_uz has all counts odd and is rejected, whereas xvzx_vz still has at least one even count and is accepted. Thus the 2n2^n words xux_u are pairwise distinguishable, so every DFA needs at least 2n2^n states.

(4)

For each S{1,,n}S\subseteq\{1,\ldots,n\}, let xS=ySx_S=y_S be the word containing one copy of aia_i for every iSi\in S. Then xSySL,nx_Sy_S\in L_{\forall,n}. For STS\ne T, however, xSyTL,nx_Sy_T\notin L_{\forall,n} because every letter indexed by STS\triangle T occurs once.

Fix an accepting path for each xSySx_Sy_S, and let qSq_S be its state just after xSx_S. If qS=qTq_S=q_T for distinct S,TS,T, the prefix of the path for xSySx_Sy_S and the suffix of the path for xTyTx_Ty_T form an accepting path for xSyTx_Sy_T, a contradiction. Hence all 2n2^n states qSq_S are distinct.