Σ = a, b w - w (ab ba .) : Figure 1: Simpler language
Σ = a, b w - w (ab ba .) : Figure 1: Simpler language
__________________________________________________________________________
1.5.c
The following language is the complement of a simpler language. Construct a DFA
for the simpler language, then use it to give the state diagram of a DFA for the
language given. Σ = { a, b } . { w | w contains neither the substrings ab nor ba }.
__________________________________________________________________________
1.6.b
Give state diagram of DFA recognizing the following language.
The alphabet is { 0, 1 } . { w| w contains at least three 1s }.
__________________________________________________________________________
1.7.e
Give state diagram of NFA with the specified number of states recognizing the
following language. The alphabet is { 0, 1 } . The language 0 * 1 * 0 + with three states.
0 * 1 * 0 + ≈ 00 … 0 11 … 1 0 0 … 0
__________________________________________________________________________
1.16
Use the construction given in Theorem 1.39 to convert the following two
nondeterministic finite automata to equivalent deterministic finite automata.
Step two: The Start state is the set of states that are reachable from 1 along 𝜖 arrows,
plus 1 itself.
⟹ Start state: E({ 1 }) = { 1 }
Step three: The new accept states are those containing the NFA's accept states.
⟹ Accept states: {{ 1 }, { 1, 2 }}
Step four: Drawing the transitions from NFA to D. And adding a a, b transition from ∅ to
itself.
a to { 1, 2 }
{1} via
b to {2}
a to ∅
⟹ From {2} via
b to {1}
a to { 1, 2 } ∪ ∅ = { 1, 2 }
{ 1, 2 } via
b to { 2 } ∪ { 1 } = { 1, 2 }
.................................................................................................................................................
Step two: The Start state is the set of states that are reachable from 1 along 𝜖 arrows,
plus 1 itself.
⟹ Start state: E({ 1 }) = { 1, 2 }
Step three: The new accept states are those containing the DFA's accept states.
⟹ Accept states: {{ 2 }, { 1, 2 }, { 2, 3 }, { 1, 2, 3 }}
Step four: Drawing the transitions from NFA to D. And adding a a, b transition from ∅ to
itself.
a to {3}
{1} via
b to ∅
a to { 1 } and a + 𝜖 to { 2 } ⟹ { 1, 2 }
{2} via
b to ∅
a to {2}
{3} via
b to { 2, 3 }
a to { 3 } ∪ { 1, 2 } = { 1, 2, 3 }
⟹⟹ From { 1, 2 } via
b to ∅∪∅ = ∅
a to { 3 } ∪ { 2 } = { 2, 3 }
{ 1, 3 } via
b to ∅ ∪ { 3, 2 } = { 2, 3 }
a to { 1, 2 } ∪ { 2 } = { 1, 2 }
{ 2, 3 } via
b to ∅ ∪ { 3, 2 } = { 2, 3 }
a to { 3 } ∪ { 1, 2 } ∪ { 2 } = { 1, 2, 3 }
{ 1, 2, 3 } via
b to ∅ ∪ ∅ ∪ { 2, 3 } = { 2, 3 }
Step five: Removing the states that are not reachable by any other states.
⟹ Remove states: {{ 1 }, { 3 }, { 2 }, { 1, 3 }}
Simplified
⏪⏪⏪⏪
⏫
__________________________________________________________________________
1.32
For languages A and B, let the shuffle of A and B be the language
w| w = a1 b1 … ak bk , where a1 … ak ∈ A and b1 … bk ∈ B, each ai , bi ∈ Σ * .
Show that the class of regular languages is closed under shuffle.
Let A and B be regular languages. We need to show that A shuffle B is regular.
by corollary 1.40 we know that a language is regular if and only if some NFA recognizes it.
So we take N 1 for A and N 2 for B and combine them into one new NFA, N.
Let N 1 = Q 1 , ∑ , 𝛿 1 , q 1 , F 1 recognize A and N 2 = Q 2 , ∑ , 𝛿 2 , q 2 , F 2 recognize B.
Let A be a regular language. We need to show that DROP - OUT (A) is regular.
by corollary 1.40 we know that a language is regular if and only if some NFA recognizes it.
So we take D 1 for A and modify it to recognize a new NFA, N.
First we create to copies of the DFA D 1 .
Let D 1 = Q 1 , ∑ , 𝛿 1 , q 1 , F 1 and D'1 = Q'1 , ∑ , 𝛿'1 , q'1 , F'1 recognize A