Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
413 views
in General by (78.8k points)
closed by

Consider the following context-free grammar over the alphabet ∑ = {a, b, c} with S as the start symbol:

S → abScT | abcT

T → bT | b

Which one of the following represents the language generated by the above grammar?
1. {(ab)n (cb)n | n ≥ 1}
2. {(ab)n cbm1 cbm2 … cbm|n, m1, m2 … , mn ≥ 1}
3. {(ab)n (cbm)n | m, n ≥ 1}
4. {(ab)n (cbn)m | m, n ≥ 1}

1 Answer

0 votes
by (79.1k points)
selected by
 
Best answer
Correct Answer - Option 2 : {(ab)n cbm1 cbm2 … cbm|n, m1, m2 … , mn ≥ 1}

String Derivation:

S → abScT

→ ababScTcT (∵ S → abScT)

→ abababcTcTcT (∵ S → abcT)

→ abababcbTcTcT (∵ T → bT)

→ abababcbbTcTcT (∵ T → bT)

→ abababcbbbTcTcT (∵ T → bT)

→ abababcbbbbcTcT (∵ T → b)

→ abababcbbbbcbcT (∵ T → b)

→ abababcbbbbcbcbT (∵ T → bT)

→ abababcbbbbcbcbb (∵ T → b)

abababcbbbbcbcbb = (ab)3cb4cbcb2

From this string, it is clear that all the option 1),3) and 4) are not generated by given grammar.

Only option 2 matches.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...