-1

Build a context-free grammar for the language:

$L=\{\#x\#y\#\,\,;\,\,|x|=|y|\,\,\wedge\,\,x,y\in\{0,1\}^{*}\}$ over $\sum=\{0,1,\#\}$

How can I make sure that |x|=|y|?

DanielG
  • 99
  • 3

1 Answers1

1

Without giving you all the answer, consider using the following rules (to be completed):

$X \to AXA$

$A \to 0 \mid 1$

Nathaniel
  • 18,309
  • 2
  • 30
  • 58