Sei sulla pagina 1di 3

Theory of Automata

Assignment 3

Due Date: Tuesday, December 4, 2019 in Class

Problem #1: Give a state diagram of NFA without null transition with specified states of the following
languages:

1. 𝐿1 = {𝑤 ∈ {0,1}∗ | 𝑤 𝑒𝑛𝑑𝑠 𝑤𝑖𝑡ℎ 00} 𝑤𝑖𝑡ℎ 𝑡ℎ𝑟𝑒𝑒 𝑠𝑡𝑎𝑡𝑒𝑠


2. 𝐿2 = {𝑤 ∈ {0,1}∗ | 𝑤 𝑐𝑜𝑛𝑡𝑎𝑖𝑛𝑠 𝑠𝑢𝑏𝑠𝑡𝑟𝑖𝑛𝑔 0101 𝑖. 𝑒. 𝑤 = 𝑥0101𝑦} 𝑤𝑖𝑡ℎ 𝑓𝑖𝑣𝑒 𝑠𝑡𝑎𝑡𝑒𝑠 𝑠𝑡𝑎𝑡𝑒𝑠
3. The set of strings over an alphabet {0, 1, . . . , 9} such that the final digit has appeared before.
4. The set of strings over an alphabet {0, 1, . . . , 9} such that the final digit has not appeared before.
5. The language contains set of words with 0 or more occurrences of ab followed by a or aa or aaa.

Problem #2: Give a state diagram of NFA with null transition with specified states of the following
languages:

6. 𝐿3 = {𝑤 ∈ {0,1}∗ | 𝑤 𝑒𝑛𝑑𝑠 𝑤𝑖𝑡ℎ 00 𝑜𝑟 𝑒𝑛𝑑𝑠 11} 𝑤𝑖𝑡ℎ 𝑓𝑖𝑣𝑒 𝑠𝑡𝑎𝑡𝑒𝑠


7. 𝐿4 = {𝑤 ∈ {0,1}∗ | 𝑤 𝑐𝑜𝑛𝑡𝑎𝑖𝑛𝑠 𝑠𝑢𝑏𝑠𝑡𝑟𝑖𝑛𝑔 00 𝑜𝑟 𝑠𝑢𝑏𝑠𝑡𝑟𝑖𝑛𝑔 11} 𝑤𝑖𝑡ℎ 𝑓𝑖𝑣𝑒 𝑠𝑡𝑎𝑡𝑒𝑠 𝑠𝑡𝑎𝑡𝑒𝑠

Problem #3: Consider following transition tables draw state diagrams:

δ(q, a) δ(q, b)
Start state Q0 {Q0, Q1} Φ
Q1 Φ {Q1, Q2}
Final state Q2 {Q0, Q1} Φ

i. Trace all computations of the string aaabb using extended transition function.
ii. Is aaabb in the above language?

Problem #4: Consider following transition tables draw state diagrams:

δ(q, a) δ(q, b) δ(q, ε)


Start state Q0 {Q1} {Q2} {Q1}
Final state Q1 Φ {Q1, Q3} Φ
Q2 Φ Φ {Q3}
Q3 {Q0,Q3} {Q2} Φ

i. Compute Null Closure for all states.


ii. Trace all computations of the string bbaaabaa using extended transition function.
iii. Is bbaaabaa in the above language?

Problem #5: Consider following transition tables draw state diagrams:

δ(q, a) δ(q, b)
Start state Q0 {Q0, Q1} Φ
Q1 Φ {Q1, Q2}
Final state Q2 {Q0, Q1} Φ

i. Construct the state diagram of a DFA equivalent to NFA of the above problem, using subset
construction algorithm. Give all steps.
ii. Trace the string aaabb using extended transition function for DFA constructed in (i)

Problem #6: Consider following transition tables draw state diagrams:

δ(q, a) δ(q, b) δ(q, ε)


Start state Q0 {Q1} {Q2} {Q1}
Final state Q1 Φ {Q1, Q3} Φ
Q2 Φ Φ {Q3}
Q3 {Q0,Q3} {Q2} Φ

i. Construct the state diagram of a DFA equivalent to NFA with Null transition of the above
problem, using subset construction algorithm. Give all steps.
ii. Trace the string bbaaabaa using extended transition function for DFA constructed in (i)

Problem #7: Consider following transition tables draw state diagrams:


δ(q, a) δ(q, b) δ(q, ε)
Start state q0 Φ Φ {p, t}
P {p} {r} Φ
R {s} Φ Φ
S Φ {s} {w}
T {u} {t} Φ
U Φ {v} Φ
V {v} Φ {w}
Final state w Φ Φ {q0}

i. Trace the string aababba using extended transition function.


ii. Construct the state diagram of a DFA equivalent to NFA with Null transition of the above
problem, using subset construction algorithm. Give all steps.
iii. Trace the string aababba using extended transition function for DFA constructed in (ii).

Potrebbero piacerti anche