0% found this document useful (0 votes)
5 views

Module-1 Practice Questions

The document contains a comprehensive set of practice questions related to finite automata, including the design of deterministic and non-deterministic finite automata (DFA and NFA), conversions between different forms, minimization techniques, and the derivation of regular expressions. It also includes tasks for proving certain languages as non-regular using the pumping lemma. The questions cover a wide range of topics, providing a thorough exploration of the concepts in automata theory and formal languages.

Uploaded by

gmanishika
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Module-1 Practice Questions

The document contains a comprehensive set of practice questions related to finite automata, including the design of deterministic and non-deterministic finite automata (DFA and NFA), conversions between different forms, minimization techniques, and the derivation of regular expressions. It also includes tasks for proving certain languages as non-regular using the pumping lemma. The questions cover a wide range of topics, providing a thorough exploration of the concepts in automata theory and formal languages.

Uploaded by

gmanishika
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Module-1 Practice Questions

Design (Construction of Finite Automation for given regular set/language)


1. (a) Construct (Design)a DFA for the following languages over alphabet {0, 1}:
i. L={ww has both an even number of 0’s and even number of 1’s }
ii. L= {ww is in the form of ‘x01y’ for some strings x and y consisting of 0’s and 1’s}
iii. L = set of all strings containing odd number of 0’s and odd number of 1’s.
iv. L = set of all strings containing even number of 1’s.
v. L=set of all strings whose length is divisible by either 3 or 4.
vi. L = set of all strings ending with 101.
vii. L = set of all strings that do not contain 101 as substring.
viii. L = set of strings interpreted as binary numbers would be multiple of 3.
ix. L = set of all strings w such that numbers of 1’s in w is 3 mod 4.
(b) Design DFA for the following languages shown below over Σ ={a, b}:
i. L={ww does not contains the sub strings ab}.
ii. L={ww contains neither the sub strings ab nor ba}.
iii. L={ww is any string that doesn’t contain exactly two a’s }.
(c) Write DFA to accept strings of 0’s, 1’s and 2’s beginning with a 0 followed by odd number
of 1’s and ending with a 2.
(d) Design a NFA for the following
i. L={abaan n> 1 }
ii. L = set of all strings with 2 a’s followed by 2 b’s over { a , b }
iii. L = set of all strings does not contain 3 consecutive 0’s over Σ={0,1}.
(e) Design FA to accept string with ‘a’ and ‘b’ such that the number of a’s are divisible by 3.
(f) Design a FA to accept following languages over Σ={0,1}
i. L = set of strings ending with last two characters are same.
ii. L = set of all strings containing 4 consecutive zeros.
(g) Construct NFA with  which accepts a language consisting the strings of any number of
0’s followed by any number of 1’s followed by any number of 2’s.

Conversion of NFA to DFA and -NFA to DFA

2. (a) Covert the following NFA in Figure 1 to equivalent DFA.

Figure: 1
(b) Construct DFA for given NFA.

Figure: 2

(c) Convert the following NFA with -moves to DFA.

Figure: 3

(d) Convert the following NFA with -moves to DFA.

Figure: 4

Conversion of -NFA to NFA (NFA with -moves to NFA without -moves)


3. (a) Convert the following NFA in Figure 5 with -moves into a NFA without -moves and
show that NFA with- moves accepts the same language.

Figure: 5

(b) Convert the following NFA in Figure 6 with -moves into a NFA without -moves.

Figure: 6
(c) Construct NFA for given NFA with -moves.

Figure: 7

Minimization of Finite Automation

4. (a) Build the DFA with minimum states equivalent to the following DFA:

Figure: 8

(b) Minimize the following DFA:

Figure: 9

(c) Build the DFA with minimum states equivalent to the following DFA:
Figure: 10
(d) Construct the minimum state automaton equivalent to the transition diagram given by Figure
11.

Figure: 11

Conversion of Regular Sets (Regular Languages) to Regular Expressions


5. (i) Find Regular Expression for no 0 or many triples of 0s with no 1 or many 1 in the strings.
(ii) Find Regular Expression for strings of one or many 11 or no 11.
(iii) Find A regular expression for ending with abb.
(iv) Find Regular expression for all strings having 010 or 101.
(v) Find Regular expression for Even Length Strings defined over {a,b}.
(vi) Find Regular Expression for strings having at least one double 0 or double 1.
(vii) Find Regular Expression of starting with 0 and having multiple even 1’s or no 1.
(viii) Find Regular Expression for an odd number of 0’s or an odd number of 1’s in the strings.
(ix) Find Regular Expression (RE) for starting with 0 and ending with 1.
(x) Find RE for ending with b and having zero or multiple sets of aa and bb.
(xi) Find regular expression of the second last symbol is 1.
(xii) Find RE for starting with 1 having zero or multiple even 1’s.
(xiii) Find RE for exactly single 1 many 0’s .
(xiv) Find Regular expression (RE) for the language of all those strings starting with aa and
ending with ba.
(xv) Find Regular expression for the language of all consecutive even length a’s.
(xvi) Find Regular expression for the language of all odd length strings.
(xvii) Find Regular expression for the language of all even length strings but end with aa.
(xviii) Find Regular expression for the language of an odd number of 1’s.
(xix) Find Regular expression for the language of even length strings starting with a and
ending with b.
(xx) Find the Regular expression for the language of all even length strings but starts with a.
(xxi) Find Regular Expression for the Language of all strings with an even number of 0’s or even
number of 1’s.
(xxii) Find Regular expression of strings containing exactly three consecutive 1’s.
(xxiii) Find Regular Expression of all strings whose length is divisible by 4.
(xxiv) Find Regular Expression Strings does not contain substring 110.
(xxv) Find a regular expression corresponding to each of the following subsets of {a. b}.
(a) The set of all strings containing exactly 2 a' s.
(b) The set of all strings containing at least 2 a' s.
(c) The set of all strings containing at most 2 a' s.
(d) The set of all strings containing the substring aa.
(xxvi) Find a regular expression consisting of all strings over {a, b} starting with any number of
a's, followed by one or more b's, followed by one or more a's, followed by a single b,
followed by any number of a's, followed by b and ending in any string of a's and b's.
(xxvii) Find the regular expression representing the set of all strings of the form
(a) ambncp where m, n, p ≥ 1
(b) amb2nc3p where m, n, p ≥ 1
(c) anba2mb2 where m ≥ 0, n ≥ 1
(xxviii) Represent the following sets by regular expressions:
(a) {0, 1, 2}.
(b) {12n+1 | n > 0}.
(c) {w  {a, b}* | w has only one a}.
(d) The set of all strings over {0, 1} which has at most two zeros.
(e) {a2, a5, a8, ... }.
(f) {an | n is divisible by 2 or 3 or n = 5}.
(g) The set of all strings over {a, b} beginning and ending with a.
(xxix) 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.

Conversion of Regular Expressions to Regular Sets (Regular Languages)


6. Find the sets represented by the following regular expressions.
(a) (a + b)(aa + bb + ab + ba)*
(b) (aa)* + (aaa)*
(c) (1 + 01 + 001)*(1\ + 0 + 00)
(d) a + b(a + b)*

7. Find all strings of length 5 or less in the regular set represented by the following regular
expressions:
(a) (ab + a)*(aa + b)
(b) (a*b + b*a)*a
(c) a* + (ab + a)*

8. Describe, in the English language, the sets represented by the following regular expressions:
(a) a(a + b)*ab
(b) a*b + b*a
(c) (aa + b)*(bb + a)*

Simplification of Regular Expressions


9. (a) Giye a RE. for representing the set L of strings in which every 0 is immediately followed
by at least two 1’s.
(b) Prove that the regular expression R = ε + 1*(011)*(1* (011)*)* also describes the same set
of strings.
10. Prove (1 + 00*1) + (1 + 00*1)(0 + 10*1)* (0 + 10*1) = 0*1(0 + 10*1)*.
11. Prove that P + PQ*Q =a*bQ* where P = b + aa*b and Q is any regular expression.

Conversion of Regular Expressions to Finite Automata


12. (a) Construct FA for the following regular expressions
i. 0+10* +01*0
ii. (0+1)*(01+110)
(b) Construct Finite Automata for the regular expression 0*1*(101)*11.
(c) Convert the following regular expressions to NFA with epsilon transitions
i. 0*+1101 ii. (0+1)*
(d) Explain the procedure for the conversion of DFA into regular expression like
(10)*110(10)* over an alphabet {0, 1}.
(e) Define DFA and Regular expression. Find a DFA that accepts all strings
corresponding to the expression 1*01(0+11)*. Also explain how to convert a regular
expression to DFA.
(f) Construct a DFA accepting language represented by 0*1*2*.
(g) Design a FA for the following languages:
i. (0*1*)* ii. (0 + 1)*111* iii. 0*11* + 101

Conversion of Finite Automata to Regular Expressions


13. (a) Derive the regular expression from the following automata:
Figure: 12
(b) Convert the following FA to regular expression:

Figure: 13
(c) Convert the following Finite Automata to it’s equivalent Regular Expression.

Figure: 14

Proving the given language L as not regular using Pumping lemma


14. Using pumping lemma Prove that the following languages are not regular.
(a) 𝐿 = 𝑎 | 𝑘 ≥ 1
(b) 𝐿 = 𝑎 | 𝑘 ≥ 1
(c) 𝐿 = {𝑎 | 𝑝 is prime}
(d) 𝐿 = {𝑎 ! | 𝑛 ≥ 1}
(e) 𝐿 = {0 1 | 𝑘 ≥ 1}
(f) L = {ww | w  {a, b}*}

You might also like