Let G be a context-free grammar on alphabet = a, +, and the} following production...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Let G be a context-free grammar on alphabet Σ = a, +, and the} following production rules: (a) (5 points) Specify the parse tree and left-most derivation each of the strings "((a))" and "(a+a* a) * (a* a+a)”. (b) (10 points) Formally prove that G is unambiguous. 2. (10 points) Convert the following CFG into an equivalent CFG in CNF. Show theintermediate steps. start 3. (15 points) Let PDA P is represented by the following graph. 0,- E 1, + → E 90 E, E → + q SS+ TT T- T * U\U U → (S) a E, E$ 0,4 → + 0$- $ 91 S- ASA ALEA aale E, $ E E, E- 94 1,$- $ 1,- 9 (a) (5 points) Write-down the 6-tuple representation of P. (b) (5 points) Describe the language accepted by this PDA. (c) (10 points) Prove that the following context-free grammar generates the languagedescribed in part b. S SS 0S1|150| E 4. (50 points) Show that the following languages are context-free either by writing agrammar that generates them or by drawing a PDA that accepts them. (a) (5 points) {wuwu, w = {0, 1}} (write a grammar) (b) (5 points) {ww = wRA |w| is odd} (write a grammar) (c) (10 points) {n bm dn, m, k Zzo, m = kv n = 3kv 2n = 3m} (write a grammar) (d) (10 points) {anbm din, m, k = Z≥o, m‡n+ k} (write a grammar) (e) (5 points) {n bmcn, m, k = Zzo, n=2m} (draw a PDA) (f) (5 points) {m dn, m, k € Zzo, m = 2k} (draw a PDA) (g) (10 points) {anbmd 2n, me€ Zzo (draw a PDA) 5. (10 points) Convert the PDA of question 3 to its equivalent CFG describing L(P) (Hint: You need to first convert the given PDA to the following PDA and then, use the conversion process specified in the proof of Lemma 2.27 and in class. Please note that by following the general conversion process, you will have many useless/unreachable variables that can be eliminated from your final response. The key useful variables are A9096 A9694, A9097, A4, and A4 which is the start variable of the grammar). start 9 % E, E + E, ES E, E+ EE $ $- E 97 0,- E 1, + → E 0, +→ E 98 91 SE 1, $ E 96 94 E, E- E, E$ E, E- 9 0 Let G be a context-free grammar on alphabet Σ = a, +, and the} following production rules: (a) (5 points) Specify the parse tree and left-most derivation each of the strings "((a))" and "(a+a* a) * (a* a+a)”. (b) (10 points) Formally prove that G is unambiguous. 2. (10 points) Convert the following CFG into an equivalent CFG in CNF. Show theintermediate steps. start 3. (15 points) Let PDA P is represented by the following graph. 0,- E 1, + → E 90 E, E → + q SS+ TT T- T* UU U → (S) a E, E$ 0,4 → + 0$ - $ 91 S- ASA ALEA aale E, $ E E, E- 94 1,$- $ 1,- 9 (a) (5 points) Write-down the 6-tuple representation of P. (b) (5 points) Describe the language accepted by this PDA. (c) (10 points) Prove that the following context-free grammar generates the languagedescribed in part b. S SS0S1|150| E 4. (50 points) Show that the following languages are context-free either by writing agrammar that generates them or by drawing a PDA that accepts them. (a) (5 points) {wuwu, w = {0, 1}} (write a grammar) (b) (5 points) {ww = wRA |w| is odd} (write a grammar) (c) (10 points) {@nbm dn, m, k = Zzo, m = kv n = 3kv 2n= 3m} (write a grammar) (d) (10 points) {anbm d\n, m, k = Z≥0, m‡n+ k} (write a grammar) (e) (5 points) {n bmd\n, m, k = Zzo, n = 2m} (draw a PDA) (f) (5 points) {amdn, m, k = Z₂o, m = 2k} (draw a PDA) (g) (10 points) {anbmd 2n, me Zzo (draw a PDA) 5. (10 points) Convert the PDA of question 3 to its equivalent CFG describing L(P) (Hint: You need to first convert the given PDA to the following PDA and then, use the conversion process specified in the proof of Lemma 2.27 and in class. Please note that by following the general conversion process, you will have many useless/unreachable variables that can be eliminated from your final response. The key useful variables are A9096 A9694, A9097, A9, and A4 which is the start variable of the grammar). start 9 % E, E + E, ES E, E+ EE $ $- E 97 0,- E 1, + → E 0, +→ E 98 91 SE 1, $ E 96 94 E, E- E, E$ E, E- 9 0 Let G be a context-free grammar on alphabet Σ = a, +, and the} following production rules: (a) (5 points) Specify the parse tree and left-most derivation each of the strings "((a))" and "(a+a* a) * (a* a+a)”. (b) (10 points) Formally prove that G is unambiguous. 2. (10 points) Convert the following CFG into an equivalent CFG in CNF. Show theintermediate steps. start 3. (15 points) Let PDA P is represented by the following graph. 0,- E 1, + → E 90 E, E → + q SS+ TT T- T * U\U U → (S) a E, E$ 0,4 → + 0$- $ 91 S- ASA ALEA aale E, $ E E, E- 94 1,$- $ 1,- 9 (a) (5 points) Write-down the 6-tuple representation of P. (b) (5 points) Describe the language accepted by this PDA. (c) (10 points) Prove that the following context-free grammar generates the languagedescribed in part b. S SS 0S1|150| E 4. (50 points) Show that the following languages are context-free either by writing agrammar that generates them or by drawing a PDA that accepts them. (a) (5 points) {wuwu, w = {0, 1}} (write a grammar) (b) (5 points) {ww = wRA |w| is odd} (write a grammar) (c) (10 points) {n bm dn, m, k Zzo, m = kv n = 3kv 2n = 3m} (write a grammar) (d) (10 points) {anbm din, m, k = Z≥o, m‡n+ k} (write a grammar) (e) (5 points) {n bmcn, m, k = Zzo, n=2m} (draw a PDA) (f) (5 points) {m dn, m, k € Zzo, m = 2k} (draw a PDA) (g) (10 points) {anbmd 2n, me€ Zzo (draw a PDA) 5. (10 points) Convert the PDA of question 3 to its equivalent CFG describing L(P) (Hint: You need to first convert the given PDA to the following PDA and then, use the conversion process specified in the proof of Lemma 2.27 and in class. Please note that by following the general conversion process, you will have many useless/unreachable variables that can be eliminated from your final response. The key useful variables are A9096 A9694, A9097, A4, and A4 which is the start variable of the grammar). start 9 % E, E + E, ES E, E+ EE $ $- E 97 0,- E 1, + → E 0, +→ E 98 91 SE 1, $ E 96 94 E, E- E, E$ E, E- 9 0 Let G be a context-free grammar on alphabet Σ = a, +, and the} following production rules: (a) (5 points) Specify the parse tree and left-most derivation each of the strings "((a))" and "(a+a* a) * (a* a+a)”. (b) (10 points) Formally prove that G is unambiguous. 2. (10 points) Convert the following CFG into an equivalent CFG in CNF. Show theintermediate steps. start 3. (15 points) Let PDA P is represented by the following graph. 0,- E 1, + → E 90 E, E → + q SS+ TT T- T* UU U → (S) a E, E$ 0,4 → + 0$ - $ 91 S- ASA ALEA aale E, $ E E, E- 94 1,$- $ 1,- 9 (a) (5 points) Write-down the 6-tuple representation of P. (b) (5 points) Describe the language accepted by this PDA. (c) (10 points) Prove that the following context-free grammar generates the languagedescribed in part b. S SS0S1|150| E 4. (50 points) Show that the following languages are context-free either by writing agrammar that generates them or by drawing a PDA that accepts them. (a) (5 points) {wuwu, w = {0, 1}} (write a grammar) (b) (5 points) {ww = wRA |w| is odd} (write a grammar) (c) (10 points) {@nbm dn, m, k = Zzo, m = kv n = 3kv 2n= 3m} (write a grammar) (d) (10 points) {anbm d\n, m, k = Z≥0, m‡n+ k} (write a grammar) (e) (5 points) {n bmd\n, m, k = Zzo, n = 2m} (draw a PDA) (f) (5 points) {amdn, m, k = Z₂o, m = 2k} (draw a PDA) (g) (10 points) {anbmd 2n, me Zzo (draw a PDA) 5. (10 points) Convert the PDA of question 3 to its equivalent CFG describing L(P) (Hint: You need to first convert the given PDA to the following PDA and then, use the conversion process specified in the proof of Lemma 2.27 and in class. Please note that by following the general conversion process, you will have many useless/unreachable variables that can be eliminated from your final response. The key useful variables are A9096 A9694, A9097, A9, and A4 which is the start variable of the grammar). start 9 % E, E + E, ES E, E+ EE $ $- E 97 0,- E 1, + → E 0, +→ E 98 91 SE 1, $ E 96 94 E, E- E, E$ E, E- 9 0
Expert Answer:
Related Book For
Discrete Mathematics and Its Applications
ISBN: 978-0073383095
7th edition
Authors: Kenneth H. Rosen
Posted Date:
Students also viewed these computer engineering questions
-
Let S be the class of all graphs such that K4 T H for all H in S. Let G be a graph that is not in S with the property that for all e E EG, we have G\e E S. Prove that G is 2-connected.
-
Let G be a simple graph with n vertices. Show that a) G is a tree if and only if it is connected and has n - 1 edges. b) G is a tree if and only if G has no simple circuits and has n 1 edges.
-
Let G be a connected graph. Show that if T is a spanning tree of G constructed using depth-first search, then an edge of G not in T must be a back edge, that is, it must connect a vertex to one of...
-
Laverty Clinic plans to purchase a new centrifuge machine for its New York facility. The machine costs $94,000 and is expected to have a useful life of 6 years, with a terminal disposal value of...
-
Refer to Exercise 12- 26. In Exercise 12- 26, Southland Corporation is a small information-systems consulting firm that specializes in helping companies implement standard sales-management software....
-
________ is the primary security control used in the Remote Access Domain.
-
In this chapter, we explored the political difference between bands, tribes, chiefdoms, and states. If you imagined a society moving through these different political forms, what general trends would...
-
MSA Computer Corporation manufactures two models of minicomputers, the Alpha 4 and the Beta 5. The firm employs five technicians, working 160 hours each per month, on its assembly line. Management...
-
A girl at the airport rolls a ball north on a moving walkway that moves east. If the ball's speed with respect to the walkway is 0.15m/s and the walkway moves at a speed of 1.5m/s, what is the...
-
Sara-Jayne Parsons is an architect who operates her own business. The accounts and transactions for the business follow. INSTRUCTIONS 1. Analyze the transactions for January 20X1. Record each in the...
-
The probability that a candidate gets selected for Commando training is 2%. What is the probability that from a group of 3 friends, a) 2 friends get selected, and b) all 3 friends get selected? Also,...
-
Give an example of when a party to an unenforceable contract may nevertheless recover money he has paid to the other party.
-
Under what circumstances may a contract voidable at the option of one of the parties cease to be voidable?
-
What element is necessary for a contract of employment to bind a minor?
-
Describe the difference between void and voidable contracts. What are the consequences of each for innocent third parties?
-
What two types of minors contracts must be distinguished for the purpose of determining the liability of the minors after they become of age?
-
Accounting is more than simply calculating the net profit or loss from business operations. Accounting is actually a process that involves: options: assigning responsibility for collecting financial...
-
Perform the operation by first converting the numerator and denominator to scientific notation. Write the answer in scientific notation. 7,200,00/0.000009
-
Construct a Moore machine that determines whether an input string contains an even or odd number of 1s. The machine should give 1 as output if an even number of 1s are in the string and 0 as output...
-
Let L be the set of all bit strings that end with 01. Show that 11 and 10 are distinguishable with respect to L and that the strings 1 and 11 are indistinguishable with respect to L.
-
Construct a finite-state automaton that recognizes the set of bit strings consisting of a 0 followed by a string with an odd number of 1s.
-
Draw the shear and moment diagrams for the shaft, and determine its required diameter to the nearest \(\frac{1}{8}\) in. if \(\sigma_{\text {allow }}=30 \mathrm{ksi}\) and \(\tau_{\text {allow }}=15...
-
Determine the minimum depth \(h\) of the beam to the nearest \(\frac{1}{8}\) in. that will safely support the loading shown. The allowable bending stress is \(\sigma_{\text {allow }}=2.1...
-
Draw the shear and moment diagrams for the shaft, and determine its required diameter to the nearest \(\frac{1}{4}\) in. if \(\sigma_{\text {allow }}=30 \mathrm{ksi}\) and \(\tau_{\text {allow }}=15...
Study smarter with the SolutionInn App