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}
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’
write a VBA code to convert an arbitrary positive binary
fractional number (0< number<1) to equivalent decimal number.
the code should acquire the binary fraction number in the
format"0.xxxxxx"from input box, then return the equivalent decimal
number in a message box. in the code, you may need to use VBA
function "mid(_,_,_)" to pick up a specific symbols or characters
from a string. you can use below conversion as benchmark to verify
and debug your code:
(0.1011)2 = (0.6875)10