Question: Exercise 2 . 1 ( in Sipser text ) 2 . Give context - free grammars generating each of the following languages over = {

Exercise 2.1(in Sipser text)2. Give context-free grammars generating each of the following languages over ={0,1}:a.{w : w starts and ends with the same symbol}b.{w : |w| is odd}c.{w : |w|5}d.{w : |w|>5 or its third symbol is 0}3. Give context-free grammars generating each of the following languages over ={0,1}:a){0n1m0n: m, n 1}b){0n1n0m1m: m, n 0}c){0n1m0m1n: m, n 0}4. Consider the language L ={0n1m0k: m, n, k 0 and m = n or m = k} over ={0,1}:a) Give a context-free grammar generating L.b) Show that your grammar for L is ambiguous.

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 Programming Questions!