Unit 1
Unit 1
a) 2*n
b) n(2n-1)
c) 2n
d) n(n-2)
a) closed
b) regular
c) irregular
d) balanced
a) (0+1)*010 (0+1)*
b) (0+1)*010
c) 010 (0+1)*
d) (010)*
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
16.
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*
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
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.