Which grammar generates the language: $L = \{a^i b^j d^k | i, j, k ≥ 0 ∧ j < k\}$

408 Views Asked by At

I am unsure, how can the second answer be the right one - and why not the first one? Can some one explain it step by step?

enter image description here

Why i think the first answer is right: $aS \to aSA \to aAAd \to abddd$

1

There are 1 best solutions below

7
On BEST ANSWER

It can't be the first because the first grammar generate the word $ddbd\notin \mathcal L$

$$S\to SA \to Sbd \to Adbd \to ddbd$$