I am trying to solve the following context free grammar problem with hashtag approach but i can't figure it out. Can anyone help please?

Show a context-free grammar for the following languages: $$\{w\in\{a,b\}^*: \#_a(w)=2\#_b(w)\} $$

  • Can you explain what is hashtag approach? – Apass.Jack Dec 7 at 11:37
  • The exercise has a hashtag and that's what is confusing me. – csandreas1 Dec 7 at 11:43
  • 1
    $\#_a(w)$ probably means simply the number of "a"s in $w$... – dkaeae Dec 7 at 13:09
  • Why do you copy-paste a grammar for the language $\{ a^ ib^ jc^k \mid i=j \text{ or } j=k\}$ in your question? – Hendrik Jan Dec 7 at 18:49
  • My comment is irrelevant to the question, but what a veteran of formal grammar @HendrikJan is! – Apass.Jack Dec 7 at 20:45

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.