跳到主要内容

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

Author

kainoj

Description

For a non-deterministic finite automaton MM over an alphabet Σ\Sigma, we write L(M)Σ\mathcal{L}(M) \subseteq \Sigma^* for the set of words accepted by MM. We write w|w| for the length of the word ww, and write N\mathbb{N} for the set of non-negative integers.

Answer the following questions:

(1) Consider the non-deterministic finite automaton M0M_0 depicted below, where q0q_0 is the start state, and q3q_3 is the only final state. Give x,y,z{a,b,c}x, y, z \in \{a, b, c\}^* that satisfy all of the following conditions:

  • (i) xyz=abccxyz = abcc
  • (ii) y>0|y| > 0
  • (iii) xynzL(M)x y^n z \in \mathcal{L}(M) for every nNn \in \mathbb{N}.

(2) Prove that, for every non-deterministic finite automaton MM consisting of kk states and for every wL(M)w \in \mathcal{L}(M) such that wk|w| \ge k, there exist x,y,x, y, and zz that satisfy all of the following conditions:

  • (i) xyz=wxyz = w
  • (ii) y>0|y| > 0
  • (iii) xyk|xy| \le k
  • (iv) xynzL(M)x y^n z \in \mathcal{L}(M) for every nNn \in \mathbb{N}.

(3) Prove that there exists no non-deterministic finite automaton MM such that L(M)={ambnm,nN,0<m<n}\mathcal{L}(M) = \{ a^m b^n \mid m, n \in \mathbb{N}, 0 < m < n \}. You may use the fact proved in question (2).

题目描述

对字母表 Σ\Sigma 上的 NFA MM,用 L(M)Σ\mathcal{L}(M)\subseteq\Sigma^* 表示其接受的字符串集合,用 w|w| 表示字符串 ww 的长度,并以 N\mathbb{N} 表示非负整数集合。回答下列问题。

(1)考虑题图所示的 NFA M0M_0,其中 q0q_0 为初始状态,q3q_3 为唯一接受状态。给出 x,y,z{a,b,c}x,y,z\in\{a,b,c\}^*,使其同时满足:

  • xyz=abccxyz=abcc
  • y>0|y|>0
  • 对每个 nNn\in\mathbb{N},都有 xynzL(M)xy^nz\in\mathcal{L}(M)

(2)证明:对任意含 kk 个状态的 NFA MM,以及任意满足 wL(M)w\in\mathcal{L}(M)wk|w|\ge k 的字符串 ww,都存在 x,y,zx,y,z 满足:

  • xyz=wxyz=w
  • y>0|y|>0
  • xyk|xy|\le k
  • 对每个 nNn\in\mathbb{N},都有 xynzL(M)xy^nz\in\mathcal{L}(M)

(3)证明不存在 NFA MM 使

L(M)={ambnm,nN, 0<m<n}.\mathcal{L}(M) =\{a^mb^n\mid m,n\in\mathbb{N},\ 0<m<n\}.

可以使用第(2)问证明的事实。

Kai

(1)

x=ax = a, y=bcy = bc and z=cz = c

(2)

Classic proof of Pumping Lemma (PL) for regular languages. Let M\mathcal{M} be an automaton with kk states. Let w=a1a2akL(M)w = a_1a_2\cdots a_k \in L(M) such that w>k|w| > k. Now let's simulate run of M\mathcal{M} of word ww. Define states pi=δ^(q0,w1w2wi)p_i = \hat\delta(q_0, w_1w_2\cdots w_i). That is, pip_i is a state in which M\mathcal{M} is after reading first ii inputs. From pigeonhole principle, at lest two of those state must be exactly the same state. Let pi=pjp_i = p_j be the state that is visited the second time for the first time (i.e. ii is the smallest among all such states).

I claim that: w=xyzw = xyz, where

  • x=a1a2ai1x = a_1a_2\cdots a_{i-1}
  • y=aiai+1aj1y = a_ia_{i+1}\cdots a_{j-1}
  • z=ajaj+1akz = a_ja_{j+1}\cdots a_k

Obviously, y>0|y| > 0 because iji\neq j and xy=j1n|xy| = j - 1 \leq n. States pi,,pjp_i, \dots, p_j create a loop in the automaton - it can be traversed any number of times, thus xynzL(M)xy^nz \in L(\mathcal{M}). For n=0n=0 we simply "skip" the loop, for n1n\geq 1 we traverse the loop nn times.

(3)

L(M)={ambnn,mN,0<m<n}L(M) = \{ a^m b^n | n,m \in \mathbb{N}, 0<m<n \} Assume that LL is regular language. Then pumping lemma must hold. Consider w=akbk+1Lw = a^k b^{k+1} \in L, where kk is the pumping lemma constant. Because w=2k+1>k|w| = 2k + 1 > k, then there must exist a partitioning xyz=wxyz = w such that xy<k|xy| < k, y>0|y|>0 and xynzLxy^nz \in L \textbf{for all} nNn\in\mathbb{N}. Notice that xyxy consists of aa's only. Let's "pump up" yy. For example, xy42zxy^{42}z contains of significantly more aa's than bb's. This word does not belong to the language. Contradiction with statement that xynzLx y^n z \in L for all nNn\in N. L(M)L(M) is not regular, thus there exist no automaton recognizing it.