Вы находитесь на странице: 1из 4

Problem Set 2

1. Design an NFA with no more than five states for the set
n n
{abab : n ≥ 0} U{aba : n ≥ 0} .

2. Construct an NFA with three states that accepts the language


*
{ab,abc} .

n n
3. Find an NFA with four states for L = {a : n ≥ 0} U{b a : n ≥ 1} .
4. Which of the stings 00,01001,10010,000,0000,are accepted by the

0 1
q q2
q0
1
0,
0,1

following NFA?
*
5. Find an NFA that accepts {a} and is such that if in its transition
graph a single edge is removed (without any other changes), the
resulting automaton accepts {a}.
6. An NFA in which (a) there are no λ -transitions, and (b) for all q ∈ Q
and all a∈ ∑ , δ (q, a) contains at most one element, is sometimes
called an incomplete DFA. This is reasonable since the conditions make
it suck that there is never any choice of moves.
For ∑ ={a,b}, convert the incomplete DFA below into a standard
b

a a
DFA..
7. Convert to a DFA the following NFA:

0 1

p {p,q} {q,s}
q {r} {r}
r {s} {s}
*s {s}

8. Convert to a DFA the following NFA:

0 1

p {q}
*q {q,r}
r {p}
*s {p}

9. Convert the following NFA to a DFA and informally describe the


language it accepts.

0 1

p {p,q} {p}
*q {r,s} {t}
r {p,r} {t}
*s
*t

10. Give nondeterministic finite automata to accept the following


languages. Try to take advantage of nondeterminism as much as
possible.
*a) The set of strings over alphabet {0, 1,..., 9} such that the final
digit has appeared before.
b)The set of strings over alphabet {0, 1,..., 9} such that the final
digit has not appeared before.
c) The set of strings of 0’s and l’s such that there are two 0’s
separated by a number of positions that is a multiple of 4. Note that 0 is
an allowable multiple of 4.
11. Prove that all finite languages are regular.
12. In the box on "Dead States and DFA's Missing Some Transitions,"
we claim that if N is an NFA that has at most one choice of state for any
state and input symbol (i.e.,δ(q, a) never has size greater than 1), then
the DFA D constructed from N by the subset construction has exactly
the states and transitions of N plus transitions to a new dead state
whenever N is missing a transition for a given state and input symbol.
Prove this contention.
13. In Example 2.13 we claimed that the NFA N is in state qi, for i - 1,
2,..., n, after reading input sequence w if and only if the ith symbol from
the end of w is 1. Prove this claim.
14. Design ε-NFA's for the following languages. Try to use e-transitions
to simplify your design.
a )The set of strings consisting of zero or more a's followed by zero
or more b's, followed by zero or more c's.
b) The set of strings that consist of either 01 repeated one or more
times or 010 repeated one or more times.
c) The set of strings of O's and l's such that at least one of the last
ten positions is a 1.
15. Use the construction of Theorem 2.2 to convert the NFA in Figure
2.10 to a DFA. Can you see a simpler answer more directly?
16. Convert the following NFA into an equivalent DFA.
1 0
0 1

q0 q1 q2

λ,0 0,1

17. Carefully complete the arguments in the proof of Theorem 2.2.


δ δ
* *
Show in detail that if the label of D (q0,ω) contains qf, then N

(q0,ω) also contains qf.


18. Is it true that for any NFA M = (Q,∑,δ,q0,F) the complement of L(M)
is equal to the set {ω∈∑*:δ*(q0,ω)∩F=Ø}? If so, prove it. If not, give a
counter example.
19. It is true that for every NFA M = (Q,∑,δ,q0,F) the complement of
L(M) is equal to the set {ω∈∑*:δ*(q0,ω) ∩(Q-F)≠ Ø }? If so, prove it. If
not, give a counterexample.
20 .Prove that for every NFA with an arbitrary number of final states,
there is an equivalent NFA with only one final state. Can we make a
similar claim for DFA's ?
21. Find an NFA without λ-transitions and with a single final state that
accepts the set {a}∪{bn:n≥1}.
22. Let L be a regular language that does not contain λ. Show that there
exists an NFA without λ-transitions and with a single final state that
accepts L.