Hey so I am currently stuck on a question regarding context free grammars. Here is the question:
Construct a context-free grammar for the language L1 = {w1#w2 | w1 and w2 contain the same number of ones} and provide a derivation for the string w = 1001010#111.
I know the grammar should start out like:
S -> S1 # S1
S1 -> ?
I'm not sure how to make each word have the same number of ones. Any suggestions?