Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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