If you add S-> 0|1, the language accepts 0 and 1, which don't have an equal number of 0's and 1's. On the other hand, S-> 0S1 | 1S0 | ε probably accepts all strings of only even length :) (though it comes to mind in the first thought)
Thanks for the explanation :), Looking back I'm a bit surprised that I believed odd strings could exist in that language... not sure what I was thinking d: (unless you can have half a "1" and half a "0", but I very much doubt it..)
Great tutorial! Could someone please explain why this is or isn't correct: S --> 11A | 1D1D | A | λ A --> 00S | 0C0C | S | λ C --> 1S | 1A D --> 0A | 0S Thanks in advance.
Thank you very much. What a nice compliment!
+hhp3 Well deserved, too. I've searched through youtube and yours are probably the most comprehensive and clear of all the videos on the topic.
I appreciate all your efforts Mr. Porter. Your videos are brilliant and very clear.
Professor please do a video on Myhill Nerode's theorem. For dfa state minimization and proving a language is regular using it.
Is this another CF grammar for the example?
S--> 0S1 | 1S0 | ε
Thought of it too,
I think you should add S ->0|1 in order to allow accept an odd number off characters.
If you add S-> 0|1, the language accepts 0 and 1, which don't have an equal number of 0's and 1's. On the other hand, S-> 0S1 | 1S0 | ε probably accepts all strings of only even length :) (though it comes to mind in the first thought)
Thanks for the explanation :),
Looking back I'm a bit surprised that I believed odd strings could exist in that language... not sure what I was thinking d:
(unless you can have half a "1" and half a "0", but I very much doubt it..)
so this will be allowed as the right answer?
Almost! However, you can't make strings like "1001" with that grammar.
Great tutorial! Could someone please explain why this is or isn't correct:
S --> 11A | 1D1D | A | λ
A --> 00S | 0C0C | S | λ
C --> 1S | 1A
D --> 0A | 0S
Thanks in advance.
I love you