0% found this document useful (0 votes)
47 views4 pages

Automata Assignment-1

The document contains 25 questions related to automata theory and compiler design. The questions cover topics like constructing DFAs for various languages, regular expressions, transition systems, derivations, ambiguity, grammar transformations and conversions to Chomsky Normal Form.

Uploaded by

harshitad1272
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)
47 views4 pages

Automata Assignment-1

The document contains 25 questions related to automata theory and compiler design. The questions cover topics like constructing DFAs for various languages, regular expressions, transition systems, derivations, ambiguity, grammar transformations and conversions to Chomsky Normal Form.

Uploaded by

harshitad1272
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/ 4

ASSIGNMENT-I

Course Name: Automata Theory & Compiler Design Course Code: IT3202
1. Construct a DFA with minimum number of states, accepting all strings over {a,
b} such that the number of a’s is divisible by two and the number of b’s is
divisible by three.
2. Draw a DFA which accepts all strings over {a, b} such that no string has three
consecutive occurrences of the letter b.
3. Design a DFA to recognize all strings over {a,b} such that L={awa : w ϵ {a,b}*}.
4. Design a DFA for Σ = {a, b} that can accept all strings with no more than three
a’s.
5. Find DFA for the following languages on Σ = {a, b}:
a. L = {w : |w| mod 3 = 0
b. L = {w : na(w) mod 3 > nb(w) mod 3}
6. Consider the set of strings on {0,1}. Design a DFA to accept all strings where
every 00 is followed immediately by a 1.
7. Suppose Σ = {0, 1, 2}. Draw a DFA for the language L = {w | the sum of digits in
w is divisible by 5}.
8. Draw a DFA for L = {0n1m | m ≥ 1 , n ≥ 0 ; (n + m) is divisible by 3}.
9. Suppose Σ = {a, b}. Find a DFA for the set of strings w such that the number of
occurrences of the substring ab in w equals the number of occurrences of the
substring ba in w.
10. Construct a DFA accepting all strings w over Σ = {0, 1} such that the number of
1’s in w is 3 mod 4.
11. Represent the following sets by regular expression:
a. {12n+1 | n>0
b. {The set of all strings over {0,1} which has at most two zeros.
12. 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
13. 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.
14. Prove the following:
a. (0*1*)* = (0 + 1)*
b. (ab)* ≠ (a*b*)
c. (r + s)* ≠ r* + s*
d. λ + 1*(011)*(1*(011)*)* = (1 + 011)*
15. 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 q2
q1
q2 q3 q2
q3 q1 q2
16. Consider the grammar-

S → bB / aA
A → b / bS / aAA
B → a / aS / bBB

For the string w = bbaababa, find-


1. Leftmost derivation
2. Rightmost derivation
3. Parse Tree
17. Consider the following grammar and eliminate left recursion-
A → ABd / Aa / a
B → Be / b
18. Consider the following grammar and eliminate left recursion-
S→A
A → Ad / Ae / aB / ac
B → bBc / f
19. Do left factoring in the following grammar-
S → aAd / aB
A → a / ab
B → ccd / ddc
20. Check whether the given grammar is ambiguous or not-
S → SS
S→a
S→b
21. Consider the given grammar-
E→E+T/E–T/T
T→TxF/T÷F/F
F→G↑F/G
G → id

Evaluate the following expression in accordance with the given grammar-


2x1+4↑2↑1x1+3
22. Removal of Useless Symbols
T → xxY | xbX | xxT
X → xX
Y → xy | y
Z → xz
23. Remove the ε production from the CFG given below by preserving its meaning.
S → ABA
A → 0A | ε
B → 1B | ε
24. Removing Unit Productions:
S → 0X | 1Y | Z
X → 0S | 00
Y→1|X
Z → 01

25. Convert the given CFG to CNF. Consider the given grammar G:

S → a | aA | B
A → aBB | ε
B → Aa | b

You might also like