0

I'm struggling to find the context-free grammar for the following language: $$ L = \{a^sb^tc^m:s,t,m\in\mathbb{N}^+\land1\leq t\leq3\land s\times t=m\} $$ Any help would be appreciated.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503
louis_02
  • 7
  • 3

1 Answers1

3

Write $L$ in the following way: $$ L = \{ a^sbc^s : s \in \mathbb{N}^+ \} \cup \{ a^sb^2c^{2s} : s \in \mathbb{N}^+ \} \cup \{ a^sb^3c^{3s} : s \in \mathbb{N}^+ \}. $$

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503