Anda di halaman 1dari 14

Theory on FA

1) Give the difference between NFA and DFA.


2) Define the following terms with example
1) Symbol 2) Alphabet3) DFA 4) NFA5) Word.
3) What are the properties and limitations of Finite State Machine ?

[4]
[10]
[6]

4) Define and explain :


[ 8]
i) Language ii) Cartesian Product iii) Regular Expression iv) Kleene Closure.

5) Define the following with examples:


[8]
Kleen closure An alphabet Regular expression Formal language
6) Show by principle of mathematical induction that n4 4n2 is divisible by 3 for all n
0.
[6]
Examples on FA

1) Design a Finite Atomata FA which accepts odd number of 0S and even number of 1s
2) Design a finite automata which accepts even number of 0s and odd number of 1s.
3) Design a DFA which accepts the odd number 1s and any number of 0s over = {0, 1}.
4) Design a finite automata that reads strings made up of letters in the Word
CHARIOT and recognize those strings that contain the word CAT as a substring. [8]
5) Design FA that reads strings made up of = {0,1} and accepts only those strings
which ends with 00 or by 11.
[6]
6) Design a FSM to concept those strings having 101 or 110 as substring.
[4]
7) Design a DFA for a language of strings of 0s and 1s such that [10]
i) Substring is 10. ii)Strings ending with 101.
8) Design an FSM for divisibility by 3 tester for a binary number.
[6]
9) Design a Finite State Machine for divisibility by 5 tester of a given decimal number. [8]
10) Design a FSM for divisibility tester of urinary number by 2.
[8]
11) Design an FSM for divisibility by 3 tester for a unary number.
[6]
12) Obtain a DFA to accept strings of as and bs such that L = {W/W (a + b)* such that Na(W) mod 3 = 0 and Nb(W) mod 2 = 0}
[10]
13) Construct a NFA that accept any positive number of occurrences of various strings
from the following language L given by L = { x {a, b} | x ends with aab).
[6]
14) Construct the NFA for the language of all strings that begin and end with same symbol
over the alphabet = {0, 1} .
[4]

15) Design an NFA to accept set of all strings which end with 00. Where
I = {0, 1}. Convert this NFA into its equivalent DFA.

[8]

16) Construct a NFA that accept any positive number of occurrences of various strings from
the following language L given by L ={x{a,b}x ends with aab) .
[ 6]
17) Construct a NFA and then equivalent DFA accepting strings over {0, 1}, whose every
block of 4 consecutive symbol, contain at least 3 zeroes (i.e. 0s)
[10]

18) Construct a NFA that accept the set of strings in (0+1)* such that some two 0s are
separated by string whose length is 4i, for some i>=0.
[6]
19) Design NFA which accepts the string containing either 01 or 10
[6]

RE to FA
1) Construct a DFA for the regular expression (a+b)*(baaa)
[6]
2) Describe in English language accepted by R.E. (0+1)* 0
[2]
3) Construct DFA for the following regular expression RE = (a+b)* abb. [6]
4) For each of the following regular expression, draw an Finite Automata recognizing
the corresponding language
[10]
1) (1 + 10 + 110) *0
2) 1 (01 + 10)* + 0(11+10)*
3) (010 + 00)* (10)
4) 1 (1+10)* + 10(0+01)*
5) Construct NFA for the following regular expression. (0 + (0 + 1)*)+
[6]
6) Construct a DFA with reduced states equivalent to the regular expression
10 +(0+11)0*1.
[10]
7) Construct NFA from the following regular expressions :

[8]

i) 0*1*2*
ii) (00 + )* (10)*.
8) Construct DFA for following regular expression RE = b (a + b)* a .
[6]
9) Construct DFA for following regular expression RE = (a + b) * a b b.
[6]
10) For the following regular expression, draw an FA recognizing the corresponding
language. r = (1+10)* 0
[6]
11) Design an NFA equivalent to following RE[6]
(0 + 1)*(00 + 11) (0 + 1)*
12) For each of the following regular expression, draw an Finite Automata recognizing
the corresponding language.
[10]
1) (10 + 1 + 110)*1
2) 1 (10 + 01)* + 0 (10 + 11)*
3) (010 + 100)* (10)
4) 1 (1 + 10)* + 10 (0 + 01)*

13) Construct the finite automata equivalent to the following regular set and describe in
English set denoted by following regular set
[8]
1) 10 + (0 + 11) 0* 1
2) 01 [((10)* + 111)* + 0]* 1
14) Describe in simple english the language defined by following RE:
[4]
i) (a+b)* aa (a+b)** ii) (b+ba)*
iii) a (a+b)*b
iv) a+b*c+

Language to RE
1) Find all possible regular expression ever L C {0,1}*
i) The set & all possible string containing 01.
ii) The set of all string that do not end with 01.
2) Find a RE corresponding to each of the following subsets of {0, 1}*.
[6]
1) The language of all strings containing exactly two 0s.
2) The language of all strings containing atleast two 0s.
3) The language of all strings not containing the substring 00.
3) Give RE for the following languages over ={0,1}. [6]
i) Strings containing even number of 1s followed by odd number of 0s.
ii) Strings that do not contain three consecutive 0s.
iii) Strings that contain at most three 0s.

[4]

4) Find the regular expression corresponding to each of the following subset of {0, 1}*
a) The language of all strings not containing the substring 000
b) The language of all strings that do not contain then substring 110
c) The language of all strings containing both 101 and 010 as substring. [10]

5) Write the regular expressions for :


[8]
i) = {a,b,c} the language containing strings, such that each string has any
number of as followed by any number of cs.
ii) = {0,1,2}, and language set L(r) = {0,2,01,21,011,211,0111,...}
iii) = {0,1} and language set L(r) = {00,010,0110,01110,....}
iv) Language defined over = {a,b} has to have the strings beginning with a and
not to have two consecutive as
v) = {a,b} such that each of string do not have aa or bb as a substring in it.
vi) = {0,1) the language such that it contains strings with even number of 0s.
6) Consider the two regular expressions
r = 0* + 1* S = 01* + 10* + 1*0 + (0* 1)*
1) Find a string corresponding to s but not to r.
2) Find a string corresponding to both r and s.
3) Find a string in {0, 1}* corresponding to neither r nor s.
[6]
7) Find the regular expressions representing the following sets :
[6]
i) The set of all strings over {a, b} with three consecutive bs.
ii) The set of all strings over {0,1} beginning with 00.
iii) The set of all strings over {0,1} ending with 00 and beginning with 1.
8) Let R = {(1, 2), (2, 3), (1, 4), (4, 2), (3, 4)} Find R+, R*.
[4]
9) Find all strings of length 5 or less in the regular set represented by the following i) (ab + a)* (aa + b)
[6]
ii) (a*b + b*a)*a
iii) a* + (ab + a)*

Show that (Prove that)


1) Prove the following :
(1+00*1) + (1+00*1) (0+10*1)* (0+10*1) = 0*1(0+10*1)*.
[4]
2) Show that [6]
+
i) R*R = R
ii) (P + Q)* = (P*Q*)*
iii) (R*)* = R*
3) Prove or disprove the following for regular expression r1s and t.
1) (rs + r) * r = r (sr + r)* 2) (r + s) * = r* + s*
4) Prove :
[4]
a) * =
b) (r*s*) = (r+s)*.
5) Let L be a language. It is clear from the definition that L + L *. Under what circumstances
are they equal ?
[4]
6) Prove that for any , * = **
[4]

Properties and Application of RE


1) State and explain in detail the closure properties of regular sets
[8]
2) State with brief explanation FSM properties and limitations.
[6]
3) Explain your answer in each of the following :
[6]
1) Every subset of a regular language is regular
2) Every regular language has a regular proper subset.
4) With suitable example, prove the following theorem :
[10]
The regular sets are closed under union, concatenation, and kleene closure.
5) Explain your answer in each of the following :
[6]
1. Every subset of a regular language is regular
2) Every regular language has a regular proper subset.
6) With suitable example, prove the following theorem The regular sets are closed under
union, concatenation, and kleene closure.
[8]
7) Let L be any subset of 0*. Prove that L* is regular.
[4]
8) Explain the use of regular expressions in unix with any one example.
[4]
9) Write a regular expression to identify valid decimal integer constant for C language. Justify
RE with example.
[4]
10) Write a regular expression to search dat (.dat) file(s) having starting character
p and ending with zw. Justify RE with example(s).
[4]
11) Explain the application of RE in lexical analysis phase of compiler
[6]

Pumping Lemma
1) State and explain Pumping Lemma for regular sets.
2) Find out whether given languages are regular or not
a) L = {ww|w{0,1}*}
b) L = {1k | k = n2 ,n > =1} .
c) L = {xy/x, y {0, 1} * and y is x}.
3) Show whether the language L = {0n 12n | n>0} is regular or not.
4) Let L = {0n | n is prime} show that L is not regular.
5) Show that the set L ={ai 2| i 1} is not regular.

[6]

[8]
[6]
[6]
[6]

Find the Language


1) Express the language accepted by following Transition Graph in the form of
regular expressions. 6

2) A transition table is given for another NFA with NULL with seven state. 6

a) Draw a transition diagram b) Calculate *(1,ba).


3) Consider the following F A

Answer the following questions :


i) What is the max length of string accepted by this F A ?
ii) What are the words accepted by this F A ?

[4]

FA to DFA
1) Show stepwise process of constructing DFA equivalent to the NFA :

[6]

2) Construct DFA equivalent to NFA ({p, q, r, s}, { , 1}, , p, {q, s})

[6]

3) Construct DFA equivalent to NFA ({p, q, r, s}, { , 1}, , p, {s}).

[6]

4) Convert the following NFA to its equivalent DFA.

[8]

5) The transition table of a NFA M is given below. construct a DFA equivalent


to M. is

[8]

6) Convert the following NFA into equivalent DFA


M =({ q0 , q1}, { 0,1 },, q 0, { q1 }) where
(q0 , 0) = {q0 , q1 }, (q0 ,1) = {q1}, (q0 , 0) = , =(q ,1) {q0 , q1 }

[6]

7) Construct an equivalent DFA fer given NFA m={q,p,r,s,t}, {0,1}, ,p, {t}
where is defined in the following table.

[10]

NFA with moves to NFA without moves


1) Construct NFA without moves for the following NFA with moves.

[6]

2) Consider the following NFA with -transitions. Convert this NFA to NFA
without -moves :

[8]

3) Consider the following NFA with E-transitions. Convert this NFA to


1) NFA without -moves 2) DFA

[10]

4) Convert the following NFA- to its equivalent DFA.

[8]

5) Convert the given NFA to an NFA.

[6]

Equivalence of two FA's


1) Find out whether M1 and M2 are equivalent.

[6]

2) Find out whether M1 and M2 are equivalent.

[6]

3) Convert the following automata given in fig. (i) and fig. (ii) to equivalent regular
expression.
[10]

FA to RE (Ardens theorem. )
1) Construct regular expression for following transition diagram :

[6]

2) Construct regular expression for following transition diagram.

[6]

3) Obtain regular expression for the following FA.

[8]

4) Consider the following transition diagram and convert it to its equivalent regular
expression using Ardens theorem. Consider the transition diagram given below. Prove
that the strings recognized are : (a + a (b + a a)*b)*a (b + a a)*a.
[6]

5) Consider the following transition diagram. Convert it to the equivalent regular


expression

6) Construct a regular expression corresponding to the state diagram given below : [6]

7) Consider the following transition diagram convert it to equivalent regular


expression using Ardens theorem.

[10]

8) Prove that the FA whose transition graph is as shown below accepts


[8]
The set of all strings over the alphabet {0,1} with an equal number Of 0s and 1s, such
that each prefix has atmost one more 0 than 1s And atmost one more 1 than 0s.

Examples on Moore Machine


1) Design a Moore machine that will read sequences made up of the letters A, E, I, O, U
and will give as output the same sequence except in case where I directly follows an E,
I will be changed to U.
[8]
2) Explain Moore machine and Mealy machine with suitable example. How do
we construct equivalent Mealy machine for given Moore machine ?
[4]
3) Give the Mealy and Moore machine for the following processes.
[8]
For input from (0 + 1)*, if inputs ends in 101, output X; if input ends in 110, output Y,
otherwise output Z
4) Design a Moore machine to generate 1s compliment of the given binary number. [4]
5) Design a Moore machine which will recognize the language of all words of the form
(a+b)* aa(a+b)*. Let the machine display A for acceptance and R for rejection of
words.
6) Design a Moore and Mealy machine to generate 1s complement of a given binary
number.
Examples on Mealy Machine
1) Design a mealy machine fer binary input sequence such that if sequence ends with
100, the output is 1 otherwise output is 0.
[6]
2) Design a Mealy Machine to find out 2s complement of a given binary number. [6]
3) Design a Mealy machine that accepts strings ending in 00 and 11. Convert the
Mealy machine to the equivalent Moore machine.
4) Give the Mealy and Moore machine for the following processes. For input from
(0+1)*, if inputs ends in 101, output X; if input ends in 110, output Y, otherwise output
Z.
Mealy to Moore
1) Consider the following Mealy machine, construct a Moore machine equivalent to it. [4]

2) Convert the following mealy machine into equivalent Moore machine.

[10]

3) Convert the following Mealy machine to its equivalent Moore machine -[6]

4) Convert the following Mealy machine to Moore machine and what is the output of
this mealy machine ? [6]

5) State true or false


i) Moore machine can have arbitrary number of final states.
ii) Mealy machine can have arbitrary number of start states.
6) Give the difference between Mealy machine and Moore machine.
7) Define the following terms with example.
1) Basic machine 2) Moore Machine 3)Mealy machine

[2]
[4]
[6]

Moore to Mealy

1) Construct a Moore Machine equivalent to the Mealy Machine M given below.


is
[6]

2) Convert the following Moore machine to Mealy machine.

[6]

Anda mungkin juga menyukai