Can you please help me with this question, following the steps/ instructions given in the images? As specific as possible please. Thanks. ==== Consider the CFG G2 induced by the following productions: S → aT | bV | YY T → bS | aTT U → aUV | Ub V → aS | bVV | aUY W → XU | WX X → aba | VX

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter20: Queuing Theory
Section20.4: The M/m/1/gd/∞/∞ Queuing System And The Queuing Formula L = Λw
Problem 14P
icon
Related questions
Question

Can you please help me with this question, following the steps/ instructions given in the images? As specific as possible please. Thanks.
====

Consider the CFG G2 induced by the following productions:

S → aT | bV | YY
T → bS | aTT
U → aUV | Ub
V → aS | bVV | aUY
W → XU | WX
X → aba | VX
Y → abS | SY | ε

 

Give a grammar in Chomsky normal form that generates L(G2) \ {ε}. You must use all steps of the transformation described in the handout in the given sequence.

3. A non-terminal A is generating if A ⇒* w for some w € Σ*.
* If A → w € P and w contains only terminals, A is generating.
* If A → w€ P and w contains only terminals or generating non-terminals, A is generating.
* Remove each non-generating non-terminal with all productions containing it.
4. A non-terminal A is reachable if S * uAv for some u, v € (EUN)*.
* S is reachable.
* If A → w€ P and A is reachable, every non-terminal in w is reachable.
* Remove each non-reachable non-terminal with all productions containing it.
5. Consider every terminal a in a right-hand side of length at least 2.
* Add a new non-terminal A and the production A → a.
* Replace every occurrence of a in a right-hand side of length at least 2 with A.
6. Consider every production A → B₁ B₂ ….. Bɲ with n ≥ 3.
n
* Add a new non-terminal C and replace this production with A → B₁C and C → B₂B3... Bn.
* Repeat this step while there are changes.
Transcribed Image Text:3. A non-terminal A is generating if A ⇒* w for some w € Σ*. * If A → w € P and w contains only terminals, A is generating. * If A → w€ P and w contains only terminals or generating non-terminals, A is generating. * Remove each non-generating non-terminal with all productions containing it. 4. A non-terminal A is reachable if S * uAv for some u, v € (EUN)*. * S is reachable. * If A → w€ P and A is reachable, every non-terminal in w is reachable. * Remove each non-reachable non-terminal with all productions containing it. 5. Consider every terminal a in a right-hand side of length at least 2. * Add a new non-terminal A and the production A → a. * Replace every occurrence of a in a right-hand side of length at least 2 with A. 6. Consider every production A → B₁ B₂ ….. Bɲ with n ≥ 3. n * Add a new non-terminal C and replace this production with A → B₁C and C → B₂B3... Bn. * Repeat this step while there are changes.
A CFG G = (N, E, P, S) is in Chomsky normal form if every production has the form
* A → BC, where B, C € N, or
*Aa, where a € E.
* The right-hand side of each production is either two non-terminals or a terminal.
For every CFG G with & L(G) there is a CFG G' in Chomsky normal form with L(G) = L(G').
1. Eliminate ɛ-productions of the form A → ɛ.
2. Eliminate unit-productions of the form A → B.
3. Eliminate non-generating non-terminals.
4. Eliminate non-reachable non-terminals.
5. Eliminate terminals from right-hand sides of length at least 2.
6. Eliminate right-hand sides of length at least 3.
1. If A → uBv € P for u, v € (ΣUN)* and B → ɛ € P, add A → uv to P.
* Repeat this step while there are changes.
* Afterwards, remove all ɛ-productions of the form A → ɛ.
2. If A → B EP and B → w EP for wE (UN)*, add A → w to P.
* Repeat this step while there are changes.
* Afterwards, remove all unit-productions of the form A → B.
Transcribed Image Text:A CFG G = (N, E, P, S) is in Chomsky normal form if every production has the form * A → BC, where B, C € N, or *Aa, where a € E. * The right-hand side of each production is either two non-terminals or a terminal. For every CFG G with & L(G) there is a CFG G' in Chomsky normal form with L(G) = L(G'). 1. Eliminate ɛ-productions of the form A → ɛ. 2. Eliminate unit-productions of the form A → B. 3. Eliminate non-generating non-terminals. 4. Eliminate non-reachable non-terminals. 5. Eliminate terminals from right-hand sides of length at least 2. 6. Eliminate right-hand sides of length at least 3. 1. If A → uBv € P for u, v € (ΣUN)* and B → ɛ € P, add A → uv to P. * Repeat this step while there are changes. * Afterwards, remove all ɛ-productions of the form A → ɛ. 2. If A → B EP and B → w EP for wE (UN)*, add A → w to P. * Repeat this step while there are changes. * Afterwards, remove all unit-productions of the form A → B.
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Processes of 3D Graphics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole