UGC NET CS 2023Theory of Computation and Compilers › Context Free LanguageVerified
UGC NET CS 2023 PYQ: Consider the following language : $$L=\left\{w \in\{a, b, c\} *:…
Consider the following language :
$$L=\left\{w \in\{a, b, c\} *: n_{a}(\omega)+n_{b}(\omega)=n_{c}(\omega)\right\}$$
$\mathrm{L}$ is
- AContext free but not linearCorrect answer
- BNot context free
- CContext free and linear
- DLinear
Answer
(A) Context free but not linear
Approach
Show L is context-free via a grammar, then show it is not linear by intersecting with a regular language.
Reviewed by UGC IQ Editorial Team.