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

Construct finite-state automata that recognize these sets.

\(\begin{array}{l}a){{\bf{0}}^*}{({\bf{10}})^*}\\b){(01 \cup 111)^*}{10^*}(0 \cup 1)\\c){({\bf{001}} \cup {({\bf{11}})^*})^*}\end{array}\)

Short Answer

Expert verified

a) Let \({s_0}\) be the start state of the finite-state automata. Since the Kleene closures contain the empty string \(\lambda \), you need to make \({s_0}\) a final state.

b) Let \({s_0}\) be the start state of the finite-state automata.

You first create \({(01)^*}\) by creating a loop: input 0 at state \({s_0}\) moves us to state \({s_1}\) and input 1 at state \({s_1}\) moves us back to state \({s_0}\).

c) Let \({s_0}\) be the start state of the finite-state automata. Since the Kleene closures contain the empty string \(\lambda \), you need to make \({s_0}\) a final state.

Step by step solution

01

Definition 

Kleene closure of A: Set consisting of concatenations of any number of strings from A

\({A^*} = \bigcup\limits_{k = 0}^{ + \infty } {{A^k}} \)

02

(a) Constructing the finite-state automata 

\({0^*}{(10)^*}\)

Let \({s_0}\) be the start state of the finite-state automata. Since the Kleene closures contain the empty string \(\lambda \), you need to make \({s_0}\) a final state.

You add a loop with input 0 at the state \({s_0}\) to represents the strings \({0^*}\) (such that any string of \(0'\) will be accepted).

Next, you still need to include \({(10)^*}\) in the automata, which are basically blocks of 10. The state \({s_1}\) will represents the 1 in the block, while the state \({s_2}\) represents the 0 in the block. Note that \({s_2}\) needs to be a final state such that it recognizes the strings with the blocks 10 (preceded by possible \(0's\)).

If you are at the starting state \({s_0}\) with input 1, then you will move to the state \({s_1}\) as you have then started the blocks of 10.

03

Constructing the finite-state automata

If you are at the state \({s_1}\) with input 0, then you will move to the state \({s_2}\) as you have then completed a 10 block. If you are at state \({s_2}\) with input 1, then you move back to state \({s_1}\) as you have then started a new 10 block. However, if the inputs is 1 at \({s_1}\) or 0 when you are at state \({s_2}\), then you will move to state \({s_3}\) which will contain all left-over strings (while you won't leave \({s_3}\) once you get there).

Hence, \({s_0}\) be the start state of the finite-state automata. Since the Kleene closures contain the empty string \(\lambda \), you need to make \({s_0}\) a final state.

04

(b) Constructing the finite-state automata

\({(01 \cup 111)^*}{10^*}(0 \cup 1)\)

Let \({s_0}\) be the start state of the finite-state automata.

You first create \({(01)^*}\) by creating a loop: input 0 at state \({s_0}\) moves us to state \({s_1}\) and input 1 at state \({s_1}\) moves us back to state \({s_0}\).

You next create \({(111)^*}\) by creating a loop: input 1 at state \({s_0}\) moves us to state \({s_2}\) and input 1 at state \({s_2}\) moves us to state \({s_3}\) and input 1 at state \({s_3}\) moves us back to state \({s_0}\). The combination with the previous part of the automata will then result in \({(01 \cup 111)^*}\)

05

Constructing the finite-state automata 

Next, the input 1 moves us from state \({s_0}\) to state \({s_4}\), while there is a loop with input 0 at state \({s_4}\) (to represents \(1{0^*}\)).

Finally, you add an arrow with input 0 and input 1 to a final state \({s_5}\). Only strings in \({(01 \cup 111)^*}{10^*}(0 \cup 1)\) will then be accepted by the automata

Hence, \({s_0}\) be the start state of the finite-state automata.

You first create \({(01)^*}\) by creating a loop: input 0 at state \({s_0}\) moves us to state \({s_1}\) and input 1 at state \({s_1}\) moves us back to state \({s_0}\).

06

(c) Constructing the finite-state automata 

\({({\bf{001}} \cup {({\bf{11}})^*})^*}\)

Let \({s_0}\) be the start state of the finite-state automata. Since the Kleene closures contain the empty string \(\lambda \), you need to make \({s_0}\) a final state.

You first create \({(001)^*}\) by creating a loop: input 0 at state \({s_0}\) moves us to state \({s_1}\) and input 0 at state \({s_1}\) moves us to state \({s_2}\) and input 1 at state \({s_2}\) moves us back to state \({s_0}\)

You next create \({(11)^*}\) by creating a loop: input 1 at state \({s_0}\) moves us to state \({s_2}\) while input 1 at state \({s_2}\) already moves us back to state \({s_0}\). The combination with the previous part of the automata will then result in \({({\bf{001}} \cup {({\bf{11}})^*})^*}\).

Hence, \({s_0}\) be the start state of the finite-state automata. Since the Kleene closures contain the empty string \(\lambda \), you need to make \({s_0}\) a final state.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

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

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\}\)

let \({{\bf{G}}_{\bf{1}}}\) and \({{\bf{G}}_{\bf{2}}}\) be context-free grammars, generating the language\({\bf{L}}\left( {{{\bf{G}}_{\bf{1}}}} \right)\) and \({\bf{L}}\left( {{{\bf{G}}_{\bf{2}}}} \right)\), respectively. Show that there is a context-free grammar generating each of these sets.

a) \({\bf{L}}\left( {{{\bf{G}}_{\bf{1}}}} \right){\bf{UL}}\left( {{{\bf{G}}_{\bf{2}}}} \right)\)

b) \({\bf{L}}\left( {{{\bf{G}}_{\bf{1}}}} \right){\bf{L}}\left( {{{\bf{G}}_{\bf{2}}}} \right)\)

c) \({\bf{L}}{\left( {{{\bf{G}}_{\bf{1}}}} \right)^{\bf{*}}}\)

Give production rules in Backusโ€“Naur form for the name of a person if this name consists of a first name, which is a string of letters, where only the first letter is uppercase; a middle initial; and a last name, which can be any string of letters.

Use the set of productions to show that each of these sentences is a valid sentence.

a) The happy hare runs.

b) The sleepy tortoise runs quickly.

c) The tortoise passes the hare.

d) The sleepy hare passes the happy tortoise.

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

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

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

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

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