Question: 1) Consider the following language over = {a, b, c}: { a i b j c k : i = j or i = k

1) Consider the following language over = {a, b, c}:

{aibjck : i = j or i = k or j = k; i, j, k 0}

a) Give a context-free grammar that generates this language

b) Show that your grammar is ambiguous

2) Give a context-free grammar generating the following language over

= {a, b, #}:

{x#y : x, y {a, b}*; |x| |y|}

3) Give a context-free grammar generating the following language over

= {a, b}:

{w : w is not a palindrome; w *}

4) Give a context-free grammar generating the following language over

= {0, 1}:

{0n1m : m, n 0 and n < 2m}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!