Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Find a deterministic finite-state automaton that recognizeseach of these sets.

\(\begin{array}{l}{\bf{a)\{ 0\} }}\\{\bf{b)\{ 1,00\} }}\\{\bf{c)\{ }}{{\bf{1}}^{\bf{n}}}{\bf{|n = 2,3,4,}}...{\bf{\} }}\end{array}\)

Short Answer

Expert verified

The result is

(a)

State01
\({{\bf{s}}_{\bf{0}}}\)
\({{\bf{s}}_{\bf{1}}}\)
\({{\bf{s}}_{\bf{2}}}\)
\({{\bf{s}}_{\bf{1}}}\)
\({{\bf{s}}_{\bf{2}}}\)
\({{\bf{s}}_{\bf{2}}}\)
\({{\bf{s}}_{\bf{2}}}\)
\({{\bf{s}}_{\bf{2}}}\)
\({{\bf{s}}_{\bf{2}}}\)

b)

State01
\({{\bf{s}}_{\bf{0}}}\)
\({{\bf{s}}_{\bf{1}}}\)
\({{\bf{s}}_{\bf{4}}}\)
\({{\bf{s}}_{\bf{1}}}\)
\({{\bf{s}}_{\bf{2}}}\)
\({{\bf{s}}_{\bf{3}}}\)
\({{\bf{s}}_{\bf{2}}}\)
\({{\bf{s}}_{\bf{3}}}\)
\({{\bf{s}}_{\bf{3}}}\)
\({{\bf{s}}_{\bf{3}}}\)
\({{\bf{s}}_{\bf{3}}}\)
\({{\bf{s}}_{\bf{3}}}\)
\({{\bf{s}}_{\bf{4}}}\)
\({{\bf{s}}_{\bf{3}}}\)
\({{\bf{s}}_{\bf{3}}}\)

c)

State01
\({{\bf{s}}_{\bf{0}}}\)
\({{\bf{s}}_{\bf{3}}}\)
\({{\bf{s}}_{\bf{1}}}\)
\({{\bf{s}}_{\bf{1}}}\)
\({{\bf{s}}_{\bf{3}}}\)
\({{\bf{s}}_{\bf{2}}}\)
\({{\bf{s}}_{\bf{2}}}\)
\({{\bf{s}}_{\bf{3}}}\)
\({{\bf{s}}_{\bf{2}}}\)
\({{\bf{s}}_{\bf{3}}}\)
\({{\bf{s}}_{\bf{3}}}\)
\({{\bf{s}}_{\bf{3}}}\)

Step by step solution

Achieve better grades quicker with Premium

  • Unlimited AI interaction
  • Study offline
  • Say goodbye to ads
  • Export flashcards

Over 22 million students worldwide already upgrade their learning with Vaia!

01

Construction of deterministic finite-state automaton.

(a)

Here \(L\left( M \right) = \left\{ 0 \right\}\)

Let’s consider threestate\({s_0},{s_{1,}}{s_2}\).

Let start state be \({s_0}\).Since the empty string is not the final,\({s_0}\)is not a final state.

If the input start with a 0, then move on to a final state\({s_1}\). If the input contains any more digits, then move on to the non-final state\({s_2}\). Once arrive at\({s_2}\), will never leave the state again.

If the input starts with a 1, then move on to a non-final state\({s_2}\).

Other way of representing in tabular form.

State01
\({s_0}\)
\({s_1}\)
\({s_2}\)
\({s_1}\)
\({s_2}\)
\({s_2}\)
\({s_2}\)
\({s_2}\)
\({s_2}\)
02

Construct deterministic finite-state automaton.

(b)

Here \(L\left( M \right) = \left\{ {1,00} \right\}\)

Let us consider fivestates\({s_0},{s_{1,}}{s_2},{s_3},{s_4}\).

Let start state be \({s_0}\).Since the empty string is not the final,\({s_0}\)is not a final state.

If the input start with a 0, then move on to a non- final state\({s_1}\). If the next input is 0 then move on to the final state\({s_2}\).if another input follows the two zeros of it the input was 1, then move on to a non-final state\({s_3}\),that will never leave again.

If the input starts with a 1, then move on to a final state\({s_4}\).If the input contains any more digits, then I move on to non-final state\({s_3}\). Once I arrive at\({s_2}\), I will never leave the state again.

Other way of representing in tabular form.

State01
\({s_0}\)
\({s_1}\)
\({s_4}\)
\({s_1}\)
\({s_2}\)
\({s_3}\)
\({s_2}\)
\({s_3}\)
\({s_3}\)
\({s_3}\)
\({s_3}\)
\({s_3}\)
\({s_4}\)
\({s_3}\)
\({s_3}\)
03

Construction of deterministic finite-state automaton.

(c)

Here \(L\left( M \right) = \left\{ {{1^n}|n = 2,3,4,...} \right\}\)

Let us consider four states \({s_0},{s_{1,}}{s_2},{s_3}\).

Let start state be \({s_0}\).Since the empty string is not the final,\({s_0}\)is not a final state.

If the input start with a 1, then I move on to a non-final state\({s_1}\).

If the next input start with a 1, then I move on to a final state\({s_2}\)and any additional input of 1 should keep at the final state \({s_2}\).

If the input with a 0, then I move on to a non-final state\({s_3}\).Once I arrive at \({s_3}\), I will never leave the state again.

Other way of representing in tabular form.

State01
\({s_0}\)
\({s_3}\)
\({s_1}\)
\({s_1}\)
\({s_3}\)
\({s_2}\)
\({s_2}\)
\({s_3}\)
\({s_2}\)
\({s_3}\)
\({s_3}\)
\({s_3}\)

Therefore, this is the require construction of all parts.

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Construct phrase-structure grammars to generate each of these sets.

a) \(\left\{ {{{\bf{1}}^{\bf{n}}}{\bf{|n}} \ge {\bf{0}}} \right\}\)

b) \(\left\{ {{\bf{1}}{{\bf{0}}^{\bf{n}}}{\bf{|n}} \ge {\bf{0}}} \right\}\)

c) \(\left\{ {{\bf{1}}{{\bf{1}}^{\bf{n}}}{\bf{|n}} \ge {\bf{0}}} \right\}\)

A context-free grammar is ambiguous if there is a word in \({\bf{L(G)}}\) with two derivations that produce different derivation trees, considered as ordered, rooted trees.

Show that the grammar \({\bf{G = }}\left( {{\bf{V, T, S, P}}} \right)\) with \({\bf{V = }}\left\{ {{\bf{0, S}}} \right\}{\bf{,T = }}\left\{ {\bf{0}} \right\}\), starting state \({\bf{S}}\), and productions \({\bf{S}} \to {\bf{0S,S}} \to {\bf{S0}}\), and \({\bf{S}} \to 0\) is ambiguous by constructing two different derivation trees for \({{\bf{0}}^{\bf{3}}}\).

Determine whether all the strings in each of these sets are recognized by the deterministic finite-state automaton in Figure 1.

a){0}* b){0} {0}* c){1} {0}*

d){01}* e){0}*{1}* f){1} {0,1}*

a)what is the language generated by a phrase-structure grammar G?

b)What is the language generated by the grammar Gwith vocabulary{S,0,1}, set of terminals T= {0,1}, starting symbol S, and productions S→000S, S→1?

c)Give a phrase-structure grammar that generates the set \({\bf{\{ 0}}{{\bf{1}}^{\bf{n}}}{\bf{|n = 0,1,2}}....{\bf{\} }}\).

Let V = {S, A, B, a, b} and T = {a, b}. Find the language generated by the grammar (V, T, S, P) when theset P of productions consists of

\(\begin{array}{*{20}{l}}{{\bf{a) S }} \to {\bf{ AB, A }} \to {\bf{ ab, B }} \to {\bf{ bb}}{\bf{.}}}\\{{\bf{b) S }} \to {\bf{ AB, S }} \to {\bf{ aA, A }} \to {\bf{ a, B }} \to {\bf{ ba}}{\bf{.}}}\\{{\bf{c) S }} \to {\bf{ AB, S }} \to {\bf{ AA, A }} \to {\bf{ aB, A }} \to {\bf{ ab, B }} \to {\bf{ b}}{\bf{.}}}\\{{\bf{d) S }} \to {\bf{ AA, S }} \to {\bf{ B, A }} \to {\bf{ aaA, A }} \to {\bf{ aa, B }} \to {\bf{ bB, B }} \to {\bf{ b}}{\bf{.}}}\\{{\bf{e) S }} \to {\bf{ AB, A }} \to {\bf{ aAb, B }} \to {\bf{ bBa, A }} \to {\bf{ \lambda , B }} \to {\bf{ \lambda }}{\bf{.}}}\end{array}\)

See all solutions

Recommended explanations on Math Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free