Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Assignment 2

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Theory of Automata

Assignment 2
Due Date: Friday, 5th May 2023 in Class
Assignment should be handwritten and also take serious activity to solve the assignment problems.
Leave this habit to cheat.
¿
Problem#1: Find a regular expression corresponding to each of the following subsets of { a , b } .

1. The language of all strings with no a’s containing exactly two a’s.
2. The language of all strings containing at least two a’s.
3. The language of all strings that do not end with ab.
4. The language of all strings that begin or end with aa or bb.
5. The language of all strings not containing the substring aa.
6. The language of all strings in which the number of a’s is even.
7. The language of all strings in which every a is followed immediately by bb.
8. The language of all strings containing both bb and aba as substrings.
9. The language of all strings not containing the substring aaa.
10. The language of all strings not containing the substring bba.
11. The language of all strings containing both bab and aba as substrings.

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

1. L1={ w ∈ {0,1 } ∨w ends with 00 } with three states


¿

2. L2= {w ∈ {0,1 } ∨w contains substring 0101i . e . w=x 0101 y } with five states states
¿

3. The set of strings over an alphabet {0, 1, . . . , 5} such that the final digit has appeared before.
4. The set of strings over an alphabet {0, 1, . . . , 5} 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 #3: Give a state diagram of NFA with null transition with specified states of the following
languages:

1. L3= {w ∈ {0,1 } ∨w ends with 00∨ends 11 } with five states


¿

2. L4 ={w ∈ { 0,1 } ∨w contains substring 00∨substring 11 } with five states states


¿

Problem #4: 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 Computation Tree.


ii. Is aaabb in the above language?

Problem #5: Consider following transition tables:

δ(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 Computation Tree.


ii. Is aababba accepted by the above NFA

You might also like