Q5 [15 pts]
a) Convert the following NFA to a DFA:
0 1
----------------------
-> a || {a} | {a,b}
b || {c} | {c}
c || {d} | {d}
d || {e} | {e}
* e || {} | {}
b) Informally describe the language that it accepts.
Convert the following NFA given by M to a DFA. Show your work
which includes both state diagrams.
M = ( {q0, q1, q2} , {a, b} , δ, q0, {q1}) with the state table
given
a
b
q0
{q1, q1}
q1
null
{q2}
q2
null
{q2}
Construct a DFA machine to recognize the language of all binary
numbers which are a multiple of 5.
L = { w belongs {0,1}* : w is a binary number and is a multiple of
5}
Example: 101 belongs to L; 1010 belongs to L; 110 doesn't belong to
L.
For the following lexical
specification:
Give NFA and DFA
Using your DFA, Implement a lexical analyzer using the state
table approach shown in class
• keywords:
if wh pr
• Identifiers. An
identifier is a sequence of one or more letters
• Integer literals.
An integer literal is a sequence of one or more decimal digits.
• Any of the following one- or
two-character symbols:
= ( ) { }
/ * - +
< <= ==
!=
• Note...
Automata Theory and Formal Languages
Instructions:
Draw the DFA (Deterministic Finite Automaton) of the
following:
DFA in which set of all strings can be accepted which end with
‘a’
DFA in which set of all strings can be accepted which start
with ab
DFA in which set of all strings can be accepted which contain
ab
DFA in which set of all strings can be accepted which ends with
ab
Automata Theory and Formal Languages
Instructions:
Draw the DFA (Deterministic Finite Automaton) of the
following:
DFA for binary number divisible by 2
DFA for binary number divisible by 3
DFA in which set of all strings can be accepted which start
with a
DFA in which set of all strings can be accepted which contains
‘a’