東京大学 情報理工学系研究科 コンピュータ科学専攻 2019年8月実施 専門科目I 問題1
Author
Description
Let Σ be a finite alphabet (i.e., a finite set of letters), and ϵ be the empty sequence. We define the shuffle w1⊗w2⊆Σ∗ of two words w1,w2∈Σ∗ as follows.
- For every w∈Σ∗,
ϵ⊗w=w⊗ϵ={w}.
- For every a,b∈Σ and w1,w2∈Σ∗,
(aw1)⊗(bw2)={aw∣w∈w1⊗(bw2)}∪{bw∣w∈(aw1)⊗w2}.
Furthermore, for two languages L1,L2⊆Σ∗, their shuffle L1⊗L2⊆Σ∗ is defined by:
L1⊗L2=w1∈L1,w2∈L2⋃w1⊗w2.
For example, we have:
{ab,ba}⊗{ϵ,c}=(ab⊗ϵ)∪(ab⊗c)∪(ba⊗ϵ)∪(ba⊗c)={ab,cab,acb,abc,ba,cba,bca,bac}.
Answer the following questions.
(1) Compute {a,bb}⊗{ab,cc}.
(2) Suppose that deterministic finite automata A1=(Q1,Σ,δ1,q1,0,F1) and A2=(Q2,Σ,δ2,q2,0,F2) accept languages L1 and L2, respectively. Here, Qi,δi,qi,0, and Fi are respectively the set of states, the transition function, the initial state, and the set of final states of Ai (i∈{1,2}). You may assume that the transition functions δi∈Qi×Σ→Qi (i∈{1,2}) are total functions. Give a non-deterministic automaton that accepts L1⊗L2.
(3) Prove the correctness of your answer for question (2) above.
(4) Let L3={anbn∣n≥0} and L4={cmdm∣m≥0}. Prove that L3⊗L4 is not a context-free language. Here, you may use the pumping lemma for context-free languages.
题目描述
设 Σ 为有限字母表,ε 为空串。对
w1,w2∈Σ∗,递归定义它们的洗牌(shuffle)
w1⊗w2⊆Σ∗:
ε⊗w=w⊗ε={w},
且对 a,b∈Σ、w1,w2∈Σ∗,
(aw1)⊗(bw2)={aw∣w∈w1⊗(bw2)}∪{bw∣w∈(aw1)⊗w2}.
对语言 L1,L2⊆Σ∗,定义
L1⊗L2=w1∈L1, w2∈L2⋃w1⊗w2.
例如
{ab,ba}⊗{ε,c}={ab,cab,acb,abc,ba,cba,bca,bac}.
回答下列问题。
(1)计算 {a,bb}⊗{ab,cc}。
(2)设 DFA
Ai=(Qi,Σ,δi,qi,0,Fi) 分别识别语言
Li (i=1,2),并假定两个转移函数均为全函数。构造一个识别
L1⊗L2 的 NFA。
(3)证明第(2)问构造的正确性。
(4)令
L3={anbn∣n≥0}、
L4={cmdm∣m≥0}。证明
L3⊗L4 不是上下文无关语言。可以使用上下文无关语言泵引理。
Kai