Skip to content

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

  1. A
    Context free but not linear
    Correct answer
  2. B
    Not context free
  3. C
    Context free and linear
  4. D
    Linear

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.