Context-Free Grammar (CFG) Example: {a^i b^j c^k : i at most j+k}

preview_player
Показать описание
Here we create a context-free grammar (CFG) for the language {a^i b^j c^k : i is at most j+k}. This is not inherently a hard language, since we take advantage of the fact that i (the number of a's at the front) is at most j+k (the sum of numbers of b's and c's). Therefore, we can match at most one "a" with every "b", and same with the "c"s. We have to use a different variable (at least in this CFG) to process the b's since there is an order on where the b's appear in the string (they're in the middle).

▶ABOUT ME◀
I am a professor of Computer Science, and am passionate about it. I have taught many courses at several different universities, including several sections of undergraduate and graduate theory-level classes.

The views expressed in this video are not reflective of any of my current or former employers.
Рекомендации по теме
Комментарии
Автор

Hello,
Can you please tell me where to start when trying to get the gist of CFGs?
Or can you say something about why they exist? What problems do they exist to solve in Computer Science?

shiewhun
Автор

Gonzalez Kimberly Gonzalez Jason Gonzalez Anthony

NxndbhduKnbsuxdh
Автор

Sir can u tell from which book u have taken

hussainshaikh
join shbcf.ru