東京大学 情報理工学系研究科 コンピュータ科学専攻 2018年2月実施 問題2
Author
kainoj, 祭音Myyura
Description
For each , let be , where are different from each other. For a word , we write for the number of occurrences of in . We define the languages and over by:
and
Answer the following questions.
(1) Give a deterministic finite state automaton with states that accepts .
(2) Give a non-deterministic finite state automaton with states (without -transitions) that accepts .
(3) Prove that, for every , every deterministic finite state automaton that accepts has at least states.
(4) Prove that, for every , every non-deterministic finite state automaton (without -transitions) that accepts has at least states.
题目描述
对每个 ,令 ,其中各字符互不相同。对 ,以 表示字符 在 中出现的次数。定义
以及
回答下列问题。
(1)给出一个具有 个状态、识别 的 DFA。
(2)给出一个具有 个状态、不含 转移、识别 的 NFA。
(3)证明对每个 ,任何识别 的 DFA 都至少有 个状态。
(4)证明对每个 ,任何不含 转移且识别 的 NFA 都至少有 个状态。
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 's is even, number of 's is even"
- B: "number of 's is odd, number of 's is even"
- C: "number of 's is even, number of 's is odd"
- D: "number of 's is odd, number of 's is odd"
(2)
Begin with an -NFA as depiced in Fig. (2-a). It "guesses" which letter appears even number of times. To make it -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 ? There are such states. We simply draw an edge to those states. Do the same for . The final answer is on Fig. (2-b)
Fig. (2-a)
Fig. (2-b)
(3)
Prove that, for every , every deterministic finite state automaton that accepts has at least states.
For each parity vector , choose a word whose parity vector is . If , append a word with parity vector . Then has all counts odd and is rejected, whereas still has at least one even count and is accepted. Thus the words are pairwise distinguishable, so every DFA needs at least states.
(4)
For each , let be the word containing one copy of for every . Then . For , however, because every letter indexed by occurs once.
Fix an accepting path for each , and let be its state just after . If for distinct , the prefix of the path for and the suffix of the path for form an accepting path for , a contradiction. Hence all states are distinct.