hw5a - Copy (2)

hw5a - Copy (2) - | aAcc A → bAc | bc 3. (Sudkamp 3.14...

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

View Full Document Right Arrow Icon
MCS4653, Theory of Computation Homework Assignment 5, Due 10/13/03 Name Student ID Page 1 1. (Sudkamp 3.6 page 83) For each of the following context-free grammars, use set notation to define the language generated by the grammar. a) S aaSB | λ B bB | b { ( aa ) m b n | m > 0 ,n m } ∪ { λ } b) S aSbb | A A cA | c { a m c n b 2 m | m 0 ,n > 0 } c) S abSdc | A A cdAba | λ { ( ab ) m ( cd ) n ( ba ) n ( dc ) m | m,n 0 } d) S aSb | A A cAd | cBd B aBb | ab { a m c n a p b p d n b m | m 0 ,n,p > 0 } e) S aSB | aB B bb | b { a m b n | m > 0 ,m n 2 m } 2. (Sudkamp 3.8 page 83) Construct a grammar over { a,b,c } whose language is { a n b m c 2 n + m | n,m > 0 } S aScc
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: | aAcc A → bAc | bc 3. (Sudkamp 3.14 page 84) For each of the following regular grammars, give a regular expression for the language generated by the grammar. a) S → aA A → aA | bA | b a ( a ∪ b ) * b b) S → aA A → aA | bB B → bB | λ a + b + c) S → aS | bA A → bB B → aB | λ a * bba * d) S → aS | bA | λ A → aA | bS ( a + ( ba * b ∪ λ )) *...
View Full Document

This note was uploaded on 09/26/2011 for the course TOC 1345 taught by Professor Joe during the Spring '11 term at HDM Stuttgart.

Ask a homework question - tutors are online