Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . ( 2 5 marks ) Provide the rules for context - free grammars that generate the following languages. ( a ) L 1

1.(25 marks) Provide the rules for context-free grammars that generate the following languages.
(a) L1={w in {a, b}
| w starts and ends with ba and contains at least one other occurrence of
ba somewhere in between}
(b) L2={a
pb
qc
rd
s
| p, q, r, s in Z
nonneg, p =4s, q > r}
(c) L3={w in {0,1}
| n0(w)>=2 and n1(w)>=1}
(d) L4={a
nx | n in Z
nonneg, x in {b, c}
,|x|>= n +2}
[For example, the strings aaabccbc and cbc are in L4, but the strings aacbc, aaabbc and
aabacccc are not.]
(e) L5={a
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 L5, but the strings
abbccc and abacc are not.]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions