# Constructing PDA to accept language $\{a^ib^j \mid 0 \leq j \leq 2i\}$

How can I construct a PDA which accepts the language $$\{a^ib^j \mid 0 \leq j \leq 2i\}$$?

• What have you tried? Where did you get stuck? – dkaeae Jan 25 at 16:24
• Also, the construction should not be too hard if you are familiar with the PDA for $\{ a^k b^k \mid k \in \mathbb{N}_0 \}$. – dkaeae Jan 25 at 16:25

Read the input string. if read $$b$$ and the stack is empty, reject the string. If see $$a$$, push two $$a$$ to the stack. If read $$b$$, pop a value from the stack. Finally, if read the end of the string, it will be accepted.