What is a correct context free grammar for the following language defined over t
ID: 3770047 • Letter: W
Question
What is a correct context free grammar for the following language defined over the alphabet {a, b, c}:
L = {anbmck | n, m, k 0 and either n = m or m = k}
S -> AB
A -> aA |
B -> bBc |
S -> AB
A -> aAb |
B -> bBc |
S -> AB | CD
A -> aAb |
B -> cB |
C -> aC |
D -> bDc |
S -> AB
A -> aAb |
B -> cB |
A.S -> AB
A -> aA |
B -> bBc |
B.S -> AB
A -> aAb |
B -> bBc |
C.S -> AB | CD
A -> aAb |
B -> cB |
C -> aC |
D -> bDc |
D.S -> AB
A -> aAb |
B -> cB |
Explanation / Answer
Answer C