Creating "Zigzag" context-free grammar of $2$ languages with the same letters

41 Views Asked by At

Given are $2$ right-linear grammars, forming $L_1$ and $L_2$. The alphabet $T$ is the same for both languages, and $\epsilon$ (empty word) doesn't belong to any of the languages.

What is an example of a right-linear grammar that forms the following language?

$$L=\{ \alpha_1\beta_1\alpha_2\beta_2\alpha_3\beta_3...\alpha_n\beta_n \space | \space n \in \mathbb N, n> 0,\forall i \space \alpha_i,\beta_i \in T , \alpha_1\alpha_2\alpha_3...\alpha_n \in L_1, \beta_1\beta_2\beta_3...\beta_n \in L_2\}$$

If the required grammar is $G=\{V,T,S,P\}$, and $P$ is the rewrite rules/production rules, I am mainly interested in the set of rules of $P$. I really have no idea how to approach this and will aprreciate any help.