Chapter 13: Q24E (page 865)
Construct a Moore machine that gives an output of 1 whenever the number of symbols in the input string read so far is divisible by 4 and an output of 0 otherwise.
Short Answer
The Moore machine model is shown below.
Chapter 13: Q24E (page 865)
Construct a Moore machine that gives an output of 1 whenever the number of symbols in the input string read so far is divisible by 4 and an output of 0 otherwise.
The Moore machine model is shown below.
All the tools & learning materials you need for study success - in one app.
Get started for freeFind a phrase-structure grammar for each of these languages.
a) the set consisting of the bit strings 10, 01, and 101.
b) the set of bit strings that start with 00 and end with one or more 1s.
c) the set of bit strings consisting of an even number of 1s followed by a final 0.
d) the set of bit strings that have neither two consecutive 0s nor two consecutive 1s.
Show that a set is generated by a regular grammar if and only if it is a regular set.
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\}\)
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}*
Let V = {S, A, B, a, b} and T = {a, b}. Determine whether G = (V, T, S, P) is a type 0 grammar but not a type 1 grammar, a type 1 grammar but not a type 2 grammar, or a type 2 grammar but not a type 3 grammar if P, the set of productions, is
\(\begin{array}{*{20}{l}}{{\bf{a) S }} \to {\bf{ aAB, A }} \to {\bf{ Bb, B }} \to {\bf{ \lambda }}{\bf{.}}}\\{{\bf{b) S }} \to {\bf{ aA, A }} \to {\bf{ a, A }} \to {\bf{ b}}{\bf{.}}}\\{{\bf{c) S }} \to {\bf{ABa, AB }} \to {\bf{ a}}{\bf{.}}}\\{{\bf{d) S }} \to {\bf{ ABA, A }} \to {\bf{ aB, B }} \to {\bf{ ab}}{\bf{.}}}\\{{\bf{e) S }} \to {\bf{ bA, A }} \to {\bf{ B, B }} \to {\bf{ a}}{\bf{.}}}\\{{\bf{f ) S }} \to {\bf{ aA, aA }} \to {\bf{ B, B }} \to {\bf{ aA, A }} \to {\bf{ b}}{\bf{.}}}\\{{\bf{g) S }} \to {\bf{ bA, A }} \to {\bf{ b, S }} \to {\bf{ \lambda }}{\bf{.}}}\\{{\bf{h) S }} \to {\bf{ AB, B }} \to {\bf{ aAb, aAb }} \to {\bf{ b}}{\bf{.}}}\\{{\bf{i) S }} \to {\bf{ aA, A }} \to {\bf{ bB, B }} \to {\bf{ b, B }} \to {\bf{ \lambda }}{\bf{.}}}\\{{\bf{j) S }} \to {\bf{ A, A }} \to {\bf{ B, B }} \to {\bf{ \lambda }}{\bf{.}}}\end{array}\)
What do you think about this solution?
We value your feedback to improve our textbook solutions.