跳到主要内容

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

Author

kainoj, 祭音Myyura

Description

Let us consider nondeterministic finite automata (NFA) and deterministic finite automata (DFA) over the alphabet Σ={a,b}\Sigma = \{a, b\}. For example, the NFA M1M_1 shown below

recognizes the language

L1={wΣthe last letter of w is a}L_1 = \{ w \in \Sigma^* \mid \text{the last letter of } w \text{ is } a \}

Here Σ\Sigma^* denotes the set of words over Σ\Sigma.

Answer the following questions.

(1) Present an NFA, with at most four states, that recognizes the language

L3={wΣw3 and the third last letter of w is a}L_3 = \{ w \in \Sigma^* \mid |w| \geq 3 \text{ and the third last letter of } w \text{ is } a \}

Here w|w| denotes the length of the word ww.

(2) Present a DFA that recognizes the language L3L_3 in Question (1).

(3) A DFA that recognizes the language L3L_3 has no less than 23=82^3 = 8 states. Prove this fact.

(4) Argue for the following statement:

  • To recognize the same language, a DFA possibly needs the number of states that is exponentially bigger than an NFA does.

Kai

(1)

(2)

(3) + (4)

I'll prove that DFA that recognizes LnL_n:

Ln={wΣw3 and n-th to the last letter of w is a}L_n = \{ w\in \Sigma^* | \: |w| \geq 3 \text{ and n-th to the last letter of $w$ is $a$}\}

has no less than 2n2^n states. This is almost a copy-paste from Introduction to Automata Theory, Languages and Computation 3rd ed., Chapter 2.3.6.

Intuitively we need 2n2^n states to remember every possible ending of length nn: we can encode it as a binary string of length nn. Now, I'll show that there's no such DFA with less than 2n2^n states.

Suppose that there's DFA DD recognizing LnL_n with less tan 2n2^n states. If so, then tere must exist a state qq in which DD is after reading two different sequences, say x=x1x2xnx = x_1x_2\cdots x_n and y=y1y2yny = y_1y_2\cdots y_n. Since they are different, let iNi\in N be the last position on which they differ. By symmetry, assume that xi=ax_i = a and yi=by_i = b.

  • if i=1i = 1, then x=ax2xnx = a\:x_2\cdots x_n and y=by2yny = b\:y_2\cdots y_n. Which means that state qq is both accepting and non-accepting.
  • if i>1i > 1, then we can append (ni)(n-i) bb's to both xx and yy. Then a state pp in which DD is after reading axi+1xnbbax_{i+1}\cdots x_nb\cdots b and byi+1ynbbby_{i+1}\cdots y_nb\cdots b is both accepting and non-accepting.

In both cases we get lead to contradiction. Thus, DFA recognizing LnL_n has at least 2n2^n states.

  • (3): Let n=3n = 3. Then DFA recognizing L3L_3 has no less than 88 states.
  • (4): NFA recognizing LnL_n has exactly n+1n+1 states. Equivalent DFA has 2n2^n states.