0% found this document useful (0 votes)
209 views

Assignment-2: TH TH

The document outlines an assignment that is due on April 20th, 2015 before 4pm and cannot be submitted prior or after the deadline. It contains 8 questions regarding regular languages and grammars, finite automata, context-free languages and grammars, and pushdown automata. The questions involve tasks such as writing regular expressions, converting regular expressions to finite automata, proving whether languages are regular or context-free, constructing grammars and pushdown automata, and determining if languages are context-free.

Uploaded by

Ishit Mehta
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
209 views

Assignment-2: TH TH

The document outlines an assignment that is due on April 20th, 2015 before 4pm and cannot be submitted prior or after the deadline. It contains 8 questions regarding regular languages and grammars, finite automata, context-free languages and grammars, and pushdown automata. The questions involve tasks such as writing regular expressions, converting regular expressions to finite automata, proving whether languages are regular or context-free, constructing grammars and pushdown automata, and determining if languages are context-free.

Uploaded by

Ishit Mehta
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment-2

Submit to Manohar at CSTAR on Monday 20th April, 2015 before 4pm.


(Only on 20th , no prior/post submissions allowed)
1. L = {x : x contains at least two zeroes and at most one 1}. Give the regular
expression for above language.
2. Convert the following regular expressions to nondeterministic finite automata.
(a) (0 1) 000(0 1)
(b) (((00) (11)) 01)
(c)
3. For each of the following languages, give two strings that are members and
another two strings that are not members. Assume the alphabet = {a, b}
in all the cases.
(a) a(ba) b
(b) a b a .
(c) (a)b.
4. Prove whether the following languages are regular or not regular:
(a)
(b)
(c)
(d)

{0n | n 0}
{0n 1n | n 0}
{ww | w belongs to {a,b} }
{0i 1j 2k | i > j or j > k }

5. For the languages below, prove whether they are 1. Regular. 2. Context free
but not regular. 3. Not context free.
(a)
(b)
(c)
(d)

{0m 1n | m!=n}
{ww | w is a binary string}
{ai bj ck | i2j or j3k}
{ai bj ck | ij or jk}

6. Give a context free grammar that generates


(a) The language that has equal numbers of 0 s and 1 s and contains 101.
(b) The language of all strings of the form 0m 1n where n m 0.
7. Construct PDAs to accept the following languages.
(a) {1n 02n | n > 0}

(b) {10n 1n | n > 0} {110n 1n | n > 0}


8. Determine and prove whether each of the following languages is Context
Free or not.
(a) {1k 0i 1i 0j 1j 0k | i,j,k > 0}
(b) {0i 1i 0j 1i | i,j > 0 }

You might also like