Skip to main content
edited tags; edited title
Link
Yuval Filmus
  • 279.1k
  • 27
  • 316
  • 512

Generating a language from context-free grammar Language of particular CFG

Source Link
Tegernako
  • 145
  • 1
  • 5

Generating a language from context-free grammar

Let: $ G = <V, \Sigma, R, S >: \\ V = \{ S,A,B,C \} \\ \Sigma = \{0, 1\} \\ R: \\ S \to CSC|A \\ A \to 0B1|1B0 \\ B \to CB|\epsilon\\ C \to 1|0 $

I need to find the language (no need to formally prove). I have written many words but cannot seem to find a rule. After trying that path I rewrote the grammar in a shorter rules:

$$ S \to 0S0|0S1|1S0|1S1|0B1|1B0 \\ B \to 1B|0B|\epsilon $$

What should be my way of finding any pattern? to go each possible path independently ?