0% found this document useful (0 votes)
117 views1 page

HW 1

This document provides the details of Homework #1 for the course TCS-602 Compiler Design. It includes 4 questions asking students to construct regular expressions, DFAs, NFAs and convert an NFA to a DFA for various languages over different alphabets. Students are asked to draw state graphs and provide state transition tables for the automata. The homework is due on March 4th, 2019.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
117 views1 page

HW 1

This document provides the details of Homework #1 for the course TCS-602 Compiler Design. It includes 4 questions asking students to construct regular expressions, DFAs, NFAs and convert an NFA to a DFA for various languages over different alphabets. Students are asked to draw state graphs and provide state transition tables for the automata. The homework is due on March 4th, 2019.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

TCS-602: Compiler Design

Homework#1
Due Time: March 4th, 2019

1. Construct regular expressions for the following languages.

a) Strings with an even number of quotes. That is, ’abc’, abc’’dd, aa’a’a’a’ are legal
strings while ’a, ’a’a’ab’a’ are illegal strings. Σ = {a,b,’ }.
b) Strings with an even number of letters. That is,Ɛ , ab, bbba, aaaaaa are legal strings
while a, aba are illegal strings. Σ = {a,b}.

2. Construct DFAs for the following languages.

a) All strings that is not the string if. Σ = {i,f}.


b) Strings where not all letters in the alphabet Σ appear on the string. That is, Ɛ, abab,
bccb, a are legal strings while abc, bbcaba are illegal strings. Σ = {a,b,c}.

3. Using the McNaughton-Yamada-Thompson Algorithm, construct an NFA from the regular


expression (Σ = {0,1}):

0((0|1)∗1)∗1

a) Draw a state graph for the NFA.


b) Construct the state transition table for the NFA taking into consideration Ɛ –closures.

4. Convert the above NFA to a DFA.

a) Construct the state transition table for the DFA, starting from the start state.
b) Draw the state graph for the DFA.
c) If necessary, minimize the state graph for the DFA.

You might also like