Find a CFG for $\{a^ib^jc^k \mid i,j,k\ge0 , \text{if } j=1 \text{ then } i=k\}$
$ S =&gt;S_1 \mid S_2 \mid S_3 $

$ S_1 =&gt;AC  $

$ S_2 =&gt; aS_2c  \mid b $

$ S_3 =&gt; AbbBC $

$ A =&gt;aA \mid epsilon  $

$ B =&gt;bB \mid epsilon  $

$ C =&gt;cC \mid epsilon  $