2.26 Show that if G is a CFG in Chomsky normal form, then for any string w E L(G) of length n > 1, exactly 2n – 1 steps are required for any derivation of w.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
2.26 Show that if G is a CFG in Chomsky normal form, then for any string w E L(G)
of length n > 1, exactly 2n – 1 steps are required for any derivation of w.
Transcribed Image Text:2.26 Show that if G is a CFG in Chomsky normal form, then for any string w E L(G) of length n > 1, exactly 2n – 1 steps are required for any derivation of w.
2.
[Based on Problem 2.26, page 157 in Sipser's 3rd Edition] Suppose G is a
context-free grammar in Chomsky normal form. This exercise will help you prove that for
any string w e L(G) of length n 2 1, exactly 2n - 1 steps are required for any derivation of
w. To make the proof simple, we define:
a variable rule is any rule of the form A BC, where A, B,C are variables,
• a terminal rule is any rule of the form A → a, where A is a variable and a is a terminal.
Now consider a derivation in G that starts with the start variable and applies apply variable
rules s times (may not be consecutive) and applies terminal rules t times, and let r be the
string generated by the derivation (z can contain both variables and terminals).
(a) Prove that the string r contains t terminals.
(b) Prove that the string r contains (1+s – t) variables.
(c) Prove that if r E L(G) and |2| = n, then s +t = 2n – 1.
%3D
Transcribed Image Text:2. [Based on Problem 2.26, page 157 in Sipser's 3rd Edition] Suppose G is a context-free grammar in Chomsky normal form. This exercise will help you prove that for any string w e L(G) of length n 2 1, exactly 2n - 1 steps are required for any derivation of w. To make the proof simple, we define: a variable rule is any rule of the form A BC, where A, B,C are variables, • a terminal rule is any rule of the form A → a, where A is a variable and a is a terminal. Now consider a derivation in G that starts with the start variable and applies apply variable rules s times (may not be consecutive) and applies terminal rules t times, and let r be the string generated by the derivation (z can contain both variables and terminals). (a) Prove that the string r contains t terminals. (b) Prove that the string r contains (1+s – t) variables. (c) Prove that if r E L(G) and |2| = n, then s +t = 2n – 1. %3D
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education