0% found this document useful (0 votes)
102 views5 pages

Automata Theory Assignments

Uploaded by

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

Automata Theory Assignments

Uploaded by

Demigod DK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

ASSIGNMENT -01

Course Name: Automata Theory & Compiler Design Course Code: CS3103

1 Let Σ = {a, b} and let L = { w ∈ Σ* | w is a nonempty string whose characters alternate


between a's and b's }. Design a DFA whose language is L.

2 Design a DFA that reads strings of 0’s and 1’s and recognizes modulo 4 as based on the
number of 1’s in the string.

3 Consider the transition diagram of an DFA as given below:

i) Which should be the final state(s) of the DFA if it should accept strings starting with
‘a’ and ending with ‘b’?

q0 q1 q0, q1 q3

ii) Which of the following strings will be accepted if 𝑞0 and 𝑞1 are accepting states?
a) ababab
b) babaaa
c) aaaba

a), b) b), c) a), c) None

iii) Which of the following represents the set of accepting states if the language to be
accepted contains strings having the same starting and ending symbols?
a) {𝑞0} b) {𝑞0, 𝑞3} c) {𝑞3} d) {𝑞3, 𝑞1}
4 Construct a DFA with minimum number of states, accepting all strings over {a, b} such that
the number of a’s is divisible by three and the number of b’s is divisible by two.

5 Let Σ = {a, b, c} and let L = { w ∈ Σ* | some character in Σ appears at most twice in w }.


Design an NFA for L.

6 Draw NFA with specified number of states to accept the following languages and then
convert them to DFA.
a) All strings that contain the substring 0101 (using 5 states).
b) All strings such that the third symbol from the right end is a ‘a’ (using 4 states).

7 Design a Moore machine to accept language L={anbm|m,n>=1} and produce output in a


manner such that first a produces output 0 followed by 1 for additional a’s followed by 1 for
first b followed by 0’s for additional b’s.
Input: aaa….aabb….bb
Output: 011…1110…00

8 Design a Mealy machine that accepts all strings over {0,1} and produces incremented output.

9 Construct a minimized DFA for the following:

10 Design a minimal DFA that accepts all strings over the alphabet ∑ = {a, b}, where every
accepted string ‘w’ starts with substring s
i) s = b ii) s = ab iii) s = abb

11 Construct a minimized deterministic finite automaton that accepts a regular language L =


{w1aw2 | w1, w2 ∈ {a, b}*, |w1| = 2, |w2|>=3}.
12
Identify the number of states in a minimum state deterministic finite automaton accepting the
language L={w | w ε {0,1} *, number of 0s and 1s in w are divisible by 3 and 5, respectively}

13 Deterministic automata of a language over alphabets {0, 1}, which does not contain 3
consecutive 0’s. Minimum how many states, DFA will have and how many of them will final
states?

14 Consider the languages L1 and L2 described as:


L1={anbm|n>=0,m>0} and L2={w|wε(a,b)*, string either starts with ‘a‘or ‘b’}
Design the Finite automata for the following:
i. L=L1.L2
ii. L=L1’
iii. L=L2’
iv. L=L1+L2

15 Represent the following sets by regular expression:

b. {12n+1 | n>0
c. {The set of all strings over {0,1} which has at most two zeros.

d. {an | n is divisible by 2 or 3 or n=5}.


e. The set of all strings over {a, b} beginning and ending with a.

16 Construct a transition system corresponding to the following regular expressions


a) (ab + c*)*b.abc*
b) (a + bb) . ba*b
c) (ab + a)*(aa + b)
d) (a*b + b*a)*a

17 Find the regular expressions representing the following sets:


a. The set of all strings over {0,1} having at most one pair of 0’s or at most one
pair of 1’s.
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 b’s.
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.

18 Construct R.E. using Arden’s theorem from the following FA’s:


a)
a B
→q1 q1 q2
*q2 q3 q2
q3 φ φ
b)
0 1
→*q1 q1 q2
q2 q3 q2
q3 q1 q2

c)
0 1
→*q1 q1 q2
→*q2 q3 q2
q3 q3 q3

d)
a b
→q1 q3 q2
q2 q2 q2
*q3 q3 q3

19 Given L1={an|n>=0} and L2={bn|n>=0}, check for the following:


a) L1.L2 is regular
b) L1.L2={anbn|n>=0}
20 Use pumping lemma to prove the following language is regular or not.
L = {anbn | n ∈ N, n ≥ 0}.
L = {anbk | n,k ∈ N, n > k ≥ 0}.
L = {anbn+3 | n ∈ N, n ≥ 0}.
L = {(an)2 | n ∈ N, n > 1}.

You might also like