Sie sind auf Seite 1von 3

MANIPAL UNIVERSITY JAIPUR

DEPARTMENT OF CSE
ASSIGNMENT NO - 4
FORMAL LANGUAGE & AUTOMATA THEORY
Q.1. Represent the following sets by regular expression:
a. {1 2n+1 | n>0}
b. {The set of all strings over {0,1} which has at most two zeros.
c. {an | n is divisible by 2 or 3 or n=5}.
d. The set of all strings over {a,b} beginning and ending with a.
Q.2. Construct a transition system corresponding to the following regular expressions:
a. (ab + c*)*b

b. a + bb + bab*a

c. (ab + a)*(aa + b)

d. (a*b + b*a)*a

Q.3. Find the regular expressions representing the following sets:


a. The set of all strings over {0,1} having at most one pair of 0s or at most one pair of 1s.
b. The set of all strings over {a,b} in which the number of occurrences of a is divisible by 3.
c. The set of all strings over {a,b} in which there are at least two occurrences of b between any
two occurrences of a.
d. The set of all strings over {a,b} with three consecutive bs.
e. The set of all strings over {0,1} beginning with 00.
f. The set of all strings over {0,1} ending with 00 and beginning with 1.
Q.4. Prove the following:
a. Ardens theorem
b. (0*1*)* = (0 + 1)*
c. (ab)* (a*b*)
d. (r + s)* r* + s*
e. + 1*(011)*(1*(011)*)* = (1 + 011)*

Satyabrata Roy

Q.5. Construct R.E. using Ardens theorem from the following FAs:
a.
q1
*q2
q3

a
q1
q3

B
q2
q2

* q1
q2
q3

0
q1
q3
q1

1
q2
q2
q2

*q1
*q2
q3

0
q1
q3
q3

1
q2
q2
q3

*q1
q2
q3
q4

0
q2
q4
q1
q4

1
q3
q1
q4
q4

*q1

0
q1

1
q1

q1
q2
*q3

a
q3
q2
q3

b
q2
q2
q3

b.

c.

d.

e.

f.

Satyabrata Roy

g.
q1
*q2

0
q2
q1

1
q2
q1

q0
q1
*q2

0
q1

q1

1
q1

q1

h.

Satyabrata Roy

Das könnte Ihnen auch gefallen