Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



The reduced grammar equivalent to the grammar, whose production rules are given below, is

$S\to AB\mid CA$

$B\to BC\mid AB$

$A\to a$

$C\to aB\mid b$





Solution

Given grammar:

$S\to AB\mid CA$

$B\to BC\mid AB$

$A\to a$

$C\to aB\mid b$

Here,

$A\to a$, so $A$ is generating.

$C\to b$, so $C$ is generating.

But $B\to BC\mid AB$ always contains $B$ again.

So, $B$ is non-generating.

Remove all productions containing $B$.

Remaining grammar is:

$S\to CA$

$A\to a$

$C\to b$


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...