Vous êtes sur la page 1sur 4

MID 1 - Assignment

Theory of Automata - CS 301

1. Write regular expressions for the following languages. The alphabet is {0,1}*
a) A = {w|w contain atleast 2 0s}

b) A = {w|w contain an even number of 0s}


2. Consider the following -NFA

a) Convert this -NFA into an equivalent dfa.


b) What language is recognized by your DFA? Your answer may be either a regular
expression or an explicit description of the set.
c) Give a DFA with two states that recognizes the same language.
3. Find a regular expression for the language recognized by below machine using state
elimination method

4.
1

a) Give a regular expression corresponding to the NFA:

5. Let = {0,1,2}. Write a regular expression to accept all strings over *, such that third
symbol from right is 1 or 2 but not 0
6. Convert the regular expression 01* + (0+1)* into an -NFA

7. Consider the - NFA defined below:

a) Compute the - Closure of each state


b) Convert the automaton to DFA

8. Minimize below DFA


a

-->q0

q5

q1

q1

q2

q6

* q2

q2

q0

q3

q6

q2

q4

q5

q7

q5

q6

q2

q6

q4

q6

q7

q2

q6

9. Design a DFA for the language L = {w | w contain 2 as at any position and greater than
3 bs at any position, w {a.b}*}
10.

Design a DFA for the language L = {ab5 w b4 , w {a.b}*}

11.

Convert following -NFA to NFA without transition

12.

q0

q0

q1

q1

q2

q2

* q2

q2

Convert following nfa to dfa


a

q0

q0,q1

q0

q1

q2

q1

q2

q3

q3

* q3

q2

13.

Design an nfa for language L = {ab U aba}*

14.

Write regular expression for the language L = {anbm, n>=4, m <=3}

15.

Write regular expression for the language L = {anbm,(n+m) is even}

16.

Write regular expression for the language L = {abmw, n >=3 w{a,b}* }

17.

Write regular expression for the language L = { w: |w|mod3=0, w{a,b}*}

18.
Write regular expression for the language L = {w | number of as in string is
multiple of 3 => na(w) mod 3 = 0, w{a,b}*}
19.

Given regular expression a.(a+b)*.b.b convert it into -nfa

20.

Write formal definitions for following terms

a) DFA
b) NFA

c) -NFA

d) transition function for DFA


e) transition function for NFA

Vous aimerez peut-être aussi