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 a derivation of \({{\bf{0}}^{\bf{3}}}{{\bf{1}}^{\bf{3}}}\) using the grammar given in Example 5.

Short Answer

Expert verified

The derivation of\({{\bf{0}}^{\bf{3}}}{{\bf{1}}^{\bf{3}}}\)is:

\(\begin{array}{c}{\bf{S}} \to {\bf{0S1 }}\\ \to {\bf{0}}\left( {{\bf{0S1}}} \right){\bf{1}}\\ \to {\bf{0(0}}\left( {{\bf{0S1}}} \right){\bf{1)1 }}\\ \to {\bf{000\lambda 111 }}\\ \to {\bf{000111}}\end{array}\)

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

about the language generated by the grammar

Let \({\bf{G = }}\left( {{\bf{V, T, S, P}}} \right)\) be a phrase-structure grammar. The language generated by G (or the language of G), denoted by L(G), is the set of all strings of terminals that are derivable from the starting state S.

02

Firstly, using the grammar given in Example 5

\({\bf{G = }}\left( {{\bf{V, T, S, P}}} \right)\)is the phrase structure grammar with \({\bf{V = }}\left\{ {{\bf{0, 1, S}}} \right\}{\bf{, T = }}\left\{ {{\bf{0, 1}}} \right\}\) and the productions are

\({\bf{S}} \to {\bf{0S1}}\),\({\bf{S}} \to {\bf{\lambda }}\), where \({\bf{\lambda }}\) is the empty string.

03

Now, we shall construct a derivation of \({{\bf{0}}^{\bf{3}}}{{\bf{1}}^{\bf{3}}}\)

We have,

\(\begin{array}{c}{\bf{S}} \to {\bf{0S1 }}\\ \to {\bf{0}}\left( {{\bf{0S1}}} \right){\bf{1}}\\ \to {\bf{0(0}}\left( {{\bf{0S1}}} \right){\bf{1)1 }}\\ \to {\bf{000\lambda 111 }}\\ \to {\bf{000111}}\end{array}\)

Hence,\({{\bf{0}}^{\bf{3}}}{{\bf{1}}^{\bf{3}}}\)is a sentence of the language generated by G.

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

Give production rules in Backus–Naur form that generate all identifiers in the C programming language. In ‘C’ an identifier starts with a letter or an underscore (_) that is followed by one or more lowercase letters, uppercase letters, underscores, and digits.

Several extensions to Backus–Naur form are commonly used to define phrase-structure grammars. In one such extension, a question mark (?) indicates that the symbol, or group of symbols inside parentheses, to its left can appear zero or once (that is, it is optional), an asterisk (*) indicates that the symbol to its left can appear zero or more times, and a plus (+) indicates that the symbol to its left can appear one or more times. These extensions are part of extended Backus–Naur form (EBNF), and the symbols?, *, and + are called metacharacters. In EBNF the brackets used to denote nonterminal are usually not shown.

a) Define a nondeterministic finite-state automaton.

b) Show that given a nondeterministic finite-state automaton, there is a deterministic finite-state automaton that recognizes the same language.

a)Define a phrase-structure grammar.

b)What does it mean for a string to be derivable from a string wby a phrase-structure grammar G?

Let \({\bf{G = }}\left( {{\bf{V, T, S, P}}} \right)\) be the context-free grammar with \({\bf{V = }}\left\{ {\left( {\bf{,}} \right){\bf{S,A,B}}} \right\}{\bf{, T = }}\left\{ {\left( {\bf{,}} \right)} \right\}\) starting symbol \({\bf{S}}\), and productions \({\bf{S}} \to {\bf{A,A}} \to {\bf{AB,A}} \to {\bf{B,B}} \to {\bf{A,}}\)and \({\bf{B}} \to {\bf{(),S}} \to {\bf{\lambda }}\)

Construct the derivation trees of these strings.

\({\bf{a)}}\)\({\bf{(())}}\)

\({\bf{b)}}\)\({\bf{()(())}}\)

\({\bf{c)}}\)\({\bf{((()()))}}\)

Determine whether 1011 belongs to each of these regular sets.

  1. \({\bf{1}}0{\bf{*}}1{\bf{*}}\)
  2. \(0{\bf{*}}\left( {10 \cup 11} \right){\bf{*}}\)
  3. \(1\left( {01} \right){\bf{*1*}}\)
  4. \(1{\bf{*}}01\left( {0 \cup 1} \right)\)
  5. \(\left( {10} \right){\bf{*}}\left( {11} \right){\bf{*}}\)
  6. \(1\left( {00} \right){\bf{*}}\left( {{\bf{11}}} \right){\bf{*}}\)
  7. \(\left( {10} \right){\bf{*}}10{\bf{1}}1\)
  8. \(\left( {1 \cup 00} \right)\left( {01 \cup 0} \right)1{\bf{*}}\)
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