• ↑↓ pour naviguer
  • pour ouvrir
  • pour sélectionner
  • ⌘ ⌥ ↵ pour ouvrir dans un panneau
  • esc pour rejeter
⌘ '
raccourcis clavier

question 1.

a

If L1L_{1} is regular and L1=k|L_{1}| = k and L2L_{2} is non-regular, then L1L2L_{1} \cap L_{2} is regular

True\boxed{\text{True}}

L1L2=L3L_{1} \cap L_{2} = L_{3} implies L3L1L_{3} \subseteq L_{1} (intersection)

Given that L1=k|L_{1}| = k, meaning there is a fixed number of string in L1L_{1} ,therefore L1L_{1} is finite. Given that all finite language are regular, L1L2L_{1} \cap L_{2} will contain at-most kk-string, making L3L_{3} regular

b

If L1L_{1} is regular and L2L_{2} is non-regular, then L1L2L_{1} \cup L_{2} is regular

False\boxed{\text{False}}

If L1={ab}L_{1} = \{ ab \} where it only accepts the string abab, and L2={anbnn0}L_{2} = \{ a^n b^n | n \geq 0 \}, then L1L2={anbnn0}L_{1} \cup L_{2} = \{ a^n b^n | n \geq 0 \}, which is non-regular

c

L1\forall L_{1} such that L1L_{1} is a non-regular language, L2\exists L_{2} such that L2L_{2} is regular and L1L2L_{1} \subseteq L_{2}

True\boxed{\text{True}}

For all non-regular languages L1L_{1}, they can be seen as a subset of Σ\Sigma^{*}. Given that Σ\Sigma^{*} is regular (a DFA with one accepting state), this means the aforementioned statement holds.

question 2.

a

MM accepts all strings which begin with bb but do not contain the substring babbab

b

L(M)={aibjcki+j+k is a multiple of 3},Σ={a,b,c}\mathcal{L}(M) = \{ a^i b^j c^k | i + j + k \text{ is a multiple of 3} \}, \Sigma = \{ a,b,c \}

c

L(M)={x There are at least two a’s in the last three characters of x}\mathcal{L}(M) = \{ x | \text{ There are at least two a's in the last three characters of } x \}

question 3.

Via production construction, create a DFA MM such that

L(M)={anbmn or m is a multiple of 3}\mathcal{L}(M) = \{ a^n b^m | \text{n or m is a multiple of 3} \}

M1M_{1}:

M2M_{2}:

stateabdangling
0a1a3b
0b1e3c
0c1e3d
0d1e3b
0e1e3e
1a2a4b
1b2e4c
1c2e4d
1d2e4d
1e2e4e
2a0a4b
2b0e4c
2c0e4d
2d0e4b
2e0e4e
3a4a3b
3b4e3c
3c4e3d
3d4e3b
3e4e3e
4a4a4b
4b4e4c
4c4e4d
4d4e4b
4e4e4e

table 1: product construction of L(M)={anbmn or m is a multiple of 3}\mathcal{L}(M) = \{ a^n b^m | \text{n or m is a multiple of 3} \}

note: the state that are not used will be crossed out

question 4.

Question

NFA which accepts all string in which the third last character is an a. Then via subset construction create an equivalent DFA

NFA\boxed{\text{NFA}}

stateabnote
0010
122not connected in DFA
233not connected in DFA
3\emptyset\emptysetnot connected in DFA
0101202
0201303
03010
122323not connected in DFA
1322not connected in DFA
2333not connected in DFA
0120123023
01301202
02301303
1232323not connected in DFA
01230123023

table 2: subset construction for given NFA

DFA\boxed{\text{DFA}}

question 5.

Question

Create a sound argument that the concatenation of two regular languages is also regular. Specifically, if L1L_{1} and L2L_{2} are regular then L1L2L_{1} L_{2} is also regular. This does not need to be a formal proof, but the argument should be very convincing.

Hint: if L1L_{1} and L2L_{2} are regular you can make “machines” for them; how would you make a “machine” for L1L2L_{1} L_{2}.

Given L1L_{1} and L2L_{2} are both regular languages, there exists and DFA M1M_{1} and M2M_{2} that recgonize L1L_{1} and L2L_{2} respectively

Let M1=(Q1,Σ,δ1,q01,F1)M_{1} = (Q_{1}, \Sigma, \delta_1, q_{01}, F_{1}) and M2=(Q2,Σ,δ2,q02,F2)M_{2} = (Q_{2}, \Sigma, \delta_2, q_{02}, F_{2})

We can try to construct a NFA NN to recognize L1L2L_{1} L_{2}, where we combine both states of M1M_{1} and M2M_{2} via product construction, then we add ϵ\epsilon-transition from every accepting state in F1F_{1} to start state q02q_{02} of M2M_{2}

Conceptually, for a string wL1L2w \in L_{1} L_{2}, split w=uv,uL1,vL2w = uv, u \in L_{1}, v \in L_{2}

  • If NN process uu in M1M_{1}, reach accept states F1F_{1}, then ϵ\epsilon transition to q02q_{02}, then process vv in M2M_{2}, ending in F2F_{2}
  • if no valid splits, then it rejects the string
  • for empty string: if ϵL1\epsilon \in L_{1} then it can transition to M2M_{2}, and vice versa.

Given that regular language are also closed under NFAs, if we can build a NFA which proves that L1L2L_{1} L_{2} is regular

q.e.d\boxed{\text{q.e.d}}