-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
  • What did you try? Where did you get stuck? We're happy to help you understand the concepts but just solving exercise-like tasks for you is unlikely to achieve that. You might find this page helpful in improving your question. – D.W. Jan 01 '23 at 20:20
  • Let me direct you towards our reference questions which cover your problem in detail, particularly https://cs.stackexchange.com/q/18524/755. Please work through the related questions listed there, try to solve your problem again and edit to include your attempts along with the specific problems you encountered. – D.W. Jan 01 '23 at 20:20

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
  • 15,071
  • 2
  • 27
  • 52