跳到主要内容

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

Author

kainoj

Description

Let us consider nondeterministic finite automata with ε\varepsilon-transitions (ε\varepsilon-NFAs) over the alphabet Σ={a,b}\Sigma = \{a, b\}. An ε\varepsilon-NFA is an NFA that can additionally have "silent" transitions labeled with a fresh symbol ε\varepsilon. A word wΣw \in \Sigma^* is accepted by an ε\varepsilon-NFA MM if there exists a word w(Σ{ε})w' \in (\Sigma \cup \{\varepsilon\})^* such that:

  1. ww' is accepted by MM (when MM is considered an NFA over the alphabet Σ{ε}\Sigma \cup \{\varepsilon\}); and
  2. removing all the occurrences of ε\varepsilon in ww' gives rise to ww.

The language L(M)ΣL(M) \subseteq \Sigma^* of an ε\varepsilon-NFA MM is the set of words accepted by MM.

An example of an ε\varepsilon-NFA is given below; it is referred to as M1M_1. Here q0q_0 is an initial state and q2q_2 is an accepting state.

Answer the following questions:

(1) Give a regular expression that designates the language L(M1)L(M_1) of the above ε\varepsilon-NFA M1M_1.

(2) Give an NFA M2M_2 over Σ\Sigma such that: L(M2)=L(M1)L(M_2) = L(M_1); and M2M_2 is ε\varepsilon-free, that is, there are no transitions labeled with \varepsilon in M2M_2.

(3) Give an ε\varepsilon-NFA M3M_3 such that

L(M3)={wΣw contains aa as a subword, that is, w=w1aaw2 for some w1,w2Σ}.L(M_3) = \{ w \in \Sigma^* \mid w \text{ contains } aa \text{ as a subword, that is, } w = w_1 aa w_2 \text{ for some } w_1, w_2 \in \Sigma^* \}.

Your answer may be ε\varepsilon-free.

(4) Give an ε\varepsilon-NFA M4M_4 such that L(M4)=L(M1)L(M3)L(M_4) = L(M_1) \cup L(M_3), where M3M_3 is from Question (3). Your answer may be ε\varepsilon-free.

(5) Give an ε\varepsilon-NFA M5M_5 such that L(M5)=L(M1)L(M3)L(M_5) = L(M_1) \cap L(M_3), where M3M_3 is from Question (3). Your answer may be ε\varepsilon-free.

题目描述

在字母表 Σ={a,b}\Sigma=\{a,b\} 上考虑带 ε\varepsilon 转移的非确定性有限自动机(ε\varepsilon-NFA)。ε\varepsilon-NFA 除普通 NFA 的转移外,还允许标记为新符号 ε\varepsilon 的“无声”转移。若存在 w(Σ{ε})w'\in(\Sigma\cup\{\varepsilon\})^*,使得 ww' 被把 MM 视为字母表 Σ{ε}\Sigma\cup\{\varepsilon\} 上的 NFA 时接受,并且删除 ww' 中全部 ε\varepsilon 后得到 ww,则称 wΣw\in\Sigma^*MM 接受。L(M)L(M) 表示 MM 接受的所有字符串构成的语言。

题图给出了一个 ε\varepsilon-NFA M1M_1,其中 q0q_0 是初始状态,q2q_2 是接受状态。回答下列问题。

(1)给出描述 L(M1)L(M_1) 的正则表达式。

(2)给出字母表 Σ\Sigma 上不含任何 ε\varepsilon 转移的 NFA M2M_2,使得 L(M2)=L(M1)L(M_2)=L(M_1)

(3)构造一个 ε\varepsilon-NFA M3M_3,使得

L(M3)={wΣw 含有子串 aa,即存在w1,w2Σ 使 w=w1aaw2}.L(M_3)=\{w\in\Sigma^*\mid w\text{ 含有子串 }aa,即存在 w_1,w_2\in\Sigma^*\text{ 使 }w=w_1aaw_2\}.

答案也可以不含 ε\varepsilon 转移。

(4)构造 ε\varepsilon-NFA M4M_4,使 L(M4)=L(M1)L(M3)L(M_4)=L(M_1)\cup L(M_3)。答案也可以不含 ε\varepsilon 转移。

(5)构造 ε\varepsilon-NFA M5M_5,使 L(M5)=L(M1)L(M3)L(M_5)=L(M_1)\cap L(M_3)。答案也可以不含 ε\varepsilon 转移。

Kai

(1)

abaa^*b^*a^*

(2)

(3)

(4)

(5)

L(M5)L(M_5) contains aaaa and is of form of aaaba+abaaaaaa^*b^*a^* + a^*b^*aaa^*.