# Peterlinz question

207 views
Please write grammar for it and explain with example.

$L=\{w \: : n_a(w) > n_b(w) \}$

edited

1 vote
S -> ASb | bSA | SS | a
A-> aA | a

edited
1
is '$\epsilon$' present in language ?

## Related questions

1 vote
1
193 views
Please solve this question with proper explanation: $L=\{ w : \: n_a(w) = 2n_b(w) \}$
Give a context-free grammar that generates the language $A=\{a^{i}b^{j}c^{k}\mid i=j$ $\text{or}$ $j=k$ $\text{where}$ $i,j,k\geq 0\}.$ Is your grammar ambiguous$?$ Why or why not$?$
Show that the grammar with productions $S\rightarrow aAB,$ $A\rightarrow bBb,$ $B\rightarrow A|\lambda.$ is unambiguous.
Show that the grammar with productions $S\rightarrow SS,$ $S\rightarrow \lambda,$ $S\rightarrow aSb,$ $S\rightarrow bSa.$ is ambiguous.