0% found this document useful (0 votes)
78 views30 pages

Unit 1

The document contains a series of questions related to finite automata, including the construction of DFAs and NFAs, the properties of regular languages, and specific automaton design tasks. It covers topics such as regular expressions, epsilon transitions, and state minimization. Additionally, it includes practical scenarios for constructing automata for specific input conditions and string patterns.

Uploaded by

dhinagar
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)
78 views30 pages

Unit 1

The document contains a series of questions related to finite automata, including the construction of DFAs and NFAs, the properties of regular languages, and specific automaton design tasks. It covers topics such as regular expressions, epsilon transitions, and state minimization. Additionally, it includes practical scenarios for constructing automata for specific input conditions and string patterns.

Uploaded by

dhinagar
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/ 30

1.

Arrange in appropriate order, the construction of a finite automate:


A. Minimum state DFA
B. Regular Expression
C. NFA-ε
D. Problem Statement
E. DFA
Choose the correct answer from the options below:
a) B C E A D
b) D B C E A
c) C E B A D
d) ADCBE
2. What is the minimum number of states to recognise the language L={w/w ϵ (0+1)+}?
a) 1
b) 3
c) 2
d) 4
3. Which of the following is True with respect to a DFA and NFA that accepts the same
language.
a) NFA is more powerful than DFA
b) NFA and DFA are equal in power
c) DFA is more powerful than DFA
d) It is not fixed. Either DFA or NFA could be more powerful based on the problem.
4. The epsilon closure of a state in an Epsilon Nondeterministic Finite Automaton (ε-
NFA) is:
a. The set of all states reachable from the given state by following only epsilon (ε)
transitions.
b. The set of all states that have epsilon (ε) transitions to the given state.
c. The set of all states reachable from the given state by following both epsilon (ε)
transitions and input symbol transitions.
d. The set of all states that share the same input symbol transitions with the given state.
5. The maximum possible states in the conversion of a NFA with n states to a DFA is ---
------
a) 2*n
b) n(2n-1)
c) 2n
d) n(n-2)
Answer should be 2^n.
6. The maximum possible states in the conversion of a
NFA with n states to a DFA is ---------

a) 2*n
b) n(2n-1)
c) 2n
d) n(n-2)

7.A language is said to be ------------- if it is accepted


by some DFA.

a) closed
b) regular
c) irregular
d) balanced

8.Which of the following is True with respect to a


DFA and NFA that accepts the same language.

a) NFA is more powerful than DFA


b) NFA and DFA are equal in power
c) DFA is more powerful than DFA
d) It is not fixed. Either DFA or NFA could be more
powerful based on the problem

9.What is the regular expression that generate strings


with “010” as substring over the input Σ={0,1}

a) (0+1)*010 (0+1)*
b) (0+1)*010
c) 010 (0+1)*
d) (010)*

10.Moore machine produces ______ output for the n bit


input.

a) n-1
b) n
c) n+1
d) n+2
11.In the NFA with epsilon M= ({q0, q1,q2,q3},a,
δ,q0,{q3}) where δ is given in the transition table
below, what is the minimum length of string to reach
to the final state?

a. 0
b. 1
c. 2
d. 3

12.John is asked to make an automaton which accepts a


given string for all the occurrence of ‘1001’ in it.
How many numbers of transitions would John use
such that, the string processing application works?
a. 9
b. 11
c. 12
d. 15
Answer: (any)

13.According to the given transitions, which among the


following are the epsilon closures of q1 for the given
NFA?
Δ (q1, ε) = {q2, q3, q4}
Δ (q4, 1) = q1
Δ (q1, ε) = q1
a. q4
b. q2
c. q1
d. q4,q2,q3,q4
14.Let ∑= {a, b, …. z} and A = {Hello, World}, B=
{Input, Output}, then (A*∩B) U (B*∩A) can be
represented as:
a. {Hello, World, Input, Output, ε}
b. {Hello, World, ε}
c. {Input, Output, ε}
d. {}

15.In definition of FA with output ∆ refers to


a. Input Symbols
b. Transition function
c. Output Symbols
d. Output Function

15.Which of the following is True with respect to a FA.


a) The FA machine does not have memory in it.
b) NFA is more powerful than DFA
c) NFA and DFA are equal in power
d) DFA may have an Epsilon Transition

16.

a) Both machines are DFA


b) Both machines are Equivalent
c) Both machines are not Equivalent
d) Can not be determined

17.An automata in which output depends only on the


states as well as on the input at any instant of time is
called
a) An automaton without a Memory
b) Automaton with a finite Memory
c) Moore Machine
d) Mealy Machine

18.What is the regular expression that generate odd


number of 1’s over the input Σ={0,1}
a) (0+1)*010 (0+1)*
b) (0)*(10* 10*)10*
c) 010 (0+1)*
d) (010)*
20.A language is said to be ------------- if it is accepted
by some DFA.
a) closed
b) regular
c) irregular
d) balanced

21. Minimize the number of states of the below DFA.


22. Construct a Mealy machine that prints ‘c’ whenever
the sequence ‘01’ is encountered in any input binary
string.

23.. A leading firm in india is having a unique password


setting scheme with the input symbols i,j, and k.
Their employee must create their password adhering
to the following rules: i) It should start with the
letters {i,j,k}, ii) The fifth symbol from the right end
should be i. Construct the NFA for the above
scenario.

24.. Sanju and Keth are playing games. They are asked to
narrate strings in such a way that the words start and
end with same letter on the inputs{a,b,c}. Generate a
Regular expression for the above scenario and create
a DFA for the same and mention all the 5-tuple
structure.
25. Convert the following Regular expression to ε-NFA
a. (a+b)*.b
b. (ab+ba).a*

c. Construction of ε-NFA for decimal


numbers
26..In a web application, users need to create usernames following specific criteria. The
username should start with the character 'a', followed by any combination of 'a' and 'b'
(including an empty string), and it must end with the character 'b'. Construct RE, and NFA for
this scenario.

27 .Construct Deterministic Finite Automata for a language accepting binary strings, which
are divisible by 4. Check the string 1100 is accepted by the DFA or not.12
28.
Minimize the following DFA
a b
→A B C
B B D
C B C
D B E
*E B C
29.A software engineer is working on developing a compiler for a programming language. In
initial phase the rule for naming an identifier is set. The rules are: i. An identifier must start
with a letter (a-z or A-Z). ii. After the initial character, it can have zero or more occurrences
of letters or digits (0-9). We can assume l for letter and d for digits. a. Write a regular
expression for the identifier? b. Convert this RE into Ɛ-NFA using Thompson’s method. c.
Convert this Ɛ-NFA into DFA using subset construction method
.
30.Convert the following DFA into Regular Expression.
0 1
→ q1 q3 q2
q2 q1 q3
* q3 q3 q3
31.State the difference between Mealy and Moore machine and convert the below Moore
machine to Mealy machine

32.Write the regular Expression for each of the


following set of binary strings
• all binary strings except empty string
• begins with 1, ends with 1
• contains at least three 1s
• contains at least three consecutive
• contains the substring 110
33.Design a Minimal DFA for the following DFA
34.Imagine you are designing a traffic light controller for a circular roundabout with five
entry points. Each entry point is equipped with a sensor that counts the number of vehicles
waiting to enter the roundabout. To optimize the flow of traffic, the system should perform a
modulo 5 operations on the total number of vehicles that have entered the roundabout. Based
on the result, the system will decide the sequence of green lights for the entry points. The
modulo 5 operations will cycle through the results 0, 1, 2, 3, 4, corresponding to the entry
points. Design a Mealy machine that performs this modulo 5 operation and describe how the
Mealy machine transitions from one state to another based on the input.

35.Give the regular expression for the language containing binary strings which accept 00 or
11 at the end of a string e.g., 01010100 0r 01010111 but not 000111010. Convert this regular
expression to NFA with Epsilon and then to its equivalent DFA.
36..Two friends Aswanth and Babu have created a website and plan to have the username
login only by using the alphabet symbols with following specific criteria. (i) The username
should start with either of the the symbols {'s','r', 'm'} (ii) The fourth symbol from the right
end is ‘m’, The fifth symbol from the right end is ‘r’ and The sixth symbol from the right end
is ‘s’ Construct RE, and NFA for this scenario.

37.A school is hosting an annual day celebration, and students participating in a monact are
lined up in a queue. The queue must follow a specific rule: the first and last student in the line
must be of the same gender. Construct a Deterministic Finite Automaton (DFA) that
represents this scenario. Then, determine whether the sequence "FMFMMF" is accepted by
the DFA. Note : F-Female and M-Male
38.Minimize the following DFA with the Transition
Function:
• q0 -> q1 on 0 & q0 -> q2 on 1
• q1 -> q3 on 0 &q1 -> q4 on 1
• q2 -> q4 on 0 & q2 -> q5 on 1
• q3 -> q3 on 0 & q3 -> q4 on 1
• q4 -> q4 on 0 & q4 -> q5 on 1
• q5 -> q5 on 0 & q5 -> q5 on 1
39.A software company is creating a new text search
engine that needs to support a wide range of
search patterns. The team is using Epsilon-NFA
(ε-NFA) to represent these patterns through
regular expressions. However, for efficiency, the
final search engine must utilize a Deterministic
Finite Automaton (DFA).
The search engine needs to recognize patterns
that consist of any sequence of characters of ‘a’
& ‘b’ and end with the substring "abb."
1. Write a regular expression for the above
scenario.
2. Construct an ε-NFA using Thomson’s Rule
that represents this search pattern.
3. Convert this ε-NFA to a DFA suitable for
implementation in the search engine.
4. Determine whether the string "aabbabb" is
accepted by the resulting DFA.
40. The DFA has three states: q1, q2, and q3, where:
• q1 is the start state.
• q3 is the accepting state.
• The transitions are as follows:
o From q1 to q1 on input a.
o From q1 to q2 on input b.
o From q2 to q3 on input a.
o From q3 to q1 on input b.
Convert this DFA to a regular expression using the Rijk method.

You might also like