Question: 1 . ( 2 5 marks ) Provide the rules for context - free grammars that generate the following languages. ( a ) L 1
marks Provide the rules for contextfree grammars that generate the following languages.
a Lw in a b
w starts and ends with ba and contains at least one other occurrence of
ba somewhere in between
b La
pb
qc
rd
s
p q r s in Z
nonneg, p s q r
c Lw in
nw and nw
d La
nx n in Z
nonneg, x in b c
x n
For example, the strings aaabccbc and cbc are in L but the strings aacbc, aaabbc and
aabacccc are not.
e La
ib
jc
k
i j or j k; i j k in Z
nonneg
For example, the strings aabbcccc, aaaaabc, abc, ccc and are in L but the strings
abbccc and abacc are not.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
