0

I have to find the context-free grammar of this language: $ L=\{a^nb^m, n\neq 2m\} $

So I did:

$ S \to a \mid aYb \mid \epsilon$

$Y \to aSb \mid X \mid \epsilon$

$X \to bX \mid \epsilon $

is it correct?

Nathaniel
  • 15,071
  • 2
  • 27
  • 52
Mah
  • 1
  • What do you think? – Nathaniel Oct 02 '22 at 12:04
  • well thank you haha, but do you have any answer too? – Mah Oct 02 '22 at 12:05
  • We discourage "please check whether my answer is correct" questions, as only "yes/no" answers are possible, which won't help you or future visitors. See here and here. Can you edit your post to ask about a specific conceptual issue you're uncertain about? As a rule of thumb, a good conceptual question should be useful even to someone who isn't looking at the problem you happen to be working on. If you just need someone to check your work, you might seek out a friend, classmate, or teacher. – D.W. Oct 02 '22 at 17:03

0 Answers0