Hw7 - Homework 7 CISC 303 Timo Kötzing([email protected]

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Homework 7 CISC 303 Timo Kötzing ([email protected]) Handed out: Monday, April 13. Due Date: Friday, April 17. The total number of points for this assignment is 32. If you work on problems from more that 32 points, you may get additional points as extra credit. Problem 1. (8 points) Give two CFGs accepting L and L 1 as de ned just below, respectively. (i) L = { w ∈ { a,b } * | w has no more than twice as many a s than b s (in any order) } . (ii) L 1 = L ( a * b * c * ) \ { a n b n c n | n ≥ } . Problem 2. (8 points) Give an algorithm isEmptyCFG that takes as input a grammar G and outputs true if L ( G ) = ∅ and false otherwise. Of course, you may call any algorithm from class inside your algorithm. Problem 3. (4 points) Let G be the grammar ( { a,b } , { S,X,Y } ,P,S ) , with P speci ed as follows. S → aX | aaY (1) X → aX | Y | ε (2) Y → bX | b (3) We want to non-deterministically parse the string aabaa , according to Algorithm 2.4.7 from the Lecture Notes....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online