Question: L = { w epsi { 0 , 1 } * : w #w #w : where w = w } Given a string

L ={w \epsi {0,1}*: w#w#w : where w= w}
Given a string w over some alphabet \Sigma , let w be its reverse. For example, if w =10110, then w=01101.
Let's say, we have the following 4 CFGs labeled as (A) to (C).
CFG A:
S ->1S0|0S1| #P#
P ->0P |1P |\epsi
CFG B:
S ->0S |1S | #P#
P ->0P0|1P1|\epsi
CFG C:
S ->0S0|1S1| #P#
P ->0P |1P |\epsi
What will be the correct CFG for the language L?
Note, for a language L, the CFG will be correct if and only if it can parse all the strings, w in L, and doesnt parse any string, w L.
*
2 points
A
B
C

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!