Answered step by step
Verified Expert Solution
Question
1 Approved Answer
5. (6 marks) Let S = {a,b,c,d}. Give context-free grammars that generate the following languages. In each case, also give a derivation of the specified
5. (6 marks) Let S = {a,b,c,d}. Give context-free grammars that generate the following languages. In each case, also give a derivation of the specified terminal string using your grammar. The derivation beginning from the start variable should indicate each individual derivation step using the notation (a) L1 = {b2c3k+1 | k> i>0} Derivation for the string: bc4. (b) L2 = {a_ih2i+2,5k+2 | i > 1, k > 1} Derivation for the string: a^bc?. (c) L3 {a21h3i+1c38+1 di +1 | i > 1,7 > 1,8 > 1} Derivation for the string: a454c7d2 (d) L4 {a3i+16i+362k d2k | i > 0, k > 0} U {a?"b8c58d"+1 | r > 0,s > 0} Derivation for the string: a-bcd2. 5. (6 marks) Let S = {a,b,c,d}. Give context-free grammars that generate the following languages. In each case, also give a derivation of the specified terminal string using your grammar. The derivation beginning from the start variable should indicate each individual derivation step using the notation (a) L1 = {b2c3k+1 | k> i>0} Derivation for the string: bc4. (b) L2 = {a_ih2i+2,5k+2 | i > 1, k > 1} Derivation for the string: a^bc?. (c) L3 {a21h3i+1c38+1 di +1 | i > 1,7 > 1,8 > 1} Derivation for the string: a454c7d2 (d) L4 {a3i+16i+362k d2k | i > 0, k > 0} U {a?"b8c58d"+1 | r > 0,s > 0} Derivation for the string: a-bcd2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started