0% found this document useful (0 votes)
106 views2 pages

Assignment 2

This document contains an assignment on theory of automata due on May 5th. It includes 5 problems: 1) Finding regular expressions for languages over the alphabet {a,b}. 2) Drawing NFA state diagrams without epsilon transitions for specified languages. 3) Drawing NFA state diagrams with epsilon transitions for specified languages. 4) Analyzing an NFA with a given transition table to determine if a string is accepted. 5) Analyzing another NFA with a given transition table to determine if a string is accepted.

Uploaded by

Muhammad Ans
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views2 pages

Assignment 2

This document contains an assignment on theory of automata due on May 5th. It includes 5 problems: 1) Finding regular expressions for languages over the alphabet {a,b}. 2) Drawing NFA state diagrams without epsilon transitions for specified languages. 3) Drawing NFA state diagrams with epsilon transitions for specified languages. 4) Analyzing an NFA with a given transition table to determine if a string is accepted. 5) Analyzing another NFA with a given transition table to determine if a string is accepted.

Uploaded by

Muhammad Ans
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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