Context Free Grammar of yesterday's exam

Context Free Grammar of yesterday's exam

by MATTEO PADRIN -
Number of replies: 5

Hello everyone, 

Yesterday during the exam (exercise 2) we were asked to prove \( L_1 = \{ a^n b a^n s.t. n\geq 1\} \in CFL \setminus REG \)

The proposed solution (after using P.Lemma) is that \( L_1\) is generated by:

\( S\to aSb| aBb \text{ and } B \to b \)

However, this production \(S\to aBb \to abb\) shows that this generates \( L_B = \{ a^n b b^n s.t. n\geq 1\} \). If I am missing something, please let me know and if that is just a typo, hope that this post will avoid 100 different emails. 

In reply to MATTEO PADRIN

Re: Context Free Grammar of yesterday's exam

by LUCA FANTIN -
I noticed it too. I agree with you and with Alvise, I think the correct solution is S -> aSa | aba
In reply to MATTEO PADRIN

Re: Context Free Grammar of yesterday's exam

by Giorgio Satta -

sorry !! There is a mistake, I got distracted, symbol b is a separator and should only be used once ... I will later correct the pdf.

In reply to MATTEO PADRIN

Re: Context Free Grammar of yesterday's exam

by Vishesh Goyal -
Wait But in the pdf its already S->aSa|aBa, B->b isnt that correct
image.png
In reply to Vishesh Goyal

Re: Context Free Grammar of yesterday's exam

by MATTEO PADRIN -

Hi, 

Professor Satta confirmed it was a typo and rapidly corrected the pdf.