Chapter 13: Q18E (page 865)
Construct a finite-state machine that determines whether the input string read so far ends in at least five consecutive 1s.
Short Answer
Therefore, the finite-state machine model is shown below.
Chapter 13: Q18E (page 865)
Construct a finite-state machine that determines whether the input string read so far ends in at least five consecutive 1s.
Therefore, the finite-state machine model is shown below.
All the tools & learning materials you need for study success - in one app.
Get started for freea) Explain what the productions are in a grammar if the BackusโNaur form for productions is as follows:
\(\begin{array}{*{20}{l}}{{\bf{ < expression > :: = }}\left( {{\bf{ < expression > }}} \right){\bf{ }}\left| {{\bf{ < expression > + < expression > }}} \right|}\\\begin{array}{c}{\bf{\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;}}\,\,\,\,{\bf{ < expression > * < expression > |}}\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,{\bf{ < variable > }}\end{array}\\{\,\,\,\,\,\,\,\,\,{\bf{ < variable > :: = xly}}}\end{array}\)
b) Find a derivation tree for \(\left( {{\bf{x*y}}} \right){\bf{ + x}}\) in this grammar.
Find a phrase-structure grammar that generates each of these languages.
\({\bf{a)}}\)the set of bit strings of the form \({{\bf{0}}^{{\bf{2n}}}}{{\bf{1}}^{{\bf{3n}}}}\), where \({\bf{n}}\) is a nonnegative integer
\({\bf{b)}}\)the set of bit strings with twice as many \({\bf{0's}}\) as \({\bf{1's}}\)
\({\bf{c)}}\)the set of bit strings of the form \({{\bf{w}}^{\bf{2}}}\), where \({\bf{w}}\) is a bit string
a) Construct a derivation of \({{\bf{0}}^{\bf{2}}}{{\bf{1}}^{\bf{4}}}\) using the grammar \({{\bf{G}}_{\bf{1}}}\) in Example 6.
b) Construct a derivation of \({{\bf{0}}^{\bf{2}}}{{\bf{1}}^{\bf{4}}}\) using the grammar \({{\bf{G}}_{\bf{2}}}\) in Example 6.
Find the strings constructed using the derivation trees shown here.
In Exercises 16โ22 find the language recognized by the given deterministic finite-state automaton
What do you think about this solution?
We value your feedback to improve our textbook solutions.