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...
-
Give state diagram of DFA recognizing L={w | w is 0,1-string, and
contains 3k 0s and 2m 1s for some integers k and m at least 0}. For
examples, 0010111 is in L, but 010011 is not in L. The first string
contains 3 0s and 4=2x2 1s, but the second string has an odd number
of 1s.
For a given language L = { w |
na(w) +
nb(w) =
nc(w) } where S = G = {a,
b, c} Looking for answer to 3
Construct a PDA M that accepts L with S = G = {a,
b, c}
Show the sequence of instantaneous descriptions for the
acceptance of acacbcbc by M in 1).
Give a CFG G that generates L, L(G) = L.
Prove that the language L={(M, N): M is a Turing machine and N
is a DFA with L(M) =L(N)} is undecidable. You need to derive a
reduction from Atm={(M, w)|Turing machine M accepts w} to L.
(In layman's terms please, no other theorems involved)