跳到主要内容

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

Author​

kainoj, 祭音Myyura

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) xynz∈L(M)x y^n z \in \mathcal{L}(M) for every n∈Nn \in \mathbb{N}.

(2) Prove that, for every non-deterministic finite automaton MM consisting of kk states and for every w∈L(M)w \in \mathcal{L}(M) such that ∣w∣≥k|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) ∣xy∣≤k|xy| \le k
  • (iv) xynz∈L(M)x y^n z \in \mathcal{L}(M) for every n∈Nn \in \mathbb{N}.

(3) Prove that there exists no non-deterministic finite automaton MM such that L(M)={ambn∣m,n∈N,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;
  • 对每个 n∈Nn\in\mathbb{N},都有 xynz∈L(M)xy^nz\in\mathcal{L}(M)。

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

  • xyz=wxyz=w;
  • ∣y∣>0|y|>0;
  • ∣xy∣≤k|xy|\le k;
  • 对每个 n∈Nn\in\mathbb{N},都有 xynz∈L(M)xy^nz\in\mathcal{L}(M)。

(3)证明不存在 NFA MM 使

L(M)={ambn∣m,n∈N, 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)​

Fix an accepting run of MM on w=a1⋯amw=a_1\cdots a_m, where m≥km\geq k. Among the states after reading 0,1,…,k0,1,\ldots,k symbols, two are equal; write them as pi=pjp_i=p_j with 0≤i<j≤k0\leq i<j\leq k. Set

x=a1⋯ai,y=ai+1⋯aj,z=aj+1⋯am.x=a_1\cdots a_i,\quad y=a_{i+1}\cdots a_j,\quad z=a_{j+1}\cdots a_m.

Then ∣y∣>0|y|>0, ∣xy∣=j≤k|xy|=j\leq k, and the run segment from pip_i back to pj=pip_j=p_i may be repeated any number of times. Hence xynz∈L(M)xy^nz\in\mathcal L(M) for every n∈Nn\in\mathbb N.

(3)​

L(M)={ambn∣n,m∈N,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+1∈Lw = 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| \le k, ∣y∣>0|y|>0 and xynz∈Lxy^nz \in L for all n∈Nn\in\mathbb{N}. Since ∣xy∣≤k|xy|\leq k, we have y=ary=a^r for some r≥1r\geq1. Then xy3zxy^3z has k+2r≥k+2k+2r\geq k+2 occurrences of aa but only k+1k+1 occurrences of bb, so it is not in LL. Contradiction with statement that xynz∈Lx y^n z \in L for all n∈Nn\in N. L(M)L(M) is not regular, thus there exist no automaton recognizing it.