Denote our context free grammar by $G=(V, \Sigma, R, S)$ whereby $V=\{S,S_1, S_2, S_3\}$ is our set of variables, $S$ denotes the start variable and $\Sigma=\{0,1\}$ is our set of terminals. Then our rules $R$ are given by
\begin{alignat}{1}S &\to 1S_1\\\
S_1 &\to 1S_1\ |\ S_2\ \\
S_2 &\to 0S_2\ |\ S_3\ \\
S_3 &\to 1S_3\ |\ \epsilon
\end{alignat}
We can generate the following words:
- $101$
- $1\cdots 01$
- $101\cdots$
- $10\cdots 1$
- $10 \cdots 1 \cdots$
- $1 \cdots 0 \cdots 1$
- $1 \cdots 0 \cdots 1 \cdots$
EDIT
The above grammar is only valid for the given language for $i,j,k >0$ as @rici correctly pointed out in the comments.
Here is the set of rules for $i,j,k \geq 0$ for the grammar $G=(V, \Sigma, R, S)$ with $V=\{S,S_1,S_2, S_3\}$.
\begin{alignat}{1}S &\to S_1\ |\ S_2\\\
S_1 &\to 0S_1\ |\ S_3\ |\ \epsilon\ \\
S_2 &\to 1S_2\ |\ S_1\ |\ \epsilon \\
S_3 &\to 1S_3\ |\ \epsilon
\end{alignat}
This can generate the following words:
- $\epsilon$ (if $i=j=k=0$)
- $1$
- $0$
- $1\cdots$
- $0\cdots$
- $0\cdots 1 \cdots$
- $1\cdots 0 \cdots$
- $1\cdots 0 \cdots 1 \cdots$
Note: with $\cdots$ I mean zero or more repitions.
Best Answer
A grammar is ambiguous if there's a word which has two different derivation trees. You'll have to look up derivation tree in your textbook since drawing them is awkward, but the idea that it doesn't matter in which order you're doing the derivations as long as it's basically the same derivation.
For example, consider the grammar \begin{align} S &\rightarrow AS|a \\ A &\rightarrow a \end{align}
Let's derive $aa$ twice: $$ S \rightarrow AS \rightarrow Aa \rightarrow aa $$ $$ S \rightarrow AS \rightarrow aS \rightarrow aa $$ These derivations share the same derivation tree:
However, consider now the grammar \begin{align} S\rightarrow SS|a \end{align}
generating the same language.
There are now two "really" different derivations for $aaa$: $$S \rightarrow SS \rightarrow Sa \rightarrow SSa \rightarrow Saa \rightarrow aaa$$ $$S \rightarrow SS \rightarrow aS \rightarrow aSS \rightarrow aaS \rightarrow aaa$$
In the first derivation, the first two $a$'s are derived together, whereas in the second derivation, it is the second two $a$'s which are derived together. So it's $(aa)a$ vs. $a(aa)$.
In this case, the language $a^+$ has an unambiguous grammar (the first one I exhibited), but in other cases, all grammars are ambiguous; such languages are called inherently ambiguous. See my other answer for more on that.