Assignment 2
Assignment 2
Assignment 2
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:
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:
δ(q, a) δ(q, b)
Start state Q0 {Q0, Q1} Φ
Q1 Φ {Q1, Q2}
Final state Q2 {Q0, Q1} Φ