wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Let G=({S},{a,b},R,S) be a context free grammar where the rule set R is
SaSb|SS|ϵ
Which of the following statements is true?

Open in App
Solution

The grammar is S aSb | SS|ϵ
(a) G is not ambiguous is false,since ϵ which belongs to L(G),has infinite number of dervation trees,which makes G ambiguous.Some derivation trees are given below


(b) There exists x,y ϵ L(G) such that xy/ϵ L(G) is false,since S SS can be used to denotes xy, whenever x ϵ L(G) and yϵ L(G)
(c) is true since this language is L(G)={w |na(w)=nb(w) and na(v)nb(v) where v is any prefix of w} which is equal to (anbn)
This language happens to be a deteministic context free language.
There exists a DPDA that accepts it.
(d) is false, as the given language is not regular (comparison between number of 'a' s and number of 'b' is there).
No DFA exists to accept it.

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Special Integrals - 1
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon