I'm trying to understand the approach to constructing an grammar which accepts the language ${a^ib^j \mid i>0\ and \hspace{2.5mm}i\leq j \leq(2*i)}$ } Thanks.
1 Answers
Short answer: unfortunately, it can't be done.
It can be proven mathematically that this language isn't regular. The easiest way is a fooling set argument: the set $\{a^{3^i} \mid i \in \mathbb{N}\}$ is infinite, and for any two distinct strings $x$ and $y$ you take from this set, I can construct a suffix $z$ such that $xz$ is in your language and $yz$ is not.
Thus, it's utterly impossible to make a regular grammar for this language.
Note that this language is context-free; the following context-free grammar (CFG) recognizes it:
$$S \rightarrow aXb \mid aXbb \\ X \rightarrow aXb \mid aXbb \mid \varepsilon$$
(The distinction between $S$ and $X$ is just to ensure that $i > 0$; if you drop that requirement, you can do this in one line.)
EDIT: Thanks to Apass.Jack, here's a one-liner for you anyway!
$$S \rightarrow aSb \mid aSbb \mid ab \mid abb$$