1

I have got following question:

Determine whether the following language is context free or not: $$L = \{ w \in \{a,b,c\}^*: n_a (w) = n_b (w) = 2n_c (w)\}. $$

What is the meaning of $2n_c$ in the above question?

Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514
user2994783
  • 271
  • 3
  • 12

1 Answers1

1

This language is not CFL.

Consider the language $L \cap a^*b^*c^*$ . Assume that $L$ is CFL, now, as $ a^*b^*c^*$ is regular and CFL are closed under intersection with regular languages, $L \cap a^*b^*c^*$ would be CFL. But $L \cap a^*b^*c^* = a^nb^nc^{2n}$, which is not context free (The proof is similar to this). Hence the contradiction!

Thus the given language is not CFL.

prime_hit
  • 948
  • 4
  • 12